1 module libwasm.bindings.FrameLoader;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 import libwasm.bindings.Element;
7 import libwasm.bindings.ImageBitmap;
8 import libwasm.bindings.ParentSHistory;
9 
10 @safe:
11 nothrow:
12 
13 struct FrameLoader {
14   nothrow:
15   JsHandle handle;
16   alias handle this;
17   this(Handle h) {
18     this.handle = JsHandle(h);
19   }
20   auto docShell()() {
21     return recastOpt!(nsIDocShell)(Object_Getter__OptionalHandle(this.handle, "docShell"));
22   }
23   auto tabParent()() {
24     return recastOpt!(TabParent)(Object_Getter__OptionalHandle(this.handle, "tabParent"));
25   }
26   auto loadContext()() {
27     return LoadContext(Object_Getter__Handle(this.handle, "loadContext"));
28   }
29   auto browsingContext()() {
30     return recastOpt!(BrowsingContext)(Object_Getter__OptionalHandle(this.handle, "browsingContext"));
31   }
32   auto parentSHistory()() {
33     return recastOpt!(ParentSHistory)(Object_Getter__OptionalHandle(this.handle, "parentSHistory"));
34   }
35   bool depthTooGreat()() {
36     return Object_Getter__bool(this.handle, "depthTooGreat");
37   }
38   void activateRemoteFrame()() {
39     Object_Call__void(this.handle, "activateRemoteFrame");
40   }
41   void deactivateRemoteFrame()() {
42     Object_Call__void(this.handle, "deactivateRemoteFrame");
43   }
44   void sendCrossProcessMouseEvent()(string aType, float aX, float aY, int aButton, int aClickCount, int aModifiers, bool aIgnoreRootScrollFrame /* = false */) {
45     Serialize_Object_VarArgCall!void(this.handle, "sendCrossProcessMouseEvent", "string;float;float;int;int;int;bool", tuple(aType, aX, aY, aButton, aClickCount, aModifiers, aIgnoreRootScrollFrame));
46   }
47   void sendCrossProcessMouseEvent()(string aType, float aX, float aY, int aButton, int aClickCount, int aModifiers) {
48     Serialize_Object_VarArgCall!void(this.handle, "sendCrossProcessMouseEvent", "string;float;float;int;int;int", tuple(aType, aX, aY, aButton, aClickCount, aModifiers));
49   }
50   void activateFrameEvent()(string aType, bool capture) {
51     Serialize_Object_VarArgCall!void(this.handle, "activateFrameEvent", "string;bool", tuple(aType, capture));
52   }
53   auto messageManager()() {
54     return recastOpt!(MessageSender)(Object_Getter__OptionalHandle(this.handle, "messageManager"));
55   }
56   void requestNotifyAfterRemotePaint()() {
57     Object_Call__void(this.handle, "requestNotifyAfterRemotePaint");
58   }
59   void requestUpdatePosition()() {
60     Object_Call__void(this.handle, "requestUpdatePosition");
61   }
62   void print(T2)(uint aOuterWindowID, scope ref nsIPrintSettings aPrintSettings, scope auto ref Optional!(T2) aProgressListener /* = no!(nsIWebProgressListener) */) if (isTOrPointer!(T2, nsIWebProgressListener)) {
63     Serialize_Object_VarArgCall!void(this.handle, "print", "uint;Handle;Optional!Handle", tuple(aOuterWindowID, cast(Handle)aPrintSettings.handle, !aProgressListener.empty, cast(Handle)aProgressListener.front.handle));
64   }
65   void print()(uint aOuterWindowID, scope ref nsIPrintSettings aPrintSettings) {
66     Serialize_Object_VarArgCall!void(this.handle, "print", "uint;Handle", tuple(aOuterWindowID, cast(Handle)aPrintSettings.handle));
67   }
68   auto drawSnapshot()(double x, double y, double w, double h, double scale, string backgroundColor) {
69     return JsPromise!(ImageBitmap)(Serialize_Object_VarArgCall!Handle(this.handle, "drawSnapshot", "double;double;double;double;double;string", tuple(x, y, w, h, scale, backgroundColor)));
70   }
71   auto ownerElement()() {
72     return recastOpt!(Element)(Object_Getter__OptionalHandle(this.handle, "ownerElement"));
73   }
74   uint childID()() {
75     return Object_Getter__uint(this.handle, "childID");
76   }
77   bool ownerIsMozBrowserFrame()() {
78     return Object_Getter__bool(this.handle, "ownerIsMozBrowserFrame");
79   }
80   uint lazyWidth()() {
81     return Object_Getter__uint(this.handle, "lazyWidth");
82   }
83   uint lazyHeight()() {
84     return Object_Getter__uint(this.handle, "lazyHeight");
85   }
86   bool isDead()() {
87     return Object_Getter__bool(this.handle, "isDead");
88   }
89   void startPersistence()(uint aOuterWindowID, scope ref nsIWebBrowserPersistDocumentReceiver aRecv) {
90     Serialize_Object_VarArgCall!void(this.handle, "startPersistence", "uint;Handle", tuple(aOuterWindowID, cast(Handle)aRecv.handle));
91   }
92 }
93 struct WebBrowserPersistable {
94   nothrow:
95   JsHandle handle;
96   alias handle this;
97   this(Handle h) {
98     this.handle = JsHandle(h);
99   }
100   void startPersistence()(uint aOuterWindowID, scope ref nsIWebBrowserPersistDocumentReceiver aRecv) {
101     Serialize_Object_VarArgCall!void(this.handle, "startPersistence", "uint;Handle", tuple(aOuterWindowID, cast(Handle)aRecv.handle));
102   }
103 }
104 
105