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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 #include "WebCanvas.h" | 34 #include "WebCanvas.h" |
35 #include "WebCommon.h" | 35 #include "WebCommon.h" |
36 #include "WebCompositionUnderline.h" | 36 #include "WebCompositionUnderline.h" |
37 #include "WebTextInputType.h" | 37 #include "WebTextInputType.h" |
38 #include "WebTextDirection.h" | 38 #include "WebTextDirection.h" |
39 | 39 |
40 namespace WebKit { | 40 namespace WebKit { |
41 | 41 |
42 class WebInputEvent; | 42 class WebInputEvent; |
| 43 class WebRange; |
43 class WebString; | 44 class WebString; |
44 struct WebRect; | 45 struct WebRect; |
45 struct WebSize; | 46 struct WebSize; |
46 template <typename T> class WebVector; | 47 template <typename T> class WebVector; |
47 | 48 |
48 class WebWidget { | 49 class WebWidget { |
49 public: | 50 public: |
50 // This method closes and deletes the WebWidget. | 51 // This method closes and deletes the WebWidget. |
51 virtual void close() = 0; | 52 virtual void close() = 0; |
52 | 53 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 virtual bool confirmComposition() = 0; | 113 virtual bool confirmComposition() = 0; |
113 | 114 |
114 // Called to inform the WebWidget to confirm an ongoing composition with a | 115 // Called to inform the WebWidget to confirm an ongoing composition with a |
115 // new composition text. If the text is empty then the current composition | 116 // new composition text. If the text is empty then the current composition |
116 // text is confirmed. If there is no ongoing composition, then deletes the | 117 // text is confirmed. If there is no ongoing composition, then deletes the |
117 // current selection and inserts the text. This method has no effect if | 118 // current selection and inserts the text. This method has no effect if |
118 // there is no ongoing composition and the text is empty. | 119 // there is no ongoing composition and the text is empty. |
119 // Returns true if there is an ongoing composition or the text is inserted. | 120 // Returns true if there is an ongoing composition or the text is inserted. |
120 virtual bool confirmComposition(const WebString& text) = 0; | 121 virtual bool confirmComposition(const WebString& text) = 0; |
121 | 122 |
| 123 // Returns the character range of the current composition. This is also |
| 124 // referred to as the marked range. |
| 125 virtual bool compositionRange(unsigned* location, unsigned* length) = 0; |
| 126 |
122 // Returns the current text input type of this WebWidget. | 127 // Returns the current text input type of this WebWidget. |
123 virtual WebTextInputType textInputType() = 0; | 128 virtual WebTextInputType textInputType() = 0; |
124 | 129 |
125 // Returns the current caret bounds of this WebWidget. The selection bounds | 130 // Returns the current caret bounds of this WebWidget. The selection bounds |
126 // will be returned if a selection range is available. | 131 // will be returned if a selection range is available. |
127 virtual WebRect caretOrSelectionBounds() = 0; | 132 virtual WebRect caretOrSelectionBounds() = 0; |
128 | 133 |
| 134 // Returns the current selection range of this WebWidget. If there is no |
| 135 // selection, it will return a 0-length range with the location at the |
| 136 // caret. |
| 137 virtual bool caretOrSelectionRange(unsigned* location, unsigned* length) = 0
; |
| 138 |
129 // Changes the text direction of the selected input node. | 139 // Changes the text direction of the selected input node. |
130 virtual void setTextDirection(WebTextDirection) = 0; | 140 virtual void setTextDirection(WebTextDirection) = 0; |
131 | 141 |
132 // Returns true if the WebWidget uses GPU accelerated compositing | 142 // Returns true if the WebWidget uses GPU accelerated compositing |
133 // to render its contents. | 143 // to render its contents. |
134 virtual bool isAcceleratedCompositingActive() const = 0; | 144 virtual bool isAcceleratedCompositingActive() const = 0; |
135 | 145 |
136 protected: | 146 protected: |
137 ~WebWidget() { } | 147 ~WebWidget() { } |
138 }; | 148 }; |
139 | 149 |
140 } // namespace WebKit | 150 } // namespace WebKit |
141 | 151 |
142 #endif | 152 #endif |
OLD | NEW |