1 module libwasm.bindings.BoxObject;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 import libwasm.bindings.Element;
7 
8 @safe:
9 nothrow:
10 
11 struct BoxObject {
12   nothrow:
13   JsHandle handle;
14   alias handle this;
15   this(Handle h) {
16     this.handle = JsHandle(h);
17   }
18   auto element()() {
19     return recastOpt!(Element)(Object_Getter__OptionalHandle(this.handle, "element"));
20   }
21   int x()() {
22     return Object_Getter__int(this.handle, "x");
23   }
24   int y()() {
25     return Object_Getter__int(this.handle, "y");
26   }
27   int screenX()() {
28     return Object_Getter__int(this.handle, "screenX");
29   }
30   int screenY()() {
31     return Object_Getter__int(this.handle, "screenY");
32   }
33   int width()() {
34     return Object_Getter__int(this.handle, "width");
35   }
36   int height()() {
37     return Object_Getter__int(this.handle, "height");
38   }
39   auto getPropertyAsSupports()(string propertyName) {
40     return recastOpt!(nsISupports)(Object_Call_string__OptionalHandle(this.handle, "getPropertyAsSupports", propertyName));
41   }
42   void setPropertyAsSupports()(string propertyName, scope ref nsISupports value) {
43     Serialize_Object_VarArgCall!void(this.handle, "setPropertyAsSupports", "string;Handle", tuple(propertyName, cast(Handle)value.handle));
44   }
45   Optional!(string) getProperty()(string propertyName) {
46     return Object_Call_string__OptionalString(this.handle, "getProperty", propertyName);
47   }
48   void setProperty()(string propertyName, string propertyValue) {
49     Object_Call_string_string__void(this.handle, "setProperty", propertyName, propertyValue);
50   }
51   void removeProperty()(string propertyName) {
52     Object_Call_string__void(this.handle, "removeProperty", propertyName);
53   }
54   auto parentBox()() {
55     return recastOpt!(Element)(Object_Getter__OptionalHandle(this.handle, "parentBox"));
56   }
57   auto firstChild()() {
58     return recastOpt!(Element)(Object_Getter__OptionalHandle(this.handle, "firstChild"));
59   }
60   auto lastChild()() {
61     return recastOpt!(Element)(Object_Getter__OptionalHandle(this.handle, "lastChild"));
62   }
63   auto nextSibling()() {
64     return recastOpt!(Element)(Object_Getter__OptionalHandle(this.handle, "nextSibling"));
65   }
66   auto previousSibling()() {
67     return recastOpt!(Element)(Object_Getter__OptionalHandle(this.handle, "previousSibling"));
68   }
69 }
70 
71