1 module webkit2webextension.DOMMouseEvent;
2 
3 private import glib.Str;
4 private import gobject.ObjectG;
5 private import webkit2webextension.DOMDOMWindow;
6 private import webkit2webextension.DOMEventTargetIF;
7 private import webkit2webextension.DOMNode;
8 private import webkit2webextension.DOMUIEvent;
9 private import webkit2webextension.c.functions;
10 public  import webkit2webextension.c.types;
11 
12 
13 /** */
14 public class DOMMouseEvent : DOMUIEvent
15 {
16 	/** the main Gtk struct */
17 	protected WebKitDOMMouseEvent* webKitDOMMouseEvent;
18 
19 	/** Get the main Gtk struct */
20 	public WebKitDOMMouseEvent* getDOMMouseEventStruct(bool transferOwnership = false)
21 	{
22 		if (transferOwnership)
23 			ownedRef = false;
24 		return webKitDOMMouseEvent;
25 	}
26 
27 	/** the main Gtk struct as a void* */
28 	protected override void* getStruct()
29 	{
30 		return cast(void*)webKitDOMMouseEvent;
31 	}
32 
33 	/**
34 	 * Sets our main struct and passes it to the parent class.
35 	 */
36 	public this (WebKitDOMMouseEvent* webKitDOMMouseEvent, bool ownedRef = false)
37 	{
38 		this.webKitDOMMouseEvent = webKitDOMMouseEvent;
39 		super(cast(WebKitDOMUIEvent*)webKitDOMMouseEvent, ownedRef);
40 	}
41 
42 
43 	/** */
44 	public static GType getType()
45 	{
46 		return webkit_dom_mouse_event_get_type();
47 	}
48 
49 	/**
50 	 *
51 	 *
52 	 * Deprecated: Use JavaScriptCore API instead
53 	 *
54 	 * Returns: A #gboolean
55 	 */
56 	public bool getAltKey()
57 	{
58 		return webkit_dom_mouse_event_get_alt_key(webKitDOMMouseEvent) != 0;
59 	}
60 
61 	/**
62 	 *
63 	 *
64 	 * Deprecated: Use JavaScriptCore API instead
65 	 *
66 	 * Returns: A #gushort
67 	 */
68 	public ushort getButton()
69 	{
70 		return webkit_dom_mouse_event_get_button(webKitDOMMouseEvent);
71 	}
72 
73 	/**
74 	 *
75 	 *
76 	 * Deprecated: Use JavaScriptCore API instead
77 	 *
78 	 * Returns: A #glong
79 	 */
80 	public glong getClientX()
81 	{
82 		return webkit_dom_mouse_event_get_client_x(webKitDOMMouseEvent);
83 	}
84 
85 	/**
86 	 *
87 	 *
88 	 * Deprecated: Use JavaScriptCore API instead
89 	 *
90 	 * Returns: A #glong
91 	 */
92 	public glong getClientY()
93 	{
94 		return webkit_dom_mouse_event_get_client_y(webKitDOMMouseEvent);
95 	}
96 
97 	/**
98 	 *
99 	 *
100 	 * Deprecated: Use JavaScriptCore API instead
101 	 *
102 	 * Returns: A #gboolean
103 	 */
104 	public bool getCtrlKey()
105 	{
106 		return webkit_dom_mouse_event_get_ctrl_key(webKitDOMMouseEvent) != 0;
107 	}
108 
109 	/**
110 	 *
111 	 *
112 	 * Deprecated: Use JavaScriptCore API instead
113 	 *
114 	 * Returns: A #WebKitDOMNode
115 	 */
116 	public DOMNode getFromElement()
117 	{
118 		auto __p = webkit_dom_mouse_event_get_from_element(webKitDOMMouseEvent);
119 
120 		if(__p is null)
121 		{
122 			return null;
123 		}
124 
125 		return ObjectG.getDObject!(DOMNode)(cast(WebKitDOMNode*) __p);
126 	}
127 
128 	/**
129 	 *
130 	 *
131 	 * Deprecated: Use JavaScriptCore API instead
132 	 *
133 	 * Returns: A #gboolean
134 	 */
135 	public bool getMetaKey()
136 	{
137 		return webkit_dom_mouse_event_get_meta_key(webKitDOMMouseEvent) != 0;
138 	}
139 
140 	/**
141 	 *
142 	 *
143 	 * Deprecated: Use JavaScriptCore API instead
144 	 *
145 	 * Returns: A #glong
146 	 */
147 	public glong getOffsetX()
148 	{
149 		return webkit_dom_mouse_event_get_offset_x(webKitDOMMouseEvent);
150 	}
151 
152 	/**
153 	 *
154 	 *
155 	 * Deprecated: Use JavaScriptCore API instead
156 	 *
157 	 * Returns: A #glong
158 	 */
159 	public glong getOffsetY()
160 	{
161 		return webkit_dom_mouse_event_get_offset_y(webKitDOMMouseEvent);
162 	}
163 
164 	/**
165 	 *
166 	 *
167 	 * Deprecated: Use JavaScriptCore API instead
168 	 *
169 	 * Returns: A #WebKitDOMEventTarget
170 	 */
171 	public DOMEventTargetIF getRelatedTarget()
172 	{
173 		auto __p = webkit_dom_mouse_event_get_related_target(webKitDOMMouseEvent);
174 
175 		if(__p is null)
176 		{
177 			return null;
178 		}
179 
180 		return ObjectG.getDObject!(DOMEventTargetIF)(cast(WebKitDOMEventTarget*) __p, true);
181 	}
182 
183 	/**
184 	 *
185 	 *
186 	 * Deprecated: Use JavaScriptCore API instead
187 	 *
188 	 * Returns: A #glong
189 	 */
190 	public glong getScreenX()
191 	{
192 		return webkit_dom_mouse_event_get_screen_x(webKitDOMMouseEvent);
193 	}
194 
195 	/**
196 	 *
197 	 *
198 	 * Deprecated: Use JavaScriptCore API instead
199 	 *
200 	 * Returns: A #glong
201 	 */
202 	public glong getScreenY()
203 	{
204 		return webkit_dom_mouse_event_get_screen_y(webKitDOMMouseEvent);
205 	}
206 
207 	/**
208 	 *
209 	 *
210 	 * Deprecated: Use JavaScriptCore API instead
211 	 *
212 	 * Returns: A #gboolean
213 	 */
214 	public bool getShiftKey()
215 	{
216 		return webkit_dom_mouse_event_get_shift_key(webKitDOMMouseEvent) != 0;
217 	}
218 
219 	/**
220 	 *
221 	 *
222 	 * Deprecated: Use JavaScriptCore API instead
223 	 *
224 	 * Returns: A #WebKitDOMNode
225 	 */
226 	public DOMNode getToElement()
227 	{
228 		auto __p = webkit_dom_mouse_event_get_to_element(webKitDOMMouseEvent);
229 
230 		if(__p is null)
231 		{
232 			return null;
233 		}
234 
235 		return ObjectG.getDObject!(DOMNode)(cast(WebKitDOMNode*) __p);
236 	}
237 
238 	/**
239 	 *
240 	 *
241 	 * Deprecated: Use JavaScriptCore API instead
242 	 *
243 	 * Returns: A #glong
244 	 */
245 	public glong getX()
246 	{
247 		return webkit_dom_mouse_event_get_x(webKitDOMMouseEvent);
248 	}
249 
250 	/**
251 	 *
252 	 *
253 	 * Deprecated: Use JavaScriptCore API instead
254 	 *
255 	 * Returns: A #glong
256 	 */
257 	public glong getY()
258 	{
259 		return webkit_dom_mouse_event_get_y(webKitDOMMouseEvent);
260 	}
261 
262 	/**
263 	 *
264 	 *
265 	 * Deprecated: Use JavaScriptCore API instead
266 	 *
267 	 * Params:
268 	 *     type = A #gchar
269 	 *     canBubble = A #gboolean
270 	 *     cancelable = A #gboolean
271 	 *     view = A #WebKitDOMDOMWindow
272 	 *     detail = A #glong
273 	 *     screenX = A #glong
274 	 *     screenY = A #glong
275 	 *     clientX = A #glong
276 	 *     clientY = A #glong
277 	 *     ctrlKey = A #gboolean
278 	 *     altKey = A #gboolean
279 	 *     shiftKey = A #gboolean
280 	 *     metaKey = A #gboolean
281 	 *     button = A #gushort
282 	 *     relatedTarget = A #WebKitDOMEventTarget
283 	 */
284 	public void initMouseEvent(string type, bool canBubble, bool cancelable, DOMDOMWindow view, glong detail, glong screenX, glong screenY, glong clientX, glong clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, ushort button, DOMEventTargetIF relatedTarget)
285 	{
286 		webkit_dom_mouse_event_init_mouse_event(webKitDOMMouseEvent, Str.toStringz(type), canBubble, cancelable, (view is null) ? null : view.getDOMDOMWindowStruct(), detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, (relatedTarget is null) ? null : relatedTarget.getDOMEventTargetStruct());
287 	}
288 }