1 module libwasm.bindings.TreeView;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 import libwasm.bindings.DataTransfer;
7 import libwasm.bindings.TreeColumn;
8 
9 @safe:
10 nothrow:
11 
12 struct TreeView {
13   nothrow:
14   JsHandle handle;
15   alias handle this;
16   this(Handle h) {
17     this.handle = JsHandle(h);
18   }
19   int rowCount()() {
20     return Object_Getter__int(this.handle, "rowCount");
21   }
22   void selection(T0)(scope auto ref Optional!(T0) selection) if (isTOrPointer!(T0, nsITreeSelection)) {
23     Serialize_Object_VarArgCall!void(this.handle, "selection", "Optional!Handle", tuple(!selection.empty, cast(Handle)selection.front.handle));
24   }
25   auto selection()() {
26     return recastOpt!(nsITreeSelection)(Object_Getter__OptionalHandle(this.handle, "selection"));
27   }
28   string getRowProperties()(int row) {
29     return Serialize_Object_VarArgCall!string(this.handle, "getRowProperties", "int", tuple(row));
30   }
31   string getCellProperties()(int row, scope ref TreeColumn column) {
32     return Serialize_Object_VarArgCall!string(this.handle, "getCellProperties", "int;Handle", tuple(row, cast(Handle)column.handle));
33   }
34   string getColumnProperties()(scope ref TreeColumn column) {
35     return Serialize_Object_VarArgCall!string(this.handle, "getColumnProperties", "Handle", tuple(cast(Handle)column.handle));
36   }
37   bool isContainer()(int row) {
38     return Serialize_Object_VarArgCall!bool(this.handle, "isContainer", "int", tuple(row));
39   }
40   bool isContainerOpen()(int row) {
41     return Serialize_Object_VarArgCall!bool(this.handle, "isContainerOpen", "int", tuple(row));
42   }
43   bool isContainerEmpty()(int row) {
44     return Serialize_Object_VarArgCall!bool(this.handle, "isContainerEmpty", "int", tuple(row));
45   }
46   bool isSeparator()(int row) {
47     return Serialize_Object_VarArgCall!bool(this.handle, "isSeparator", "int", tuple(row));
48   }
49   bool isSorted()() {
50     return Object_Getter__bool(this.handle, "isSorted");
51   }
52   enum short DROP_BEFORE = -1;
53   enum short DROP_ON = 0;
54   enum short DROP_AFTER = 1;
55   bool canDrop(T2)(int row, int orientation, scope auto ref Optional!(T2) dataTransfer) if (isTOrPointer!(T2, DataTransfer)) {
56     return Serialize_Object_VarArgCall!bool(this.handle, "canDrop", "int;int;Optional!Handle", tuple(row, orientation, !dataTransfer.empty, cast(Handle)dataTransfer.front.handle));
57   }
58   void drop(T2)(int row, int orientation, scope auto ref Optional!(T2) dataTransfer) if (isTOrPointer!(T2, DataTransfer)) {
59     Serialize_Object_VarArgCall!void(this.handle, "drop", "int;int;Optional!Handle", tuple(row, orientation, !dataTransfer.empty, cast(Handle)dataTransfer.front.handle));
60   }
61   int getParentIndex()(int row) {
62     return Serialize_Object_VarArgCall!int(this.handle, "getParentIndex", "int", tuple(row));
63   }
64   bool hasNextSibling()(int row, int afterIndex) {
65     return Serialize_Object_VarArgCall!bool(this.handle, "hasNextSibling", "int;int", tuple(row, afterIndex));
66   }
67   int getLevel()(int row) {
68     return Serialize_Object_VarArgCall!int(this.handle, "getLevel", "int", tuple(row));
69   }
70   string getImageSrc()(int row, scope ref TreeColumn column) {
71     return Serialize_Object_VarArgCall!string(this.handle, "getImageSrc", "int;Handle", tuple(row, cast(Handle)column.handle));
72   }
73   string getCellValue()(int row, scope ref TreeColumn column) {
74     return Serialize_Object_VarArgCall!string(this.handle, "getCellValue", "int;Handle", tuple(row, cast(Handle)column.handle));
75   }
76   string getCellText()(int row, scope ref TreeColumn column) {
77     return Serialize_Object_VarArgCall!string(this.handle, "getCellText", "int;Handle", tuple(row, cast(Handle)column.handle));
78   }
79   void setTree(T0)(scope auto ref Optional!(T0) tree) if (isTOrPointer!(T0, XULTreeElement)) {
80     Serialize_Object_VarArgCall!void(this.handle, "setTree", "Optional!Handle", tuple(!tree.empty, cast(Handle)tree.front.handle));
81   }
82   void toggleOpenState()(int row) {
83     Object_Call_int__void(this.handle, "toggleOpenState", row);
84   }
85   void cycleHeader()(scope ref TreeColumn column) {
86     Object_Call_Handle__void(this.handle, "cycleHeader", column.handle);
87   }
88   void selectionChanged()() {
89     Object_Call__void(this.handle, "selectionChanged");
90   }
91   void cycleCell()(int row, scope ref TreeColumn column) {
92     Serialize_Object_VarArgCall!void(this.handle, "cycleCell", "int;Handle", tuple(row, cast(Handle)column.handle));
93   }
94   bool isEditable()(int row, scope ref TreeColumn column) {
95     return Serialize_Object_VarArgCall!bool(this.handle, "isEditable", "int;Handle", tuple(row, cast(Handle)column.handle));
96   }
97   void setCellValue()(int row, scope ref TreeColumn column, string value) {
98     Serialize_Object_VarArgCall!void(this.handle, "setCellValue", "int;Handle;string", tuple(row, cast(Handle)column.handle, value));
99   }
100   void setCellText()(int row, scope ref TreeColumn column, string value) {
101     Serialize_Object_VarArgCall!void(this.handle, "setCellText", "int;Handle;string", tuple(row, cast(Handle)column.handle, value));
102   }
103   void performAction()(string action) {
104     Object_Call_string__void(this.handle, "performAction", action);
105   }
106   void performActionOnRow()(string action, int row) {
107     Serialize_Object_VarArgCall!void(this.handle, "performActionOnRow", "string;int", tuple(action, row));
108   }
109   void performActionOnCell()(string action, int row, scope ref TreeColumn column) {
110     Serialize_Object_VarArgCall!void(this.handle, "performActionOnCell", "string;int;Handle", tuple(action, row, cast(Handle)column.handle));
111   }
112 }
113 
114