| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebPlugin_h | 31 #ifndef WebPlugin_h |
| 32 #define WebPlugin_h | 32 #define WebPlugin_h |
| 33 | 33 |
| 34 #include "../platform/WebCanvas.h" | 34 #include "../platform/WebCanvas.h" |
| 35 #include "../platform/WebString.h" | 35 #include "../platform/WebString.h" |
| 36 #include "../platform/WebURL.h" | 36 #include "../platform/WebURL.h" |
| 37 #include "WebDragOperation.h" | 37 #include "WebDragOperation.h" |
| 38 #include "WebDragStatus.h" | 38 #include "WebDragStatus.h" |
| 39 #include "WebWidget.h" |
| 39 | 40 |
| 40 struct NPObject; | 41 struct NPObject; |
| 41 struct _NPP; | 42 struct _NPP; |
| 42 | 43 |
| 43 namespace blink { | 44 namespace blink { |
| 44 | 45 |
| 45 class WebDataSource; | 46 class WebDataSource; |
| 46 class WebDragData; | 47 class WebDragData; |
| 47 class WebFrame; | 48 class WebFrame; |
| 48 class WebInputEvent; | 49 class WebInputEvent; |
| 49 class WebPluginContainer; | 50 class WebPluginContainer; |
| 50 class WebURLResponse; | 51 class WebURLResponse; |
| 52 struct WebCompositionUnderline; |
| 51 struct WebCursorInfo; | 53 struct WebCursorInfo; |
| 52 struct WebPluginParams; | 54 struct WebPluginParams; |
| 53 struct WebPrintParams; | 55 struct WebPrintParams; |
| 54 struct WebPoint; | 56 struct WebPoint; |
| 55 struct WebRect; | 57 struct WebRect; |
| 58 struct WebTextInputInfo; |
| 56 struct WebURLError; | 59 struct WebURLError; |
| 57 template <typename T> class WebVector; | 60 template <typename T> class WebVector; |
| 58 | 61 |
| 59 class WebPlugin { | 62 class WebPlugin { |
| 60 public: | 63 public: |
| 61 virtual bool initialize(WebPluginContainer*) = 0; | 64 virtual bool initialize(WebPluginContainer*) = 0; |
| 62 virtual void destroy() = 0; | 65 virtual void destroy() = 0; |
| 63 | 66 |
| 64 virtual WebPluginContainer* container() const { return 0; } | 67 virtual WebPluginContainer* container() const { return 0; } |
| 65 | 68 |
| 66 virtual NPObject* scriptableObject() = 0; | 69 virtual NPObject* scriptableObject() = 0; |
| 67 virtual struct _NPP* pluginNPP() { return 0; } | 70 virtual struct _NPP* pluginNPP() { return 0; } |
| 68 | 71 |
| 69 // Returns true if the form submission value is successfully obtained | 72 // Returns true if the form submission value is successfully obtained |
| 70 // from the plugin. The value would be associated with the name attribute | 73 // from the plugin. The value would be associated with the name attribute |
| 71 // of the corresponding object element. | 74 // of the corresponding object element. |
| 72 virtual bool getFormValue(WebString&) { return false; } | 75 virtual bool getFormValue(WebString&) { return false; } |
| 73 virtual bool supportsKeyboardFocus() const { return false; } | 76 virtual bool supportsKeyboardFocus() const { return false; } |
| 74 virtual bool supportsEditCommands() const { return false; } | 77 virtual bool supportsEditCommands() const { return false; } |
| 78 // Returns true if this plugin supports input method, which implements |
| 79 // setComposition() and confirmComposition() below. |
| 80 virtual bool supportsInputMethod() const { return false; } |
| 75 | 81 |
| 76 virtual bool canProcessDrag() const { return false; } | 82 virtual bool canProcessDrag() const { return false; } |
| 77 | 83 |
| 78 virtual void paint(WebCanvas*, const WebRect&) = 0; | 84 virtual void paint(WebCanvas*, const WebRect&) = 0; |
| 79 | 85 |
| 80 // Coordinates are relative to the containing window. | 86 // Coordinates are relative to the containing window. |
| 81 virtual void updateGeometry( | 87 virtual void updateGeometry( |
| 82 const WebRect& frameRect, const WebRect& clipRect, | 88 const WebRect& frameRect, const WebRect& clipRect, |
| 83 const WebVector<WebRect>& cutOutsRects, bool isVisible) = 0; | 89 const WebVector<WebRect>& cutOutsRects, bool isVisible) = 0; |
| 84 | 90 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // Ends the print operation. | 124 // Ends the print operation. |
| 119 virtual void printEnd() { } | 125 virtual void printEnd() { } |
| 120 | 126 |
| 121 virtual bool hasSelection() const { return false; } | 127 virtual bool hasSelection() const { return false; } |
| 122 virtual WebString selectionAsText() const { return WebString(); } | 128 virtual WebString selectionAsText() const { return WebString(); } |
| 123 virtual WebString selectionAsMarkup() const { return WebString(); } | 129 virtual WebString selectionAsMarkup() const { return WebString(); } |
| 124 | 130 |
| 125 virtual bool executeEditCommand(const WebString& name) { return false; } | 131 virtual bool executeEditCommand(const WebString& name) { return false; } |
| 126 virtual bool executeEditCommand(const WebString& name, const WebString& valu
e) { return false; } | 132 virtual bool executeEditCommand(const WebString& name, const WebString& valu
e) { return false; } |
| 127 | 133 |
| 134 // Sets composition text from input method, and returns true if the |
| 135 // composition is set successfully. |
| 136 virtual bool setComposition(const WebString& text, const WebVector<WebCompos
itionUnderline>& underlines, int selectionStart, int selectionEnd) { return fals
e; } |
| 137 // Confirms an ongoing composition and returns true if there is an ongoing |
| 138 // composition or the text is inserted. |
| 139 virtual bool confirmComposition(const WebString& text, WebWidget::ConfirmCom
positionBehavior selectionBehavior) { return false; } |
| 128 // If the given position is over a link, returns the absolute url. | 140 // If the given position is over a link, returns the absolute url. |
| 129 // Otherwise an empty url is returned. | 141 // Otherwise an empty url is returned. |
| 130 virtual WebURL linkAtPosition(const WebPoint& position) const { return WebUR
L(); } | 142 virtual WebURL linkAtPosition(const WebPoint& position) const { return WebUR
L(); } |
| 131 | 143 |
| 132 // Used for zooming of full page plugins. | 144 // Used for zooming of full page plugins. |
| 133 virtual void setZoomLevel(double level, bool textOnly) { } | 145 virtual void setZoomLevel(double level, bool textOnly) { } |
| 134 | 146 |
| 135 // Find interface. | 147 // Find interface. |
| 136 // Start a new search. The plugin should search for a little bit at a time
so that it | 148 // Start a new search. The plugin should search for a little bit at a time
so that it |
| 137 // doesn't block the thread in case of a large document. The results, along
with the | 149 // doesn't block the thread in case of a large document. The results, along
with the |
| (...skipping 17 matching lines...) Expand all Loading... |
| 155 | 167 |
| 156 virtual bool isPlaceholder() { return true; } | 168 virtual bool isPlaceholder() { return true; } |
| 157 | 169 |
| 158 protected: | 170 protected: |
| 159 ~WebPlugin() { } | 171 ~WebPlugin() { } |
| 160 }; | 172 }; |
| 161 | 173 |
| 162 } // namespace blink | 174 } // namespace blink |
| 163 | 175 |
| 164 #endif | 176 #endif |
| OLD | NEW |