tizen beta release
[framework/web/webkit-efl.git] / debian / libwebkit-engine-dev / usr / include / ewebkit-0 / slp_npapi.h
1 /************************************************************************
2  *
3  * Copyright (c) 2011 by Samsung Electronics Ltd.
4  *
5  * All Rights Reserved.
6  *
7  * This document may not, in whole or in part, be copied, photocopied,
8  * reproduced, translated, or reduced to any electronic medium or machine
9  * readable form without prior written consent from Samsung Electronics.
10  *
11  ***********************************************************************/
12
13 /**
14  * @file        slp_npapi.h
15  *
16  * @brief   npapi extension: replacement of XEvent, NPNVariable extensions
17  *
18  * @author      Mariusz Grzegorczyk(mariusz.g@samsung.com)
19  * @date        Apr 29, 2011
20  */
21
22 #ifndef slp_npapi_h
23 #define slp_npapi_h
24
25 /************************************************************************
26  * Includes
27  ***********************************************************************/
28 #include "npapi.h"
29
30 ///////////////////////////////////////////////////////////////////////////////
31 // DEFINITION OF VALUES PASSED THROUGH NPP_HandleEvent
32
33 typedef enum {
34     SNPKeyPressEvent = 0,
35     SNPKeyReleaseEvent,
36     SNPMousePressEvent,
37     SNPMouseMoveEvent,
38     SNPMouseReleaseEvent,
39     SNPMultiDownEvent,
40     SNPMultiMoveEvent,
41     SNPMultiUpEvent,
42     SNPPaintEvent, // Send when weak zoom is done in webkit
43     SNPWeakZoomEvent,
44     SNPReduceFPSEvent, // Plugin should reduce its frame rate
45     SNPRevertFPSEvent,
46     SNPPausePluginEvent, // Plugin should be paused
47     SNPResumePluginEvent,
48     SNPDocumentLoadedEvent, // Notifies plugin that current document loading is finished
49     SNPPluginInactiveEvent, // Trigerred when plugin loses its focus. It can be used to f.e. hide keyboard
50     SNPLowMemoryEvent // Notification about low memory, plugin can reduce memory consumption on that event
51 } SNPEventType;
52
53 typedef struct {
54     int x;
55     int y;
56 } SNPPoint;
57
58 typedef struct {
59     int w;
60     int h;
61 } SNPSize;
62
63 typedef struct {
64     int x;
65     int y;
66     int w;
67     int h;
68 } SNPRect;
69
70 typedef struct SNPPaint SNPPaint;
71
72 typedef struct {
73     SNPEventType eventType;
74     union {
75         struct {
76             // depends on needs from plugin teams
77         } key;
78         struct {
79             unsigned int button;
80             SNPPoint position;
81             unsigned long time;
82         } mouse;
83         struct {
84             SNPRect rect;
85             SNPPaint *context;
86         } paint;
87         struct {
88             SNPPoint position;
89             unsigned id;
90         } multiMouse;
91         struct {
92             SNPPoint position;
93             float zoomFactor;
94         } zoom;
95     };
96 } SNPEvent;
97
98 ///////////////////////////////////////////////////////////////////////////////
99 // NPN_GetValue
100
101 /**
102  * queries for a specific SNPInterface.
103  * NPN_GetValue(NPP instance, interface_enum, SNPInterface*)
104  */
105 #define NPNCanvasInterface  ((NPNVariable)1000)
106 #define NPNWindowInterface  ((NPNVariable)1001)
107 #define NPNPaintInterface   ((NPNVariable)1002)
108
109 /**
110  * queries for plugin size and storage: canvas, clipper, window, elm-webview
111  */
112 #define NPNPluginStorage    ((NPNVariable)1100)
113 #define NPNPluginSize       ((NPNVariable)1101)
114
115 #endif /* slp_npapi_h */