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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 void clear(); | 79 void clear(); |
80 | 80 |
81 PlainTextRange getSelectionOffsets() const; | 81 PlainTextRange getSelectionOffsets() const; |
82 // Returns true if setting selection to specified offsets, otherwise false. | 82 // Returns true if setting selection to specified offsets, otherwise false. |
83 bool setEditableSelectionOffsets(const PlainTextRange&); | 83 bool setEditableSelectionOffsets(const PlainTextRange&); |
84 void extendSelectionAndDelete(int before, int after); | 84 void extendSelectionAndDelete(int before, int after); |
85 | 85 |
86 private: | 86 private: |
87 class SelectionOffsetsScope { | 87 class SelectionOffsetsScope { |
88 WTF_MAKE_NONCOPYABLE(SelectionOffsetsScope); | 88 WTF_MAKE_NONCOPYABLE(SelectionOffsetsScope); |
| 89 STACK_ALLOCATED(); |
89 public: | 90 public: |
90 SelectionOffsetsScope(InputMethodController*); | 91 explicit SelectionOffsetsScope(InputMethodController*); |
91 ~SelectionOffsetsScope(); | 92 ~SelectionOffsetsScope(); |
92 private: | 93 private: |
93 InputMethodController* m_inputMethodController; | 94 RawPtrWillBeMember<InputMethodController> m_inputMethodController; |
94 const PlainTextRange m_offsets; | 95 const PlainTextRange m_offsets; |
95 }; | 96 }; |
96 friend class SelectionOffsetsScope; | 97 friend class SelectionOffsetsScope; |
97 | 98 |
98 RawPtrWillBeMember<LocalFrame> m_frame; | 99 RawPtrWillBeMember<LocalFrame> m_frame; |
99 RefPtrWillBeMember<Text> m_compositionNode; | 100 RefPtrWillBeMember<Text> m_compositionNode; |
100 // We don't use PlainTextRange which is immutable, for composition range. | 101 // We don't use PlainTextRange which is immutable, for composition range. |
101 unsigned m_compositionStart; | 102 unsigned m_compositionStart; |
102 unsigned m_compositionEnd; | 103 unsigned m_compositionEnd; |
103 // startOffset and endOffset of CompositionUnderline are based on | 104 // startOffset and endOffset of CompositionUnderline are based on |
(...skipping 13 matching lines...) Expand all Loading... |
117 void selectComposition() const; | 118 void selectComposition() const; |
118 enum FinishCompositionMode { ConfirmComposition, CancelComposition }; | 119 enum FinishCompositionMode { ConfirmComposition, CancelComposition }; |
119 // Returns true if composition exists. | 120 // Returns true if composition exists. |
120 bool finishComposition(const String&, FinishCompositionMode); | 121 bool finishComposition(const String&, FinishCompositionMode); |
121 bool setSelectionOffsets(const PlainTextRange&); | 122 bool setSelectionOffsets(const PlainTextRange&); |
122 }; | 123 }; |
123 | 124 |
124 } // namespace blink | 125 } // namespace blink |
125 | 126 |
126 #endif // InputMethodController_h | 127 #endif // InputMethodController_h |
OLD | NEW |