OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 const WebFloatSize& elasticOverscrollDelta, | 131 const WebFloatSize& elasticOverscrollDelta, |
132 float scaleFactor, | 132 float scaleFactor, |
133 float topControlsShownRatioDelta) { } | 133 float topControlsShownRatioDelta) { } |
134 | 134 |
135 // Called to inform the WebWidget that mouse capture was lost. | 135 // Called to inform the WebWidget that mouse capture was lost. |
136 virtual void mouseCaptureLost() { } | 136 virtual void mouseCaptureLost() { } |
137 | 137 |
138 // Called to inform the WebWidget that it has gained or lost keyboard focus. | 138 // Called to inform the WebWidget that it has gained or lost keyboard focus. |
139 virtual void setFocus(bool) { } | 139 virtual void setFocus(bool) { } |
140 | 140 |
141 // Called to inform the WebWidget of a new composition text. | |
142 // If selectionStart and selectionEnd has the same value, then it indicates | |
143 // the input caret position. If the text is empty, then the existing | |
144 // composition text will be cancelled. | |
145 // Returns true if the composition text was set successfully. | |
146 virtual bool setComposition( | |
147 const WebString& text, | |
148 const WebVector<WebCompositionUnderline>& underlines, | |
149 int selectionStart, | |
150 int selectionEnd) { return false; } | |
151 | |
152 enum ConfirmCompositionBehavior { | |
153 DoNotKeepSelection, | |
154 KeepSelection, | |
155 }; | |
156 | |
157 // Called to inform the WebWidget that deleting the ongoing composition if | |
158 // any, inserting the specified text, and moving the caret according to | |
159 // relativeCaretPosition. | |
160 virtual bool commitText(const WebString& text, int relativeCaretPosition) {
return false; } | |
161 | |
162 // Called to inform the WebWidget to confirm an ongoing composition. | |
163 virtual bool finishComposingText(ConfirmCompositionBehavior selectionBehavio
r) { return false; } | |
164 | |
165 // Fetches the character range of the current composition, also called the | 141 // Fetches the character range of the current composition, also called the |
166 // "marked range." | 142 // "marked range." |
167 virtual WebRange compositionRange() { return WebRange(); } | 143 virtual WebRange compositionRange() { return WebRange(); } |
168 | 144 |
169 // Returns information about the current text input of this WebWidget. | 145 // Returns information about the current text input of this WebWidget. |
170 // Note that this query can be expensive for long fields, as it returns the | 146 // Note that this query can be expensive for long fields, as it returns the |
171 // plain-text representation of the current editable element. Consider using | 147 // plain-text representation of the current editable element. Consider using |
172 // the lighter-weight textInputType() when appropriate. | 148 // the lighter-weight textInputType() when appropriate. |
173 virtual WebTextInputInfo textInputInfo() { return WebTextInputInfo(); } | 149 virtual WebTextInputInfo textInputInfo() { return WebTextInputInfo(); } |
174 | 150 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // Applies the range on the focused frame so that the text will later be rep
laced. | 222 // Applies the range on the focused frame so that the text will later be rep
laced. |
247 virtual void applyReplacementRange(const WebRange&) {} | 223 virtual void applyReplacementRange(const WebRange&) {} |
248 | 224 |
249 protected: | 225 protected: |
250 ~WebWidget() { } | 226 ~WebWidget() { } |
251 }; | 227 }; |
252 | 228 |
253 } // namespace blink | 229 } // namespace blink |
254 | 230 |
255 #endif | 231 #endif |
OLD | NEW |