#ifndef WebPlugin_h
#define WebPlugin_h
#include "../platform/WebCanvas.h"
#include "../platform/WebString.h"
#include "../platform/WebURL.h"
#include "WebDragOperation.h"
#include "WebDragStatus.h"
#include "WebWidget.h"
struct NPObject;
struct _NPP;
namespace blink {
class WebDataSource;
class WebDragData;
class WebInputEvent;
class WebPluginContainer;
class WebURLResponse;
struct WebCompositionUnderline;
struct WebCursorInfo;
struct WebPluginParams;
struct WebPrintParams;
struct WebPoint;
struct WebRect;
struct WebTextInputInfo;
struct WebURLError;
template <typename T> class WebVector;
class WebPlugin {
public:
virtual bool initialize(WebPluginContainer*) = 0;
virtual void destroy() = 0;
virtual WebPluginContainer* container() const { return 0; }
virtual void containerDidDetachFromParent() { }
virtual NPObject* scriptableObject() = 0;
virtual struct _NPP* pluginNPP() { return 0; }
virtual bool getFormValue(WebString&) { return false; }
virtual bool supportsKeyboardFocus() const { return false; }
virtual bool supportsEditCommands() const { return false; }
virtual bool supportsInputMethod() const { return false; }
virtual bool canProcessDrag() const { return false; }
virtual void paint(WebCanvas*, const WebRect&) = 0;
virtual void updateGeometry(
const WebRect& frameRect, const WebRect& clipRect,
const WebVector<WebRect>& cutOutsRects, bool isVisible) = 0;
virtual void updateFocus(bool) = 0;
virtual void updateVisibility(bool) = 0;
virtual bool acceptsInputEvents() = 0;
virtual bool handleInputEvent(const WebInputEvent&, WebCursorInfo&) = 0;
virtual bool handleDragStatusUpdate(WebDragStatus, const WebDragData&, WebDragOperationsMask, const WebPoint& position, const WebPoint& screenPosition) { return false; }
virtual void didReceiveResponse(const WebURLResponse&) = 0;
virtual void didReceiveData(const char* data, int dataLength) = 0;
virtual void didFinishLoading() = 0;
virtual void didFailLoading(const WebURLError&) = 0;
virtual void didFinishLoadingFrameRequest(
const WebURL&, void* notifyData) = 0;
virtual void didFailLoadingFrameRequest(
const WebURL&, void* notifyData, const WebURLError&) = 0;
virtual bool supportsPaginatedPrint() { return false; }
virtual bool isPrintScalingDisabled() { return false; }
virtual int printBegin(const WebPrintParams& printParams) { return 0; }
virtual bool printPage(int pageNumber, WebCanvas* canvas) { return false; }
virtual void printEnd() { }
virtual bool hasSelection() const { return false; }
virtual WebString selectionAsText() const { return WebString(); }
virtual WebString selectionAsMarkup() const { return WebString(); }
virtual bool executeEditCommand(const WebString& name) { return false; }
virtual bool executeEditCommand(const WebString& name, const WebString& value) { return false; }
virtual bool setComposition(const WebString& text, const WebVector<WebCompositionUnderline>& underlines, int selectionStart, int selectionEnd) { return false; }
virtual bool confirmComposition(const WebString& text, WebWidget::ConfirmCompositionBehavior selectionBehavior) { return false; }
virtual void extendSelectionAndDelete(int before, int after) { }
virtual WebURL linkAtPosition(const WebPoint& position) const { return WebURL(); }
virtual void setZoomLevel(double level, bool textOnly) { }
virtual bool startFind(const WebString& searchText, bool caseSensitive, int identifier) { return false; }
virtual void selectFindResult(bool forward) { }
virtual void stopFind() { }
enum RotationType {
RotationType90Clockwise,
RotationType90Counterclockwise
};
virtual bool canRotateView() { return false; }
virtual void rotateView(RotationType type) { }
virtual bool isPlaceholder() { return true; }
virtual bool shouldPersist() const { return false; }
protected:
~WebPlugin() { }
};
}
#endif