diff options
Diffstat (limited to 'WebKit/chromium/public/WebWidget.h')
-rw-r--r-- | WebKit/chromium/public/WebWidget.h | 64 |
1 files changed, 47 insertions, 17 deletions
diff --git a/WebKit/chromium/public/WebWidget.h b/WebKit/chromium/public/WebWidget.h index 9dfeefc..d010270 100644 --- a/WebKit/chromium/public/WebWidget.h +++ b/WebKit/chromium/public/WebWidget.h @@ -33,7 +33,8 @@ #include "WebCanvas.h" #include "WebCommon.h" -#include "WebCompositionCommand.h" +#include "WebCompositionUnderline.h" +#include "WebTextInputType.h" #include "WebTextDirection.h" namespace WebKit { @@ -42,6 +43,7 @@ class WebInputEvent; class WebString; struct WebRect; struct WebSize; +template <typename T> class WebVector; class WebWidget { public: @@ -58,13 +60,26 @@ public: // and it may result in calls to WebWidgetClient::didInvalidateRect. virtual void layout() = 0; - // Called to paint the specified region of the WebWidget onto the given - // canvas. You MUST call Layout before calling this method. It is - // okay to call paint multiple times once layout has been called, - // assuming no other changes are made to the WebWidget (e.g., once - // events are processed, it should be assumed that another call to - // layout is warranted before painting again). - virtual void paint(WebCanvas*, const WebRect&) = 0; + // Called to paint the rectangular region within the WebWidget + // onto the specified canvas at (viewPort.x,viewPort.y). You MUST call + // Layout before calling this method. It is okay to call paint + // multiple times once layout has been called, assuming no other + // changes are made to the WebWidget (e.g., once events are + // processed, it should be assumed that another call to layout is + // warranted before painting again). + virtual void paint(WebCanvas*, const WebRect& viewPort) = 0; + + // Triggers compositing of the current layers onto the screen. + // The finish argument controls whether the compositor will wait for the + // GPU to finish rendering before returning. You MUST call Layout + // before calling this method, for the same reasons described in + // the paint method above. + virtual void composite(bool finish) = 0; + + // Called to inform the WebWidget of a change in theme. + // Implementors that cache rendered copies of widgets need to re-render + // on receiving this message + virtual void themeChanged() = 0; // Called to inform the WebWidget of an input event. Returns true if // the event has been processed, false otherwise. @@ -76,20 +91,35 @@ public: // Called to inform the WebWidget that it has gained or lost keyboard focus. virtual void setFocus(bool) = 0; - // Called to inform the WebWidget of a composition event. - virtual bool handleCompositionEvent(WebCompositionCommand command, - int cursorPosition, - int targetStart, - int targetEnd, - const WebString& text) = 0; + // Called to inform the WebWidget of a new composition text. + // If selectionStart and selectionEnd has the same value, then it indicates + // the input caret position. If the text is empty, then the existing + // composition text will be cancelled. + // Returns true if the composition text was set successfully. + virtual bool setComposition( + const WebString& text, + const WebVector<WebCompositionUnderline>& underlines, + int selectionStart, + int selectionEnd) = 0; - // Retrieve the status of this WebWidget required by IME APIs. Upon - // success enabled and caretBounds are set. - virtual bool queryCompositionStatus(bool* enabled, WebRect* caretBounds) = 0; + // Called to inform the WebWidget to confirm an ongoing composition. + // Returns true if there is an ongoing composition. + virtual bool confirmComposition() = 0; + + // Returns the current text input type of this WebWidget. + virtual WebTextInputType textInputType() = 0; + + // Returns the current caret bounds of this WebWidget. The selection bounds + // will be returned if a selection range is available. + virtual WebRect caretOrSelectionBounds() = 0; // Changes the text direction of the selected input node. virtual void setTextDirection(WebTextDirection) = 0; + // Returns true if the WebWidget uses GPU accelerated compositing + // to render its contents. + virtual bool isAcceleratedCompositingActive() const = 0; + protected: ~WebWidget() { } }; |