| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 void clear(); | 75 void clear(); |
| 76 void documentDetached(); | 76 void documentDetached(); |
| 77 | 77 |
| 78 PlainTextRange getSelectionOffsets() const; | 78 PlainTextRange getSelectionOffsets() const; |
| 79 // Returns true if setting selection to specified offsets, otherwise false. | 79 // Returns true if setting selection to specified offsets, otherwise false. |
| 80 bool setEditableSelectionOffsets(const PlainTextRange&, FrameSelection::SetS
electionOptions = FrameSelection::CloseTyping); | 80 bool setEditableSelectionOffsets(const PlainTextRange&, FrameSelection::SetS
electionOptions = FrameSelection::CloseTyping); |
| 81 void extendSelectionAndDelete(int before, int after); | 81 void extendSelectionAndDelete(int before, int after); |
| 82 PlainTextRange createRangeForSelection(int start, int end, size_t textLength
) const; | 82 PlainTextRange createRangeForSelection(int start, int end, size_t textLength
) const; |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 class SelectionOffsetsScope { | |
| 86 WTF_MAKE_NONCOPYABLE(SelectionOffsetsScope); | |
| 87 STACK_ALLOCATED(); | |
| 88 public: | |
| 89 explicit SelectionOffsetsScope(InputMethodController*); | |
| 90 ~SelectionOffsetsScope(); | |
| 91 private: | |
| 92 Member<InputMethodController> m_inputMethodController; | |
| 93 const PlainTextRange m_offsets; | |
| 94 }; | |
| 95 friend class SelectionOffsetsScope; | |
| 96 | |
| 97 Member<LocalFrame> m_frame; | 85 Member<LocalFrame> m_frame; |
| 98 Member<Range> m_compositionRange; | 86 Member<Range> m_compositionRange; |
| 99 bool m_isDirty; | 87 bool m_isDirty; |
| 100 bool m_hasComposition; | 88 bool m_hasComposition; |
| 101 | 89 |
| 102 explicit InputMethodController(LocalFrame&); | 90 explicit InputMethodController(LocalFrame&); |
| 103 | 91 |
| 104 Editor& editor() const; | 92 Editor& editor() const; |
| 105 LocalFrame& frame() const | 93 LocalFrame& frame() const |
| 106 { | 94 { |
| 107 DCHECK(m_frame); | 95 DCHECK(m_frame); |
| 108 return *m_frame; | 96 return *m_frame; |
| 109 } | 97 } |
| 110 | 98 |
| 111 String composingText() const; | 99 String composingText() const; |
| 112 void selectComposition() const; | 100 void selectComposition() const; |
| 113 bool setSelectionOffsets(const PlainTextRange&, FrameSelection::SetSelection
Options = FrameSelection::CloseTyping); | 101 bool setSelectionOffsets(const PlainTextRange&, FrameSelection::SetSelection
Options = FrameSelection::CloseTyping); |
| 114 }; | 102 }; |
| 115 | 103 |
| 116 } // namespace blink | 104 } // namespace blink |
| 117 | 105 |
| 118 #endif // InputMethodController_h | 106 #endif // InputMethodController_h |
| OLD | NEW |