1 | /* |
2 | * Copyright (C) 2010 Igalia S.L. |
3 | * |
4 | * This library is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Lesser General Public |
6 | * License as published by the Free Software Foundation; either |
7 | * version 2 of the License, or (at your option) any later version. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Lesser General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Lesser General Public |
15 | * License along with this library; if not, write to the Free Software |
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
17 | */ |
18 | |
19 | #ifndef WebKitDOMEventTarget_h |
20 | #define WebKitDOMEventTarget_h |
21 | |
22 | #include <glib-object.h> |
23 | #include <webkitdom/webkitdomdefines.h> |
24 | |
25 | G_BEGIN_DECLS |
26 | |
27 | #define WEBKIT_DOM_TYPE_EVENT_TARGET (webkit_dom_event_target_get_type ()) |
28 | #define WEBKIT_DOM_EVENT_TARGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WEBKIT_DOM_TYPE_EVENT_TARGET, WebKitDOMEventTarget)) |
29 | #define WEBKIT_DOM_EVENT_TARGET_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), WEBKIT_DOM_TYPE_EVENT_TARGET, WebKitDOMEventTargetIface)) |
30 | #define WEBKIT_DOM_IS_EVENT_TARGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WEBKIT_DOM_TYPE_EVENT_TARGET)) |
31 | #define WEBKIT_DOM_EVENT_TARGET_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), WEBKIT_DOM_TYPE_EVENT_TARGET, WebKitDOMEventTargetIface)) |
32 | |
33 | struct _WebKitDOMEventTargetIface { |
34 | GTypeInterface gIface; |
35 | |
36 | /* virtual table */ |
37 | gboolean (* dispatch_event)(WebKitDOMEventTarget *target, |
38 | WebKitDOMEvent *event, |
39 | GError **error); |
40 | |
41 | gboolean (* add_event_listener)(WebKitDOMEventTarget *target, |
42 | const char *event_name, |
43 | GClosure *handler, |
44 | gboolean use_capture); |
45 | gboolean (* remove_event_listener)(WebKitDOMEventTarget *target, |
46 | const char *event_name, |
47 | GClosure *handler, |
48 | gboolean use_capture); |
49 | |
50 | void (*_webkitdom_reserved0) (void); |
51 | void (*_webkitdom_reserved1) (void); |
52 | void (*_webkitdom_reserved2) (void); |
53 | void (*_webkitdom_reserved3) (void); |
54 | }; |
55 | |
56 | |
57 | WEBKIT_DEPRECATED GType webkit_dom_event_target_get_type(void) G_GNUC_CONST; |
58 | |
59 | /** |
60 | * webkit_dom_event_target_dispatch_event: |
61 | * @target: A #WebKitDOMEventTarget |
62 | * @event: A #WebKitDOMEvent |
63 | * @error: return location for an error or %NULL |
64 | * |
65 | * Returns: a #gboolean |
66 | * |
67 | * Deprecated: 2.22: Use JavaScriptCore API instead |
68 | */ |
69 | WEBKIT_DEPRECATED gboolean webkit_dom_event_target_dispatch_event(WebKitDOMEventTarget *target, |
70 | WebKitDOMEvent *event, |
71 | GError **error); |
72 | |
73 | /** |
74 | * webkit_dom_event_target_add_event_listener: |
75 | * @target: A #WebKitDOMEventTarget |
76 | * @event_name: A #gchar |
77 | * @handler: (scope async): A #GCallback |
78 | * @use_capture: A #gboolean |
79 | * @user_data: A #gpointer |
80 | * |
81 | * Returns: a #gboolean |
82 | * |
83 | * Deprecated: 2.22: Use JavaScriptCore API instead |
84 | */ |
85 | WEBKIT_DEPRECATED gboolean webkit_dom_event_target_add_event_listener(WebKitDOMEventTarget *target, |
86 | const char *event_name, |
87 | GCallback handler, |
88 | gboolean use_capture, |
89 | gpointer user_data); |
90 | |
91 | /** |
92 | * webkit_dom_event_target_remove_event_listener: |
93 | * @target: A #WebKitDOMEventTarget |
94 | * @event_name: A #gchar |
95 | * @handler: (scope call): A #GCallback |
96 | * @use_capture: A #gboolean |
97 | * |
98 | * Returns: a #gboolean |
99 | * |
100 | * Deprecated: 2.22: Use JavaScriptCore API instead |
101 | */ |
102 | WEBKIT_DEPRECATED gboolean webkit_dom_event_target_remove_event_listener(WebKitDOMEventTarget *target, |
103 | const char *event_name, |
104 | GCallback handler, |
105 | gboolean use_capture); |
106 | |
107 | /** |
108 | * webkit_dom_event_target_add_event_listener_with_closure: (rename-to webkit_dom_event_target_add_event_listener) |
109 | * @target: A #WebKitDOMEventTarget |
110 | * @event_name: A #gchar |
111 | * @handler: A #GClosure |
112 | * @use_capture: A #gboolean |
113 | * |
114 | * Version of webkit_dom_event_target_add_event_listener() using a closure |
115 | * instead of a callbacks for easier binding in other languages. |
116 | * |
117 | * Returns: a #gboolean |
118 | * |
119 | * Deprecated: 2.22: Use JavaScriptCore API instead |
120 | */ |
121 | WEBKIT_DEPRECATED gboolean webkit_dom_event_target_add_event_listener_with_closure(WebKitDOMEventTarget *target, |
122 | const char *event_name, |
123 | GClosure *handler, |
124 | gboolean use_capture); |
125 | |
126 | /** |
127 | * webkit_dom_event_target_remove_event_listener_with_closure: (rename-to webkit_dom_event_target_remove_event_listener) |
128 | * @target: A #WebKitDOMEventTarget |
129 | * @event_name: A #gchar |
130 | * @handler: A #GClosure |
131 | * @use_capture: A #gboolean |
132 | * |
133 | * Version of webkit_dom_event_target_remove_event_listener() using a closure |
134 | * instead of a callbacks for easier binding in other languages. |
135 | * |
136 | * Returns: a #gboolean |
137 | * |
138 | * Deprecated: 2.22: Use JavaScriptCore API instead |
139 | */ |
140 | WEBKIT_DEPRECATED gboolean webkit_dom_event_target_remove_event_listener_with_closure(WebKitDOMEventTarget *target, |
141 | const char *event_name, |
142 | GClosure *handler, |
143 | gboolean use_capture); |
144 | |
145 | |
146 | G_END_DECLS |
147 | |
148 | #endif /* WebKitDOMEventTarget_h */ |
149 | |