1 module libwasm.bindings.HTMLInputElement;
2 
3 import libwasm.types;
4 
5 import memutils.ct: tuple;
6 import libwasm.bindings.AutocompleteInfo;
7 import libwasm.bindings.Directory;
8 import libwasm.bindings.Element;
9 import libwasm.bindings.File;
10 import libwasm.bindings.FileList;
11 import libwasm.bindings.FileSystemEntry;
12 import libwasm.bindings.HTMLElement;
13 import libwasm.bindings.HTMLFormElement;
14 import libwasm.bindings.HTMLImageElement;
15 import libwasm.bindings.NodeList;
16 import libwasm.bindings.ValidityState;
17 
18 @safe:
19 nothrow:
20 
21 struct DateTimeValue {
22   nothrow:
23   JsHandle handle;
24   alias handle this;
25   this(Handle h) {
26     this.handle = JsHandle(h);
27   }
28   static auto create() {
29     return DateTimeValue(libwasm_add__object());
30   }
31   void hour()(int hour) {
32     Object_Call_int__void(this.handle, "hour", hour);
33   }
34   int hour()() {
35     return Object_Getter__int(this.handle, "hour");
36   }
37   void minute()(int minute) {
38     Object_Call_int__void(this.handle, "minute", minute);
39   }
40   int minute()() {
41     return Object_Getter__int(this.handle, "minute");
42   }
43   void year()(int year) {
44     Object_Call_int__void(this.handle, "year", year);
45   }
46   int year()() {
47     return Object_Getter__int(this.handle, "year");
48   }
49   void month()(int month) {
50     Object_Call_int__void(this.handle, "month", month);
51   }
52   int month()() {
53     return Object_Getter__int(this.handle, "month");
54   }
55   void day()(int day) {
56     Object_Call_int__void(this.handle, "day", day);
57   }
58   int day()() {
59     return Object_Getter__int(this.handle, "day");
60   }
61 }
62 struct HTMLInputElement {
63   nothrow:
64   libwasm.bindings.HTMLElement.HTMLElement _parent;
65   alias _parent this;
66   this(Handle h) {
67     _parent = .HTMLElement(h);
68   }
69   void accept()(string accept) {
70     Object_Call_string__void(this._parent, "accept", accept);
71   }
72   string accept()() {
73     return Object_Getter__string(this._parent, "accept");
74   }
75   void alt()(string alt) {
76     Object_Call_string__void(this._parent, "alt", alt);
77   }
78   string alt()() {
79     return Object_Getter__string(this._parent, "alt");
80   }
81   void autocomplete()(string autocomplete) {
82     Object_Call_string__void(this._parent, "autocomplete", autocomplete);
83   }
84   string autocomplete()() {
85     return Object_Getter__string(this._parent, "autocomplete");
86   }
87   void autofocus()(bool autofocus) {
88     Object_Call_bool__void(this._parent, "autofocus", autofocus);
89   }
90   bool autofocus()() {
91     return Object_Getter__bool(this._parent, "autofocus");
92   }
93   void defaultChecked()(bool defaultChecked) {
94     Object_Call_bool__void(this._parent, "defaultChecked", defaultChecked);
95   }
96   bool defaultChecked()() {
97     return Object_Getter__bool(this._parent, "defaultChecked");
98   }
99   void checked()(bool checked) {
100     Object_Call_bool__void(this._parent, "checked", checked);
101   }
102   bool checked()() {
103     return Object_Getter__bool(this._parent, "checked");
104   }
105   void disabled()(bool disabled) {
106     Object_Call_bool__void(this._parent, "disabled", disabled);
107   }
108   bool disabled()() {
109     return Object_Getter__bool(this._parent, "disabled");
110   }
111   auto form()() {
112     return recastOpt!(HTMLFormElement)(Object_Getter__OptionalHandle(this._parent, "form"));
113   }
114   void files(T0)(scope auto ref Optional!(T0) files) if (isTOrPointer!(T0, FileList)) {
115     Serialize_Object_VarArgCall!void(this._parent, "files", "Optional!Handle", tuple(!files.empty, cast(Handle)files.front.handle));
116   }
117   auto files()() {
118     return recastOpt!(FileList)(Object_Getter__OptionalHandle(this._parent, "files"));
119   }
120   void formAction()(string formAction) {
121     Object_Call_string__void(this._parent, "formAction", formAction);
122   }
123   string formAction()() {
124     return Object_Getter__string(this._parent, "formAction");
125   }
126   void formEnctype()(string formEnctype) {
127     Object_Call_string__void(this._parent, "formEnctype", formEnctype);
128   }
129   string formEnctype()() {
130     return Object_Getter__string(this._parent, "formEnctype");
131   }
132   void formMethod()(string formMethod) {
133     Object_Call_string__void(this._parent, "formMethod", formMethod);
134   }
135   string formMethod()() {
136     return Object_Getter__string(this._parent, "formMethod");
137   }
138   void formNoValidate()(bool formNoValidate) {
139     Object_Call_bool__void(this._parent, "formNoValidate", formNoValidate);
140   }
141   bool formNoValidate()() {
142     return Object_Getter__bool(this._parent, "formNoValidate");
143   }
144   void formTarget()(string formTarget) {
145     Object_Call_string__void(this._parent, "formTarget", formTarget);
146   }
147   string formTarget()() {
148     return Object_Getter__string(this._parent, "formTarget");
149   }
150   void height()(uint height) {
151     Object_Call_uint__void(this._parent, "height", height);
152   }
153   uint height()() {
154     return Object_Getter__uint(this._parent, "height");
155   }
156   void indeterminate()(bool indeterminate) {
157     Object_Call_bool__void(this._parent, "indeterminate", indeterminate);
158   }
159   bool indeterminate()() {
160     return Object_Getter__bool(this._parent, "indeterminate");
161   }
162   void inputMode()(string inputMode) {
163     Object_Call_string__void(this._parent, "inputMode", inputMode);
164   }
165   string inputMode()() {
166     return Object_Getter__string(this._parent, "inputMode");
167   }
168   auto list()() {
169     return recastOpt!(HTMLElement)(Object_Getter__OptionalHandle(this._parent, "list"));
170   }
171   void max()(string max) {
172     Object_Call_string__void(this._parent, "max", max);
173   }
174   string max()() {
175     return Object_Getter__string(this._parent, "max");
176   }
177   void maxLength()(int maxLength) {
178     Object_Call_int__void(this._parent, "maxLength", maxLength);
179   }
180   int maxLength()() {
181     return Object_Getter__int(this._parent, "maxLength");
182   }
183   void min()(string min) {
184     Object_Call_string__void(this._parent, "min", min);
185   }
186   string min()() {
187     return Object_Getter__string(this._parent, "min");
188   }
189   void minLength()(int minLength) {
190     Object_Call_int__void(this._parent, "minLength", minLength);
191   }
192   int minLength()() {
193     return Object_Getter__int(this._parent, "minLength");
194   }
195   void multiple()(bool multiple) {
196     Object_Call_bool__void(this._parent, "multiple", multiple);
197   }
198   bool multiple()() {
199     return Object_Getter__bool(this._parent, "multiple");
200   }
201   void name()(string name) {
202     Object_Call_string__void(this._parent, "name", name);
203   }
204   string name()() {
205     return Object_Getter__string(this._parent, "name");
206   }
207   void pattern()(string pattern) {
208     Object_Call_string__void(this._parent, "pattern", pattern);
209   }
210   string pattern()() {
211     return Object_Getter__string(this._parent, "pattern");
212   }
213   void placeholder()(string placeholder) {
214     Object_Call_string__void(this._parent, "placeholder", placeholder);
215   }
216   string placeholder()() {
217     return Object_Getter__string(this._parent, "placeholder");
218   }
219   void readOnly()(bool readOnly) {
220     Object_Call_bool__void(this._parent, "readOnly", readOnly);
221   }
222   bool readOnly()() {
223     return Object_Getter__bool(this._parent, "readOnly");
224   }
225   void required()(bool required) {
226     Object_Call_bool__void(this._parent, "required", required);
227   }
228   bool required()() {
229     return Object_Getter__bool(this._parent, "required");
230   }
231   void size()(uint size) {
232     Object_Call_uint__void(this._parent, "size", size);
233   }
234   uint size()() {
235     return Object_Getter__uint(this._parent, "size");
236   }
237   void src()(string src) {
238     Object_Call_string__void(this._parent, "src", src);
239   }
240   string src()() {
241     return Object_Getter__string(this._parent, "src");
242   }
243   void step()(string step) {
244     Object_Call_string__void(this._parent, "step", step);
245   }
246   string step()() {
247     return Object_Getter__string(this._parent, "step");
248   }
249   void type()(string type) {
250     Object_Call_string__void(this._parent, "type", type);
251   }
252   string type()() {
253     return Object_Getter__string(this._parent, "type");
254   }
255   void defaultValue()(string defaultValue) {
256     Object_Call_string__void(this._parent, "defaultValue", defaultValue);
257   }
258   string defaultValue()() {
259     return Object_Getter__string(this._parent, "defaultValue");
260   }
261   void value()(string value) {
262     Object_Call_string__void(this._parent, "value", value);
263   }
264   string value()() {
265     return Object_Getter__string(this._parent, "value");
266   }
267   void valueAsDate(T0)(scope auto ref Optional!(T0) valueAsDate) if (isTOrPointer!(T0, Date)) {
268     Serialize_Object_VarArgCall!void(this._parent, "valueAsDate", "Optional!Handle", tuple(!valueAsDate.empty, cast(Handle)valueAsDate.front.handle));
269   }
270   auto valueAsDate()() {
271     return recastOpt!(Date)(Object_Getter__OptionalHandle(this._parent, "valueAsDate"));
272   }
273   void valueAsNumber()(double valueAsNumber) {
274     Object_Call_double__void(this._parent, "valueAsNumber", valueAsNumber);
275   }
276   double valueAsNumber()() {
277     return Object_Getter__double(this._parent, "valueAsNumber");
278   }
279   void width()(uint width) {
280     Object_Call_uint__void(this._parent, "width", width);
281   }
282   uint width()() {
283     return Object_Getter__uint(this._parent, "width");
284   }
285   void stepUp()(int n /* = 1 */) {
286     Object_Call_int__void(this._parent, "stepUp", n);
287   }
288   void stepUp()() {
289     Object_Call__void(this._parent, "stepUp");
290   }
291   void stepDown()(int n /* = 1 */) {
292     Object_Call_int__void(this._parent, "stepDown", n);
293   }
294   void stepDown()() {
295     Object_Call__void(this._parent, "stepDown");
296   }
297   bool willValidate()() {
298     return Object_Getter__bool(this._parent, "willValidate");
299   }
300   auto validity()() {
301     return ValidityState(Object_Getter__Handle(this._parent, "validity"));
302   }
303   string validationMessage()() {
304     return Object_Getter__string(this._parent, "validationMessage");
305   }
306   bool checkValidity()() {
307     return Object_Getter__bool(this._parent, "checkValidity");
308   }
309   bool reportValidity()() {
310     return Object_Getter__bool(this._parent, "reportValidity");
311   }
312   void setCustomValidity()(string error) {
313     Object_Call_string__void(this._parent, "setCustomValidity", error);
314   }
315   auto labels()() {
316     return recastOpt!(NodeList)(Object_Getter__OptionalHandle(this._parent, "labels"));
317   }
318   void select()() {
319     Object_Call__void(this._parent, "select");
320   }
321   void selectionStart(T0)(scope auto ref Optional!(T0) selectionStart) if (isTOrPointer!(T0, uint)) {
322     Serialize_Object_VarArgCall!void(this._parent, "selectionStart", "Optional!(uint)", tuple(!selectionStart.empty, selectionStart.front));
323   }
324   Optional!(uint) selectionStart()() {
325     return Object_Getter__OptionalUint(this._parent, "selectionStart");
326   }
327   void selectionEnd(T0)(scope auto ref Optional!(T0) selectionEnd) if (isTOrPointer!(T0, uint)) {
328     Serialize_Object_VarArgCall!void(this._parent, "selectionEnd", "Optional!(uint)", tuple(!selectionEnd.empty, selectionEnd.front));
329   }
330   Optional!(uint) selectionEnd()() {
331     return Object_Getter__OptionalUint(this._parent, "selectionEnd");
332   }
333   void selectionDirection(T0)(scope auto ref Optional!(T0) selectionDirection) if (isTOrPointer!(T0, string)) {
334     Serialize_Object_VarArgCall!void(this._parent, "selectionDirection", "Optional!(string)", tuple(!selectionDirection.empty, selectionDirection.front));
335   }
336   Optional!(string) selectionDirection()() {
337     return Object_Getter__OptionalString(this._parent, "selectionDirection");
338   }
339   void setRangeText()(string replacement) {
340     Object_Call_string__void(this._parent, "setRangeText", replacement);
341   }
342   void setRangeText()(string replacement, uint start, uint end, SelectionMode selectionMode /* = "preserve" */) {
343     Serialize_Object_VarArgCall!void(this._parent, "setRangeText", "string;uint;uint;Enum", tuple(replacement, start, end, selectionMode));
344   }
345   void setRangeText()(string replacement, uint start, uint end) {
346     Serialize_Object_VarArgCall!void(this._parent, "setRangeText", "string;uint;uint", tuple(replacement, start, end));
347   }
348   void setSelectionRange()(uint start, uint end, string direction) {
349     Serialize_Object_VarArgCall!void(this._parent, "setSelectionRange", "uint;uint;string", tuple(start, end, direction));
350   }
351   void setSelectionRange()(uint start, uint end) {
352     Serialize_Object_VarArgCall!void(this._parent, "setSelectionRange", "uint;uint", tuple(start, end));
353   }
354   void align_()(string align_) {
355     Object_Call_string__void(this._parent, "align", align_);
356   }
357   string align_()() {
358     return Object_Getter__string(this._parent, "align");
359   }
360   void useMap()(string useMap) {
361     Object_Call_string__void(this._parent, "useMap", useMap);
362   }
363   string useMap()() {
364     return Object_Getter__string(this._parent, "useMap");
365   }
366   auto controllers()() {
367     return XULControllers(Object_Getter__Handle(this._parent, "controllers"));
368   }
369   int textLength()() {
370     return Object_Getter__int(this._parent, "textLength");
371   }
372   auto mozGetFileNameArray()() {
373     return Sequence!(string)(Object_Getter__Handle(this._parent, "mozGetFileNameArray"));
374   }
375   void mozSetFileNameArray()(scope ref Sequence!(string) fileNames) {
376     Object_Call_Handle__void(this._parent, "mozSetFileNameArray", fileNames.handle);
377   }
378   void mozSetFileArray()(scope ref Sequence!(File) files) {
379     Object_Call_Handle__void(this._parent, "mozSetFileArray", files.handle);
380   }
381   void mozSetDirectory()(string directoryPath) {
382     Object_Call_string__void(this._parent, "mozSetDirectory", directoryPath);
383   }
384   void mozSetDndFilesAndDirectories()(scope ref Sequence!(SumType!(File, Directory)) list) {
385     Object_Call_Handle__void(this._parent, "mozSetDndFilesAndDirectories", list.handle);
386   }
387   auto ownerNumberControl()() {
388     return recastOpt!(HTMLInputElement)(Object_Getter__OptionalHandle(this._parent, "ownerNumberControl"));
389   }
390   bool mozIsTextField()(bool aExcludePassword) {
391     return Serialize_Object_VarArgCall!bool(this._parent, "mozIsTextField", "bool", tuple(aExcludePassword));
392   }
393   bool hasBeenTypePassword()() {
394     return Object_Getter__bool(this._parent, "hasBeenTypePassword");
395   }
396   void previewValue()(string previewValue) {
397     Object_Call_string__void(this._parent, "previewValue", previewValue);
398   }
399   string previewValue()() {
400     return Object_Getter__string(this._parent, "previewValue");
401   }
402   auto getAutocompleteInfo()() {
403     return recastOpt!(AutocompleteInfo)(Object_Getter__OptionalHandle(this._parent, "getAutocompleteInfo"));
404   }
405   void allowdirs()(bool allowdirs) {
406     Object_Call_bool__void(this._parent, "allowdirs", allowdirs);
407   }
408   bool allowdirs()() {
409     return Object_Getter__bool(this._parent, "allowdirs");
410   }
411   bool isFilesAndDirectoriesSupported()() {
412     return Object_Getter__bool(this._parent, "isFilesAndDirectoriesSupported");
413   }
414   auto getFilesAndDirectories()() {
415     return JsPromise!(Sequence!(SumType!(File, Directory)))(Object_Getter__Handle(this._parent, "getFilesAndDirectories"));
416   }
417   auto getFiles()(bool recursiveFlag /* = false */) {
418     return JsPromise!(Sequence!(File))(Object_Call_bool__Handle(this._parent, "getFiles", recursiveFlag));
419   }
420   auto getFiles()() {
421     return JsPromise!(Sequence!(File))(Object_Getter__Handle(this._parent, "getFiles"));
422   }
423   void chooseDirectory()() {
424     Object_Call__void(this._parent, "chooseDirectory");
425   }
426   auto webkitEntries()() {
427     return Sequence!(FileSystemEntry)(Object_Getter__Handle(this._parent, "webkitEntries"));
428   }
429   void webkitdirectory()(bool webkitdirectory) {
430     Object_Call_bool__void(this._parent, "webkitdirectory", webkitdirectory);
431   }
432   bool webkitdirectory()() {
433     return Object_Getter__bool(this._parent, "webkitdirectory");
434   }
435   auto getDateTimeInputBoxValue()() {
436     return DateTimeValue(Object_Getter__Handle(this._parent, "getDateTimeInputBoxValue"));
437   }
438   auto dateTimeBoxElement()() {
439     return recastOpt!(Element)(Object_Getter__OptionalHandle(this._parent, "dateTimeBoxElement"));
440   }
441   double getMinimum()() {
442     return Object_Getter__double(this._parent, "getMinimum");
443   }
444   double getMaximum()() {
445     return Object_Getter__double(this._parent, "getMaximum");
446   }
447   void openDateTimePicker()(scope ref DateTimeValue initialValue) {
448     Object_Call_Handle__void(this._parent, "openDateTimePicker", initialValue.handle);
449   }
450   void openDateTimePicker()() {
451     Object_Call__void(this._parent, "openDateTimePicker");
452   }
453   void updateDateTimePicker()(scope ref DateTimeValue value) {
454     Object_Call_Handle__void(this._parent, "updateDateTimePicker", value.handle);
455   }
456   void updateDateTimePicker()() {
457     Object_Call__void(this._parent, "updateDateTimePicker");
458   }
459   void closeDateTimePicker()() {
460     Object_Call__void(this._parent, "closeDateTimePicker");
461   }
462   void setFocusState()(bool aIsFocused) {
463     Object_Call_bool__void(this._parent, "setFocusState", aIsFocused);
464   }
465   void updateValidityState()() {
466     Object_Call__void(this._parent, "updateValidityState");
467   }
468   double getStep()() {
469     return Object_Getter__double(this._parent, "getStep");
470   }
471   double getStepBase()() {
472     return Object_Getter__double(this._parent, "getStepBase");
473   }
474   auto editor()() {
475     return recastOpt!(nsIEditor)(Object_Getter__OptionalHandle(this._parent, "editor"));
476   }
477   bool isInputEventTarget()() {
478     return Object_Getter__bool(this._parent, "isInputEventTarget");
479   }
480   void setUserInput()(string input) {
481     Object_Call_string__void(this._parent, "setUserInput", input);
482   }
483   enum int UNKNOWN_REQUEST = -1;
484   enum int CURRENT_REQUEST = 0;
485   enum int PENDING_REQUEST = 1;
486   void loadingEnabled()(bool loadingEnabled) {
487     Object_Call_bool__void(this._parent, "loadingEnabled", loadingEnabled);
488   }
489   bool loadingEnabled()() {
490     return Object_Getter__bool(this._parent, "loadingEnabled");
491   }
492   short imageBlockingStatus()() {
493     return Serialize_Object_VarArgCall!short(this._parent, "imageBlockingStatus", "", tuple());
494   }
495   void addObserver()(scope ref imgINotificationObserver aObserver) {
496     Object_Call_Handle__void(this._parent, "addObserver", aObserver.handle);
497   }
498   void removeObserver()(scope ref imgINotificationObserver aObserver) {
499     Object_Call_Handle__void(this._parent, "removeObserver", aObserver.handle);
500   }
501   auto getRequest()(int aRequestType) {
502     return recastOpt!(imgIRequest)(Object_Call_int__OptionalHandle(this._parent, "getRequest", aRequestType));
503   }
504   int getRequestType()(scope ref imgIRequest aRequest) {
505     return Serialize_Object_VarArgCall!int(this._parent, "getRequestType", "Handle", tuple(cast(Handle)aRequest.handle));
506   }
507   auto currentURI()() {
508     return recastOpt!(URI)(Object_Getter__OptionalHandle(this._parent, "currentURI"));
509   }
510   auto currentRequestFinalURI()() {
511     return recastOpt!(URI)(Object_Getter__OptionalHandle(this._parent, "currentRequestFinalURI"));
512   }
513   void forceReload()(bool aNotify /* = true */) {
514     Object_Call_bool__void(this._parent, "forceReload", aNotify);
515   }
516   void forceReload()() {
517     Object_Call__void(this._parent, "forceReload");
518   }
519   void forceImageState()(bool aForce, uint aState) {
520     Serialize_Object_VarArgCall!void(this._parent, "forceImageState", "bool;uint", tuple(aForce, aState));
521   }
522 }
523 struct MozEditableElement {
524   nothrow:
525   JsHandle handle;
526   alias handle this;
527   this(Handle h) {
528     this.handle = JsHandle(h);
529   }
530   auto editor()() {
531     return recastOpt!(nsIEditor)(Object_Getter__OptionalHandle(this.handle, "editor"));
532   }
533   bool isInputEventTarget()() {
534     return Object_Getter__bool(this.handle, "isInputEventTarget");
535   }
536   void setUserInput()(string input) {
537     Object_Call_string__void(this.handle, "setUserInput", input);
538   }
539 }
540 enum SelectionMode {
541   select,
542   start,
543   end,
544   preserve
545 }
546 
547