1 module webkit2webextension.DOMDOMWindow;
2 
3 private import glib.Str;
4 private import gobject.ObjectG;
5 private import webkit2webextension.DOMCSSStyleDeclaration;
6 private import webkit2webextension.DOMDOMSelection;
7 private import webkit2webextension.DOMDocument;
8 private import webkit2webextension.DOMElement;
9 private import webkit2webextension.DOMEventTargetIF;
10 private import webkit2webextension.DOMEventTargetT;
11 private import webkit2webextension.DOMObject;
12 private import webkit2webextension.c.functions;
13 public  import webkit2webextension.c.types;
14 
15 
16 /** */
17 public class DOMDOMWindow : DOMObject, DOMEventTargetIF
18 {
19 	/** the main Gtk struct */
20 	protected WebKitDOMDOMWindow* webKitDOMDOMWindow;
21 
22 	/** Get the main Gtk struct */
23 	public WebKitDOMDOMWindow* getDOMDOMWindowStruct(bool transferOwnership = false)
24 	{
25 		if (transferOwnership)
26 			ownedRef = false;
27 		return webKitDOMDOMWindow;
28 	}
29 
30 	/** the main Gtk struct as a void* */
31 	protected override void* getStruct()
32 	{
33 		return cast(void*)webKitDOMDOMWindow;
34 	}
35 
36 	/**
37 	 * Sets our main struct and passes it to the parent class.
38 	 */
39 	public this (WebKitDOMDOMWindow* webKitDOMDOMWindow, bool ownedRef = false)
40 	{
41 		this.webKitDOMDOMWindow = webKitDOMDOMWindow;
42 		super(cast(WebKitDOMObject*)webKitDOMDOMWindow, ownedRef);
43 	}
44 
45 	// add the DOMEventTarget capabilities
46 	mixin DOMEventTargetT!(WebKitDOMDOMWindow);
47 
48 
49 	/** */
50 	public static GType getType()
51 	{
52 		return webkit_dom_dom_window_get_type();
53 	}
54 
55 	/**
56 	 *
57 	 *
58 	 * Deprecated: Use JavaScriptCore API instead
59 	 *
60 	 * Params:
61 	 *     message = A #gchar
62 	 *
63 	 * Since: 2.16
64 	 */
65 	public void alert(string message)
66 	{
67 		webkit_dom_dom_window_alert(webKitDOMDOMWindow, Str.toStringz(message));
68 	}
69 
70 	/**
71 	 *
72 	 *
73 	 * Deprecated: Use JavaScriptCore API instead
74 	 *
75 	 * Since: 2.16
76 	 */
77 	public void blur()
78 	{
79 		webkit_dom_dom_window_blur(webKitDOMDOMWindow);
80 	}
81 
82 	/**
83 	 *
84 	 *
85 	 * Deprecated: Use JavaScriptCore API instead
86 	 *
87 	 * Since: 2.16
88 	 */
89 	public void captureEvents()
90 	{
91 		webkit_dom_dom_window_capture_events(webKitDOMDOMWindow);
92 	}
93 
94 	/**
95 	 *
96 	 *
97 	 * Deprecated: Use JavaScriptCore API instead
98 	 *
99 	 * Since: 2.16
100 	 */
101 	public void close()
102 	{
103 		webkit_dom_dom_window_close(webKitDOMDOMWindow);
104 	}
105 
106 	/**
107 	 *
108 	 *
109 	 * Deprecated: Use JavaScriptCore API instead
110 	 *
111 	 * Params:
112 	 *     message = A #gchar
113 	 *
114 	 * Returns: A #gboolean
115 	 *
116 	 * Since: 2.16
117 	 */
118 	public bool confirm(string message)
119 	{
120 		return webkit_dom_dom_window_confirm(webKitDOMDOMWindow, Str.toStringz(message)) != 0;
121 	}
122 
123 	/**
124 	 *
125 	 *
126 	 * Deprecated: Use JavaScriptCore API instead
127 	 *
128 	 * Params:
129 	 *     string_ = A #gchar
130 	 *     caseSensitive = A #gboolean
131 	 *     backwards = A #gboolean
132 	 *     wrap = A #gboolean
133 	 *     wholeWord = A #gboolean
134 	 *     searchInFrames = A #gboolean
135 	 *     showDialog = A #gboolean
136 	 *
137 	 * Returns: A #gboolean
138 	 *
139 	 * Since: 2.16
140 	 */
141 	public bool find(string string_, bool caseSensitive, bool backwards, bool wrap, bool wholeWord, bool searchInFrames, bool showDialog)
142 	{
143 		return webkit_dom_dom_window_find(webKitDOMDOMWindow, Str.toStringz(string_), caseSensitive, backwards, wrap, wholeWord, searchInFrames, showDialog) != 0;
144 	}
145 
146 	/**
147 	 *
148 	 *
149 	 * Deprecated: Use JavaScriptCore API instead
150 	 *
151 	 * Since: 2.16
152 	 */
153 	public void focus()
154 	{
155 		webkit_dom_dom_window_focus(webKitDOMDOMWindow);
156 	}
157 
158 	/**
159 	 *
160 	 *
161 	 * Deprecated: Use JavaScriptCore API instead
162 	 *
163 	 * Returns: A #gboolean
164 	 *
165 	 * Since: 2.16
166 	 */
167 	public bool getClosed()
168 	{
169 		return webkit_dom_dom_window_get_closed(webKitDOMDOMWindow) != 0;
170 	}
171 
172 	/**
173 	 *
174 	 *
175 	 * Deprecated: Use JavaScriptCore API instead
176 	 *
177 	 * Params:
178 	 *     element = A #WebKitDOMElement
179 	 *     pseudoElement = A #gchar
180 	 *
181 	 * Returns: A #WebKitDOMCSSStyleDeclaration
182 	 *
183 	 * Since: 2.16
184 	 */
185 	public DOMCSSStyleDeclaration getComputedStyle(DOMElement element, string pseudoElement)
186 	{
187 		auto __p = webkit_dom_dom_window_get_computed_style(webKitDOMDOMWindow, (element is null) ? null : element.getDOMElementStruct(), Str.toStringz(pseudoElement));
188 
189 		if(__p is null)
190 		{
191 			return null;
192 		}
193 
194 		return ObjectG.getDObject!(DOMCSSStyleDeclaration)(cast(WebKitDOMCSSStyleDeclaration*) __p, true);
195 	}
196 
197 	/**
198 	 *
199 	 *
200 	 * Deprecated: Use JavaScriptCore API instead
201 	 *
202 	 * Returns: A #gchar
203 	 *
204 	 * Since: 2.16
205 	 */
206 	public string getDefaultStatus()
207 	{
208 		auto retStr = webkit_dom_dom_window_get_default_status(webKitDOMDOMWindow);
209 
210 		scope(exit) Str.freeString(retStr);
211 		return Str.toString(retStr);
212 	}
213 
214 	/**
215 	 *
216 	 *
217 	 * Deprecated: Use JavaScriptCore API instead
218 	 *
219 	 * Returns: A #gdouble
220 	 *
221 	 * Since: 2.16
222 	 */
223 	public double getDevicePixelRatio()
224 	{
225 		return webkit_dom_dom_window_get_device_pixel_ratio(webKitDOMDOMWindow);
226 	}
227 
228 	/**
229 	 *
230 	 *
231 	 * Deprecated: Use JavaScriptCore API instead
232 	 *
233 	 * Returns: A #WebKitDOMDocument
234 	 *
235 	 * Since: 2.16
236 	 */
237 	public DOMDocument getDocument()
238 	{
239 		auto __p = webkit_dom_dom_window_get_document(webKitDOMDOMWindow);
240 
241 		if(__p is null)
242 		{
243 			return null;
244 		}
245 
246 		return ObjectG.getDObject!(DOMDocument)(cast(WebKitDOMDocument*) __p);
247 	}
248 
249 	/**
250 	 *
251 	 *
252 	 * Deprecated: Use JavaScriptCore API instead
253 	 *
254 	 * Returns: A #WebKitDOMElement
255 	 *
256 	 * Since: 2.16
257 	 */
258 	public DOMElement getFrameElement()
259 	{
260 		auto __p = webkit_dom_dom_window_get_frame_element(webKitDOMDOMWindow);
261 
262 		if(__p is null)
263 		{
264 			return null;
265 		}
266 
267 		return ObjectG.getDObject!(DOMElement)(cast(WebKitDOMElement*) __p);
268 	}
269 
270 	/**
271 	 *
272 	 *
273 	 * Deprecated: Use JavaScriptCore API instead
274 	 *
275 	 * Returns: A #WebKitDOMDOMWindow
276 	 *
277 	 * Since: 2.16
278 	 */
279 	public DOMDOMWindow getFrames()
280 	{
281 		auto __p = webkit_dom_dom_window_get_frames(webKitDOMDOMWindow);
282 
283 		if(__p is null)
284 		{
285 			return null;
286 		}
287 
288 		return ObjectG.getDObject!(DOMDOMWindow)(cast(WebKitDOMDOMWindow*) __p, true);
289 	}
290 
291 	/**
292 	 *
293 	 *
294 	 * Deprecated: Use JavaScriptCore API instead
295 	 *
296 	 * Returns: A #glong
297 	 *
298 	 * Since: 2.16
299 	 */
300 	public glong getInnerHeight()
301 	{
302 		return webkit_dom_dom_window_get_inner_height(webKitDOMDOMWindow);
303 	}
304 
305 	/**
306 	 *
307 	 *
308 	 * Deprecated: Use JavaScriptCore API instead
309 	 *
310 	 * Returns: A #glong
311 	 *
312 	 * Since: 2.16
313 	 */
314 	public glong getInnerWidth()
315 	{
316 		return webkit_dom_dom_window_get_inner_width(webKitDOMDOMWindow);
317 	}
318 
319 	/**
320 	 *
321 	 *
322 	 * Deprecated: Use JavaScriptCore API instead
323 	 *
324 	 * Returns: A #gulong
325 	 *
326 	 * Since: 2.16
327 	 */
328 	public gulong getLength()
329 	{
330 		return webkit_dom_dom_window_get_length(webKitDOMDOMWindow);
331 	}
332 
333 	/**
334 	 *
335 	 *
336 	 * Deprecated: Use JavaScriptCore API instead
337 	 *
338 	 * Returns: A #gchar
339 	 *
340 	 * Since: 2.16
341 	 */
342 	public string getName()
343 	{
344 		auto retStr = webkit_dom_dom_window_get_name(webKitDOMDOMWindow);
345 
346 		scope(exit) Str.freeString(retStr);
347 		return Str.toString(retStr);
348 	}
349 
350 	/**
351 	 *
352 	 *
353 	 * Deprecated: Use JavaScriptCore API instead
354 	 *
355 	 * Returns: A #gboolean
356 	 *
357 	 * Since: 2.16
358 	 */
359 	public bool getOffscreenBuffering()
360 	{
361 		return webkit_dom_dom_window_get_offscreen_buffering(webKitDOMDOMWindow) != 0;
362 	}
363 
364 	/**
365 	 *
366 	 *
367 	 * Deprecated: Use JavaScriptCore API instead
368 	 *
369 	 * Returns: A #WebKitDOMDOMWindow
370 	 *
371 	 * Since: 2.16
372 	 */
373 	public DOMDOMWindow getOpener()
374 	{
375 		auto __p = webkit_dom_dom_window_get_opener(webKitDOMDOMWindow);
376 
377 		if(__p is null)
378 		{
379 			return null;
380 		}
381 
382 		return ObjectG.getDObject!(DOMDOMWindow)(cast(WebKitDOMDOMWindow*) __p, true);
383 	}
384 
385 	/**
386 	 *
387 	 *
388 	 * Deprecated: Use JavaScriptCore API instead
389 	 *
390 	 * Returns: A #glong
391 	 *
392 	 * Since: 2.16
393 	 */
394 	public glong getOrientation()
395 	{
396 		return webkit_dom_dom_window_get_orientation(webKitDOMDOMWindow);
397 	}
398 
399 	/**
400 	 *
401 	 *
402 	 * Deprecated: Use JavaScriptCore API instead
403 	 *
404 	 * Returns: A #glong
405 	 *
406 	 * Since: 2.16
407 	 */
408 	public glong getOuterHeight()
409 	{
410 		return webkit_dom_dom_window_get_outer_height(webKitDOMDOMWindow);
411 	}
412 
413 	/**
414 	 *
415 	 *
416 	 * Deprecated: Use JavaScriptCore API instead
417 	 *
418 	 * Returns: A #glong
419 	 *
420 	 * Since: 2.16
421 	 */
422 	public glong getOuterWidth()
423 	{
424 		return webkit_dom_dom_window_get_outer_width(webKitDOMDOMWindow);
425 	}
426 
427 	/**
428 	 *
429 	 *
430 	 * Deprecated: Use JavaScriptCore API instead
431 	 *
432 	 * Returns: A #glong
433 	 *
434 	 * Since: 2.16
435 	 */
436 	public glong getPageXOffset()
437 	{
438 		return webkit_dom_dom_window_get_page_x_offset(webKitDOMDOMWindow);
439 	}
440 
441 	/**
442 	 *
443 	 *
444 	 * Deprecated: Use JavaScriptCore API instead
445 	 *
446 	 * Returns: A #glong
447 	 *
448 	 * Since: 2.16
449 	 */
450 	public glong getPageYOffset()
451 	{
452 		return webkit_dom_dom_window_get_page_y_offset(webKitDOMDOMWindow);
453 	}
454 
455 	/**
456 	 *
457 	 *
458 	 * Deprecated: Use JavaScriptCore API instead
459 	 *
460 	 * Returns: A #WebKitDOMDOMWindow
461 	 *
462 	 * Since: 2.16
463 	 */
464 	public DOMDOMWindow getParent()
465 	{
466 		auto __p = webkit_dom_dom_window_get_parent(webKitDOMDOMWindow);
467 
468 		if(__p is null)
469 		{
470 			return null;
471 		}
472 
473 		return ObjectG.getDObject!(DOMDOMWindow)(cast(WebKitDOMDOMWindow*) __p, true);
474 	}
475 
476 	/**
477 	 *
478 	 *
479 	 * Deprecated: Use JavaScriptCore API instead
480 	 *
481 	 * Returns: A #glong
482 	 *
483 	 * Since: 2.16
484 	 */
485 	public glong getScreenLeft()
486 	{
487 		return webkit_dom_dom_window_get_screen_left(webKitDOMDOMWindow);
488 	}
489 
490 	/**
491 	 *
492 	 *
493 	 * Deprecated: Use JavaScriptCore API instead
494 	 *
495 	 * Returns: A #glong
496 	 *
497 	 * Since: 2.16
498 	 */
499 	public glong getScreenTop()
500 	{
501 		return webkit_dom_dom_window_get_screen_top(webKitDOMDOMWindow);
502 	}
503 
504 	/**
505 	 *
506 	 *
507 	 * Deprecated: Use JavaScriptCore API instead
508 	 *
509 	 * Returns: A #glong
510 	 *
511 	 * Since: 2.16
512 	 */
513 	public glong getScreenX()
514 	{
515 		return webkit_dom_dom_window_get_screen_x(webKitDOMDOMWindow);
516 	}
517 
518 	/**
519 	 *
520 	 *
521 	 * Deprecated: Use JavaScriptCore API instead
522 	 *
523 	 * Returns: A #glong
524 	 *
525 	 * Since: 2.16
526 	 */
527 	public glong getScreenY()
528 	{
529 		return webkit_dom_dom_window_get_screen_y(webKitDOMDOMWindow);
530 	}
531 
532 	/**
533 	 *
534 	 *
535 	 * Deprecated: Use JavaScriptCore API instead
536 	 *
537 	 * Returns: A #glong
538 	 *
539 	 * Since: 2.16
540 	 */
541 	public glong getScrollX()
542 	{
543 		return webkit_dom_dom_window_get_scroll_x(webKitDOMDOMWindow);
544 	}
545 
546 	/**
547 	 *
548 	 *
549 	 * Deprecated: Use JavaScriptCore API instead
550 	 *
551 	 * Returns: A #glong
552 	 *
553 	 * Since: 2.16
554 	 */
555 	public glong getScrollY()
556 	{
557 		return webkit_dom_dom_window_get_scroll_y(webKitDOMDOMWindow);
558 	}
559 
560 	/**
561 	 *
562 	 *
563 	 * Deprecated: Use JavaScriptCore API instead
564 	 *
565 	 * Returns: A #WebKitDOMDOMSelection
566 	 *
567 	 * Since: 2.16
568 	 */
569 	public DOMDOMSelection getSelection()
570 	{
571 		auto __p = webkit_dom_dom_window_get_selection(webKitDOMDOMWindow);
572 
573 		if(__p is null)
574 		{
575 			return null;
576 		}
577 
578 		return ObjectG.getDObject!(DOMDOMSelection)(cast(WebKitDOMDOMSelection*) __p, true);
579 	}
580 
581 	/**
582 	 *
583 	 *
584 	 * Deprecated: Use JavaScriptCore API instead
585 	 *
586 	 * Returns: A #WebKitDOMDOMWindow
587 	 *
588 	 * Since: 2.16
589 	 */
590 	public DOMDOMWindow getSelf()
591 	{
592 		auto __p = webkit_dom_dom_window_get_self(webKitDOMDOMWindow);
593 
594 		if(__p is null)
595 		{
596 			return null;
597 		}
598 
599 		return ObjectG.getDObject!(DOMDOMWindow)(cast(WebKitDOMDOMWindow*) __p, true);
600 	}
601 
602 	/**
603 	 *
604 	 *
605 	 * Deprecated: Use JavaScriptCore API instead
606 	 *
607 	 * Returns: A #gchar
608 	 *
609 	 * Since: 2.16
610 	 */
611 	public string getStatus()
612 	{
613 		auto retStr = webkit_dom_dom_window_get_status(webKitDOMDOMWindow);
614 
615 		scope(exit) Str.freeString(retStr);
616 		return Str.toString(retStr);
617 	}
618 
619 	/**
620 	 *
621 	 *
622 	 * Deprecated: Use JavaScriptCore API instead
623 	 *
624 	 * Returns: A #WebKitDOMDOMWindow
625 	 *
626 	 * Since: 2.16
627 	 */
628 	public DOMDOMWindow getTop()
629 	{
630 		auto __p = webkit_dom_dom_window_get_top(webKitDOMDOMWindow);
631 
632 		if(__p is null)
633 		{
634 			return null;
635 		}
636 
637 		return ObjectG.getDObject!(DOMDOMWindow)(cast(WebKitDOMDOMWindow*) __p, true);
638 	}
639 
640 	/**
641 	 *
642 	 *
643 	 * Deprecated: Use JavaScriptCore API instead
644 	 *
645 	 * Returns: A #WebKitDOMDOMWindow
646 	 *
647 	 * Since: 2.16
648 	 */
649 	public DOMDOMWindow getWindow()
650 	{
651 		auto __p = webkit_dom_dom_window_get_window(webKitDOMDOMWindow);
652 
653 		if(__p is null)
654 		{
655 			return null;
656 		}
657 
658 		return ObjectG.getDObject!(DOMDOMWindow)(cast(WebKitDOMDOMWindow*) __p, true);
659 	}
660 
661 	/**
662 	 *
663 	 *
664 	 * Deprecated: Use JavaScriptCore API instead
665 	 *
666 	 * Params:
667 	 *     x = A #gfloat
668 	 *     y = A #gfloat
669 	 *
670 	 * Since: 2.16
671 	 */
672 	public void moveBy(float x, float y)
673 	{
674 		webkit_dom_dom_window_move_by(webKitDOMDOMWindow, x, y);
675 	}
676 
677 	/**
678 	 *
679 	 *
680 	 * Deprecated: Use JavaScriptCore API instead
681 	 *
682 	 * Params:
683 	 *     x = A #gfloat
684 	 *     y = A #gfloat
685 	 *
686 	 * Since: 2.16
687 	 */
688 	public void moveTo(float x, float y)
689 	{
690 		webkit_dom_dom_window_move_to(webKitDOMDOMWindow, x, y);
691 	}
692 
693 	/**
694 	 *
695 	 *
696 	 * Deprecated: Use JavaScriptCore API instead
697 	 *
698 	 * Since: 2.16
699 	 */
700 	public void print()
701 	{
702 		webkit_dom_dom_window_print(webKitDOMDOMWindow);
703 	}
704 
705 	/**
706 	 *
707 	 *
708 	 * Deprecated: Use JavaScriptCore API instead
709 	 *
710 	 * Params:
711 	 *     message = A #gchar
712 	 *     defaultValue = A #gchar
713 	 *
714 	 * Returns: A #gchar
715 	 *
716 	 * Since: 2.16
717 	 */
718 	public string prompt(string message, string defaultValue)
719 	{
720 		auto retStr = webkit_dom_dom_window_prompt(webKitDOMDOMWindow, Str.toStringz(message), Str.toStringz(defaultValue));
721 
722 		scope(exit) Str.freeString(retStr);
723 		return Str.toString(retStr);
724 	}
725 
726 	/**
727 	 *
728 	 *
729 	 * Deprecated: Use JavaScriptCore API instead
730 	 *
731 	 * Since: 2.16
732 	 */
733 	public void releaseEvents()
734 	{
735 		webkit_dom_dom_window_release_events(webKitDOMDOMWindow);
736 	}
737 
738 	/**
739 	 *
740 	 *
741 	 * Deprecated: Use JavaScriptCore API instead
742 	 *
743 	 * Params:
744 	 *     x = A #gfloat
745 	 *     y = A #gfloat
746 	 *
747 	 * Since: 2.16
748 	 */
749 	public void resizeBy(float x, float y)
750 	{
751 		webkit_dom_dom_window_resize_by(webKitDOMDOMWindow, x, y);
752 	}
753 
754 	/**
755 	 *
756 	 *
757 	 * Deprecated: Use JavaScriptCore API instead
758 	 *
759 	 * Params:
760 	 *     width = A #gfloat
761 	 *     height = A #gfloat
762 	 *
763 	 * Since: 2.16
764 	 */
765 	public void resizeTo(float width, float height)
766 	{
767 		webkit_dom_dom_window_resize_to(webKitDOMDOMWindow, width, height);
768 	}
769 
770 	/**
771 	 *
772 	 *
773 	 * Deprecated: Use JavaScriptCore API instead
774 	 *
775 	 * Params:
776 	 *     x = A #gdouble
777 	 *     y = A #gdouble
778 	 *
779 	 * Since: 2.16
780 	 */
781 	public void scrollBy(double x, double y)
782 	{
783 		webkit_dom_dom_window_scroll_by(webKitDOMDOMWindow, x, y);
784 	}
785 
786 	/**
787 	 *
788 	 *
789 	 * Deprecated: Use JavaScriptCore API instead
790 	 *
791 	 * Params:
792 	 *     x = A #gdouble
793 	 *     y = A #gdouble
794 	 *
795 	 * Since: 2.16
796 	 */
797 	public void scrollTo(double x, double y)
798 	{
799 		webkit_dom_dom_window_scroll_to(webKitDOMDOMWindow, x, y);
800 	}
801 
802 	/**
803 	 *
804 	 *
805 	 * Deprecated: Use JavaScriptCore API instead
806 	 *
807 	 * Params:
808 	 *     value = A #gchar
809 	 *
810 	 * Since: 2.16
811 	 */
812 	public void setDefaultStatus(string value)
813 	{
814 		webkit_dom_dom_window_set_default_status(webKitDOMDOMWindow, Str.toStringz(value));
815 	}
816 
817 	/**
818 	 *
819 	 *
820 	 * Deprecated: Use JavaScriptCore API instead
821 	 *
822 	 * Params:
823 	 *     value = A #gchar
824 	 *
825 	 * Since: 2.16
826 	 */
827 	public void setName(string value)
828 	{
829 		webkit_dom_dom_window_set_name(webKitDOMDOMWindow, Str.toStringz(value));
830 	}
831 
832 	/**
833 	 *
834 	 *
835 	 * Deprecated: Use JavaScriptCore API instead
836 	 *
837 	 * Params:
838 	 *     value = A #gchar
839 	 *
840 	 * Since: 2.16
841 	 */
842 	public void setStatus(string value)
843 	{
844 		webkit_dom_dom_window_set_status(webKitDOMDOMWindow, Str.toStringz(value));
845 	}
846 
847 	/**
848 	 *
849 	 *
850 	 * Deprecated: Use JavaScriptCore API instead
851 	 *
852 	 * Since: 2.16
853 	 */
854 	public void stop()
855 	{
856 		webkit_dom_dom_window_stop(webKitDOMDOMWindow);
857 	}
858 
859 	/** */
860 	public bool webkitMessageHandlersPostMessage(string handler, string message)
861 	{
862 		return webkit_dom_dom_window_webkit_message_handlers_post_message(webKitDOMDOMWindow, Str.toStringz(handler), Str.toStringz(message)) != 0;
863 	}
864 }