1 module libwasm.bindings.VTTCue; 2 3 import libwasm.types; 4 5 import memutils.ct: tuple; 6 import libwasm.bindings.DocumentFragment; 7 import libwasm.bindings.HTMLDivElement; 8 import libwasm.bindings.TextTrackCue; 9 import libwasm.bindings.VTTRegion; 10 11 @safe: 12 nothrow: 13 14 enum AlignSetting { 15 start, 16 center, 17 end, 18 left, 19 right 20 } 21 enum AutoKeyword { 22 auto_ 23 } 24 enum DirectionSetting { 25 none, 26 rl, 27 lr 28 } 29 enum LineAlignSetting { 30 start, 31 center, 32 end 33 } 34 enum PositionAlignSetting { 35 line_left, 36 center, 37 line_right, 38 auto_ 39 } 40 struct VTTCue { 41 nothrow: 42 libwasm.bindings.TextTrackCue.TextTrackCue _parent; 43 alias _parent this; 44 this(Handle h) { 45 _parent = .TextTrackCue(h); 46 } 47 void region(T0)(scope auto ref Optional!(T0) region) if (isTOrPointer!(T0, VTTRegion)) { 48 Serialize_Object_VarArgCall!void(this._parent, "region", "Optional!Handle", tuple(!region.empty, cast(Handle)region.front.handle)); 49 } 50 auto region()() { 51 return recastOpt!(VTTRegion)(Object_Getter__OptionalHandle(this._parent, "region")); 52 } 53 void vertical()(DirectionSetting vertical) { 54 Object_Call_int__void(this._parent, "vertical", vertical); 55 } 56 DirectionSetting vertical()() { 57 return Object_Getter__int(this._parent, "vertical"); 58 } 59 void snapToLines()(bool snapToLines) { 60 Object_Call_bool__void(this._parent, "snapToLines", snapToLines); 61 } 62 bool snapToLines()() { 63 return Object_Getter__bool(this._parent, "snapToLines"); 64 } 65 void line()(scope ref SumType!(double, AutoKeyword) line) { 66 Serialize_Object_VarArgCall!void(this._parent, "line", "SumType!(double,int)", tuple(libwasm.sumtype.match!(((double v) => 0),((AutoKeyword v) => 1))(line),tuple(libwasm.sumtype.match!(((double v) => v),((AutoKeyword v) => double.init))(line),libwasm.sumtype.match!(((double v) => AutoKeyword.init),((AutoKeyword v) => v))(line)))); 67 } 68 auto line()() { 69 return Object_Getter__Handle(this._parent, "line"); 70 } 71 void lineAlign()(LineAlignSetting lineAlign) { 72 Object_Call_int__void(this._parent, "lineAlign", lineAlign); 73 } 74 LineAlignSetting lineAlign()() { 75 return Object_Getter__int(this._parent, "lineAlign"); 76 } 77 void position()(scope ref SumType!(double, AutoKeyword) position) { 78 Serialize_Object_VarArgCall!void(this._parent, "position", "SumType!(double,int)", tuple(libwasm.sumtype.match!(((double v) => 0),((AutoKeyword v) => 1))(position),tuple(libwasm.sumtype.match!(((double v) => v),((AutoKeyword v) => double.init))(position),libwasm.sumtype.match!(((double v) => AutoKeyword.init),((AutoKeyword v) => v))(position)))); 79 } 80 auto position()() { 81 return Object_Getter__Handle(this._parent, "position"); 82 } 83 void positionAlign()(PositionAlignSetting positionAlign) { 84 Object_Call_int__void(this._parent, "positionAlign", positionAlign); 85 } 86 PositionAlignSetting positionAlign()() { 87 return Object_Getter__int(this._parent, "positionAlign"); 88 } 89 void size()(double size) { 90 Object_Call_double__void(this._parent, "size", size); 91 } 92 double size()() { 93 return Object_Getter__double(this._parent, "size"); 94 } 95 void align_()(AlignSetting align_) { 96 Object_Call_int__void(this._parent, "align", align_); 97 } 98 AlignSetting align_()() { 99 return Object_Getter__int(this._parent, "align"); 100 } 101 void text()(string text) { 102 Object_Call_string__void(this._parent, "text", text); 103 } 104 string text()() { 105 return Object_Getter__string(this._parent, "text"); 106 } 107 auto getCueAsHTML()() { 108 return DocumentFragment(Object_Getter__Handle(this._parent, "getCueAsHTML")); 109 } 110 void displayState(T0)(scope auto ref Optional!(T0) displayState) if (isTOrPointer!(T0, HTMLDivElement)) { 111 Serialize_Object_VarArgCall!void(this._parent, "displayState", "Optional!Handle", tuple(!displayState.empty, cast(Handle)displayState.front.handle)); 112 } 113 auto displayState()() { 114 return recastOpt!(HTMLDivElement)(Object_Getter__OptionalHandle(this._parent, "displayState")); 115 } 116 bool hasBeenReset()() { 117 return Object_Getter__bool(this._parent, "hasBeenReset"); 118 } 119 double computedLine()() { 120 return Object_Getter__double(this._parent, "computedLine"); 121 } 122 double computedPosition()() { 123 return Object_Getter__double(this._parent, "computedPosition"); 124 } 125 PositionAlignSetting computedPositionAlign()() { 126 return Object_Getter__int(this._parent, "computedPositionAlign"); 127 } 128 bool getActive()() { 129 return Object_Getter__bool(this._parent, "getActive"); 130 } 131 } 132 133