1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
5 // Generated from namespace: events
13 class EventsEventArgumentElement extends ChromeObject {
17 EventsEventArgumentElement({String elementStringArg}) {
18 if (elementStringArg != null)
19 this.elementStringArg = elementStringArg;
25 EventsEventArgumentElement._proxy(_jsObject) : super._proxy(_jsObject);
30 String get elementStringArg => JS('String', '#.elementStringArg', this._jsObject);
32 void set elementStringArg(String elementStringArg) {
33 JS('void', '#.elementStringArg = #', this._jsObject, elementStringArg);
38 class EventsEventArgument extends ChromeObject {
42 EventsEventArgument({FileEntry entryArg, String stringArg, int intArg, List<EventsEventArgumentElement> elements, FileEntry optionalEntryArg, String optionalStringArg, int optionalIntArg, List<EventsEventArgumentElement> optionalElements}) {
44 this.entryArg = entryArg;
45 if (stringArg != null)
46 this.stringArg = stringArg;
50 this.elements = elements;
51 if (optionalEntryArg != null)
52 this.optionalEntryArg = optionalEntryArg;
53 if (optionalStringArg != null)
54 this.optionalStringArg = optionalStringArg;
55 if (optionalIntArg != null)
56 this.optionalIntArg = optionalIntArg;
57 if (optionalElements != null)
58 this.optionalElements = optionalElements;
64 EventsEventArgument._proxy(_jsObject) : super._proxy(_jsObject);
70 FileEntry get entryArg => JS('FileEntry', '#.entryArg', this._jsObject);
72 void set entryArg(FileEntry entryArg) {
73 JS('void', '#.entryArg = #', this._jsObject, convertArgument(entryArg));
77 String get stringArg => JS('String', '#.stringArg', this._jsObject);
79 void set stringArg(String stringArg) {
80 JS('void', '#.stringArg = #', this._jsObject, stringArg);
84 int get intArg => JS('int', '#.intArg', this._jsObject);
86 void set intArg(int intArg) {
87 JS('void', '#.intArg = #', this._jsObject, intArg);
91 List<EventsEventArgumentElement> get elements {
92 List<EventsEventArgumentElement> __proxy_elements = new List<EventsEventArgumentElement>();
93 int count = JS('int', '#.elements.length', this._jsObject);
94 for (int i = 0; i < count; i++) {
95 var item = JS('', '#.elements[#]', this._jsObject, i);
96 __proxy_elements.add(new EventsEventArgumentElement._proxy(item));
98 return __proxy_elements;
101 void set elements(List<EventsEventArgumentElement> elements) {
102 JS('void', '#.elements = #', this._jsObject, convertArgument(elements));
105 /// Optional file entry
106 FileEntry get optionalEntryArg => JS('FileEntry', '#.optionalEntryArg', this._jsObject);
108 void set optionalEntryArg(FileEntry optionalEntryArg) {
109 JS('void', '#.optionalEntryArg = #', this._jsObject, convertArgument(optionalEntryArg));
113 String get optionalStringArg => JS('String', '#.optionalStringArg', this._jsObject);
115 void set optionalStringArg(String optionalStringArg) {
116 JS('void', '#.optionalStringArg = #', this._jsObject, optionalStringArg);
120 int get optionalIntArg => JS('int', '#.optionalIntArg', this._jsObject);
122 void set optionalIntArg(int optionalIntArg) {
123 JS('void', '#.optionalIntArg = #', this._jsObject, optionalIntArg);
127 List<EventsEventArgumentElement> get optionalElements {
128 List<EventsEventArgumentElement> __proxy_optionalElements = new List<EventsEventArgumentElement>();
129 int count = JS('int', '#.optionalElements.length', this._jsObject);
130 for (int i = 0; i < count; i++) {
131 var item = JS('', '#.optionalElements[#]', this._jsObject, i);
132 __proxy_optionalElements.add(new EventsEventArgumentElement._proxy(item));
134 return __proxy_optionalElements;
137 void set optionalElements(List<EventsEventArgumentElement> optionalElements) {
138 JS('void', '#.optionalElements = #', this._jsObject, convertArgument(optionalElements));
147 /// Documentation for the first basic event.
148 class Event_events_firstBasicEvent extends Event {
149 void addListener(void callback()) => super.addListener(callback);
151 void removeListener(void callback()) => super.removeListener(callback);
153 bool hasListener(void callback()) => super.hasListener(callback);
155 Event_events_firstBasicEvent(jsObject) : super._(jsObject, 0);
158 /// Documentation for the second basic event.
159 class Event_events_secondBasicEvent extends Event {
160 void addListener(void callback()) => super.addListener(callback);
162 void removeListener(void callback()) => super.removeListener(callback);
164 bool hasListener(void callback()) => super.hasListener(callback);
166 Event_events_secondBasicEvent(jsObject) : super._(jsObject, 0);
169 /// Documentation for an event with a non-optional primitive argument.
170 class Event_events_nonOptionalPrimitiveArgEvent extends Event {
171 void addListener(void callback(int argument)) => super.addListener(callback);
173 void removeListener(void callback(int argument)) => super.removeListener(callback);
175 bool hasListener(void callback(int argument)) => super.hasListener(callback);
177 Event_events_nonOptionalPrimitiveArgEvent(jsObject) : super._(jsObject, 1);
180 /// Documentation for an event with an optional primitive argument.
181 class Event_events_optionalPrimitiveArgEvent extends Event {
182 void addListener(void callback(int argument)) => super.addListener(callback);
184 void removeListener(void callback(int argument)) => super.removeListener(callback);
186 bool hasListener(void callback(int argument)) => super.hasListener(callback);
188 Event_events_optionalPrimitiveArgEvent(jsObject) : super._(jsObject, 1);
191 /// Documentation for an event with a non-optional dictionary argument.
192 class Event_events_nonOptionalDictArgEvent extends Event {
193 void addListener(void callback(EventsEventArgument argument)) {
194 void __proxy_callback(argument) {
195 if (callback != null) {
196 callback(new EventsEventArgument._proxy(argument));
199 super.addListener(__proxy_callback);
202 void removeListener(void callback(EventsEventArgument argument)) {
203 void __proxy_callback(argument) {
204 if (callback != null) {
205 callback(new EventsEventArgument._proxy(argument));
208 super.removeListener(__proxy_callback);
211 bool hasListener(void callback(EventsEventArgument argument)) {
212 void __proxy_callback(argument) {
213 if (callback != null) {
214 callback(new EventsEventArgument._proxy(argument));
217 super.hasListener(__proxy_callback);
220 Event_events_nonOptionalDictArgEvent(jsObject) : super._(jsObject, 1);
223 /// Documentation for an event with a optional dictionary argument.
224 class Event_events_optionalDictArgEvent extends Event {
225 void addListener(void callback(EventsEventArgument argument)) {
226 void __proxy_callback(argument) {
227 if (callback != null) {
228 callback(new EventsEventArgument._proxy(argument));
231 super.addListener(__proxy_callback);
234 void removeListener(void callback(EventsEventArgument argument)) {
235 void __proxy_callback(argument) {
236 if (callback != null) {
237 callback(new EventsEventArgument._proxy(argument));
240 super.removeListener(__proxy_callback);
243 bool hasListener(void callback(EventsEventArgument argument)) {
244 void __proxy_callback(argument) {
245 if (callback != null) {
246 callback(new EventsEventArgument._proxy(argument));
249 super.hasListener(__proxy_callback);
252 Event_events_optionalDictArgEvent(jsObject) : super._(jsObject, 1);
268 Event_events_firstBasicEvent firstBasicEvent;
269 Event_events_secondBasicEvent secondBasicEvent;
270 Event_events_nonOptionalPrimitiveArgEvent nonOptionalPrimitiveArgEvent;
271 Event_events_optionalPrimitiveArgEvent optionalPrimitiveArgEvent;
272 Event_events_nonOptionalDictArgEvent nonOptionalDictArgEvent;
273 Event_events_optionalDictArgEvent optionalDictArgEvent;
274 API_events(this._jsObject) {
275 firstBasicEvent = new Event_events_firstBasicEvent(JS('', '#.firstBasicEvent', this._jsObject));
276 secondBasicEvent = new Event_events_secondBasicEvent(JS('', '#.secondBasicEvent', this._jsObject));
277 nonOptionalPrimitiveArgEvent = new Event_events_nonOptionalPrimitiveArgEvent(JS('', '#.nonOptionalPrimitiveArgEvent', this._jsObject));
278 optionalPrimitiveArgEvent = new Event_events_optionalPrimitiveArgEvent(JS('', '#.optionalPrimitiveArgEvent', this._jsObject));
279 nonOptionalDictArgEvent = new Event_events_nonOptionalDictArgEvent(JS('', '#.nonOptionalDictArgEvent', this._jsObject));
280 optionalDictArgEvent = new Event_events_optionalDictArgEvent(JS('', '#.optionalDictArgEvent', this._jsObject));