OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 bool commitText(const String& text, int relativeCaretPosition); | 64 bool commitText(const String& text, int relativeCaretPosition); |
65 | 65 |
66 // Inserts ongoing composing text; changes the selection to the end of | 66 // Inserts ongoing composing text; changes the selection to the end of |
67 // the inserting text if DoNotKeepSelection, or holds the selection if | 67 // the inserting text if DoNotKeepSelection, or holds the selection if |
68 // KeepSelection. | 68 // KeepSelection. |
69 bool finishComposingText(ConfirmCompositionBehavior); | 69 bool finishComposingText(ConfirmCompositionBehavior); |
70 | 70 |
71 // Deletes the existing composition text. | 71 // Deletes the existing composition text. |
72 void cancelComposition(); | 72 void cancelComposition(); |
73 | 73 |
74 void cancelCompositionIfSelectionIsInvalid(); | |
75 EphemeralRange compositionEphemeralRange() const; | 74 EphemeralRange compositionEphemeralRange() const; |
76 Range* compositionRange() const; | 75 Range* compositionRange() const; |
77 | 76 |
78 void clear(); | 77 void clear(); |
79 void documentDetached(); | 78 void documentDetached(); |
80 | 79 |
81 PlainTextRange getSelectionOffsets() const; | 80 PlainTextRange getSelectionOffsets() const; |
82 // Returns true if setting selection to specified offsets, otherwise false. | 81 // Returns true if setting selection to specified offsets, otherwise false. |
83 bool setEditableSelectionOffsets(const PlainTextRange&, FrameSelection::SetS
electionOptions = FrameSelection::CloseTyping); | 82 bool setEditableSelectionOffsets(const PlainTextRange&, FrameSelection::SetS
electionOptions = FrameSelection::CloseTyping); |
84 void extendSelectionAndDelete(int before, int after); | 83 void extendSelectionAndDelete(int before, int after); |
85 PlainTextRange createRangeForSelection(int start, int end, size_t textLength
) const; | 84 PlainTextRange createRangeForSelection(int start, int end, size_t textLength
) const; |
86 | 85 |
87 private: | 86 private: |
88 Member<LocalFrame> m_frame; | 87 Member<LocalFrame> m_frame; |
89 Member<Range> m_compositionRange; | 88 Member<Range> m_compositionRange; |
90 bool m_isDirty; | 89 bool m_isDirty; |
91 bool m_hasComposition; | |
92 | 90 |
93 explicit InputMethodController(LocalFrame&); | 91 explicit InputMethodController(LocalFrame&); |
94 | 92 |
95 Editor& editor() const; | 93 Editor& editor() const; |
96 LocalFrame& frame() const | 94 LocalFrame& frame() const |
97 { | 95 { |
98 DCHECK(m_frame); | 96 DCHECK(m_frame); |
99 return *m_frame; | 97 return *m_frame; |
100 } | 98 } |
101 | 99 |
(...skipping 11 matching lines...) Expand all Loading... |
113 // and moves caret. Returns true if did replace and moved caret successfully
. | 111 // and moves caret. Returns true if did replace and moved caret successfully
. |
114 bool replaceCompositionAndMoveCaret(const String&, int relativeCaretPosition
); | 112 bool replaceCompositionAndMoveCaret(const String&, int relativeCaretPosition
); |
115 | 113 |
116 // Returns true if moved caret successfully. | 114 // Returns true if moved caret successfully. |
117 bool moveCaret(int newCaretPosition); | 115 bool moveCaret(int newCaretPosition); |
118 }; | 116 }; |
119 | 117 |
120 } // namespace blink | 118 } // namespace blink |
121 | 119 |
122 #endif // InputMethodController_h | 120 #endif // InputMethodController_h |
OLD | NEW |