| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 const WebString& text, | 147 const WebString& text, |
| 148 const WebVector<WebCompositionUnderline>& underlines, | 148 const WebVector<WebCompositionUnderline>& underlines, |
| 149 int selectionStart, | 149 int selectionStart, |
| 150 int selectionEnd) { return false; } | 150 int selectionEnd) { return false; } |
| 151 | 151 |
| 152 enum ConfirmCompositionBehavior { | 152 enum ConfirmCompositionBehavior { |
| 153 DoNotKeepSelection, | 153 DoNotKeepSelection, |
| 154 KeepSelection, | 154 KeepSelection, |
| 155 }; | 155 }; |
| 156 | 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 |
| 157 // Called to inform the WebWidget to confirm an ongoing composition. | 162 // Called to inform the WebWidget to confirm an ongoing composition. |
| 158 // This method is same as confirmComposition(WebString()); | 163 virtual bool finishComposingText(ConfirmCompositionBehavior selectionBehavio
r) { return false; } |
| 159 // Returns true if there is an ongoing composition. | |
| 160 virtual bool confirmComposition() { return false; } // Deprecated | |
| 161 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior
) { return false; } | |
| 162 | |
| 163 // Called to inform the WebWidget to confirm an ongoing composition with a | |
| 164 // new composition text. If the text is empty then the current composition | |
| 165 // text is confirmed. If there is no ongoing composition, then deletes the | |
| 166 // current selection and inserts the text. This method has no effect if | |
| 167 // there is no ongoing composition and the text is empty. | |
| 168 // Returns true if there is an ongoing composition or the text is inserted. | |
| 169 virtual bool confirmComposition(const WebString& text) { return false; } | |
| 170 | 164 |
| 171 // Fetches the character range of the current composition, also called the | 165 // Fetches the character range of the current composition, also called the |
| 172 // "marked range." | 166 // "marked range." |
| 173 virtual WebRange compositionRange() { return WebRange(); } | 167 virtual WebRange compositionRange() { return WebRange(); } |
| 174 | 168 |
| 175 // Returns information about the current text input of this WebWidget. | 169 // Returns information about the current text input of this WebWidget. |
| 176 // Note that this query can be expensive for long fields, as it returns the | 170 // Note that this query can be expensive for long fields, as it returns the |
| 177 // plain-text representation of the current editable element. Consider using | 171 // plain-text representation of the current editable element. Consider using |
| 178 // the lighter-weight textInputType() when appropriate. | 172 // the lighter-weight textInputType() when appropriate. |
| 179 virtual WebTextInputInfo textInputInfo() { return WebTextInputInfo(); } | 173 virtual WebTextInputInfo textInputInfo() { return WebTextInputInfo(); } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // Applies the range on the focused frame so that the text will later be rep
laced. | 246 // Applies the range on the focused frame so that the text will later be rep
laced. |
| 253 virtual void applyReplacementRange(const WebRange&) {} | 247 virtual void applyReplacementRange(const WebRange&) {} |
| 254 | 248 |
| 255 protected: | 249 protected: |
| 256 ~WebWidget() { } | 250 ~WebWidget() { } |
| 257 }; | 251 }; |
| 258 | 252 |
| 259 } // namespace blink | 253 } // namespace blink |
| 260 | 254 |
| 261 #endif | 255 #endif |
| OLD | NEW |