• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (c) 2013, 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.
4
5// Generated from namespace: events
6
7part of chrome;
8
9/**
10 * Types
11 */
12
13class EventsEventArgumentElement extends ChromeObject {
14  /*
15   * Public constructor
16   */
17  EventsEventArgumentElement({String elementStringArg}) {
18    if (elementStringArg != null)
19      this.elementStringArg = elementStringArg;
20  }
21
22  /*
23   * Private constructor
24   */
25  EventsEventArgumentElement._proxy(_jsObject) : super._proxy(_jsObject);
26
27  /*
28   * Public accessors
29   */
30  String get elementStringArg => JS('String', '#.elementStringArg', this._jsObject);
31
32  void set elementStringArg(String elementStringArg) {
33    JS('void', '#.elementStringArg = #', this._jsObject, elementStringArg);
34  }
35
36}
37
38class EventsEventArgument extends ChromeObject {
39  /*
40   * Public constructor
41   */
42  EventsEventArgument({FileEntry entryArg, String stringArg, int intArg, List<EventsEventArgumentElement> elements, FileEntry optionalEntryArg, String optionalStringArg, int optionalIntArg, List<EventsEventArgumentElement> optionalElements}) {
43    if (entryArg != null)
44      this.entryArg = entryArg;
45    if (stringArg != null)
46      this.stringArg = stringArg;
47    if (intArg != null)
48      this.intArg = intArg;
49    if (elements != null)
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;
59  }
60
61  /*
62   * Private constructor
63   */
64  EventsEventArgument._proxy(_jsObject) : super._proxy(_jsObject);
65
66  /*
67   * Public accessors
68   */
69  /// A file entry
70  FileEntry get entryArg => JS('FileEntry', '#.entryArg', this._jsObject);
71
72  void set entryArg(FileEntry entryArg) {
73    JS('void', '#.entryArg = #', this._jsObject, convertArgument(entryArg));
74  }
75
76  /// A string
77  String get stringArg => JS('String', '#.stringArg', this._jsObject);
78
79  void set stringArg(String stringArg) {
80    JS('void', '#.stringArg = #', this._jsObject, stringArg);
81  }
82
83  /// A primitive
84  int get intArg => JS('int', '#.intArg', this._jsObject);
85
86  void set intArg(int intArg) {
87    JS('void', '#.intArg = #', this._jsObject, intArg);
88  }
89
90  /// An array
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));
97    }
98    return __proxy_elements;
99  }
100
101  void set elements(List<EventsEventArgumentElement> elements) {
102    JS('void', '#.elements = #', this._jsObject, convertArgument(elements));
103  }
104
105  /// Optional file entry
106  FileEntry get optionalEntryArg => JS('FileEntry', '#.optionalEntryArg', this._jsObject);
107
108  void set optionalEntryArg(FileEntry optionalEntryArg) {
109    JS('void', '#.optionalEntryArg = #', this._jsObject, convertArgument(optionalEntryArg));
110  }
111
112  /// A string
113  String get optionalStringArg => JS('String', '#.optionalStringArg', this._jsObject);
114
115  void set optionalStringArg(String optionalStringArg) {
116    JS('void', '#.optionalStringArg = #', this._jsObject, optionalStringArg);
117  }
118
119  /// A primitive
120  int get optionalIntArg => JS('int', '#.optionalIntArg', this._jsObject);
121
122  void set optionalIntArg(int optionalIntArg) {
123    JS('void', '#.optionalIntArg = #', this._jsObject, optionalIntArg);
124  }
125
126  /// An array
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));
133    }
134    return __proxy_optionalElements;
135  }
136
137  void set optionalElements(List<EventsEventArgumentElement> optionalElements) {
138    JS('void', '#.optionalElements = #', this._jsObject, convertArgument(optionalElements));
139  }
140
141}
142
143/**
144 * Events
145 */
146
147/// Documentation for the first basic event.
148class Event_events_firstBasicEvent extends Event {
149  void addListener(void callback()) => super.addListener(callback);
150
151  void removeListener(void callback()) => super.removeListener(callback);
152
153  bool hasListener(void callback()) => super.hasListener(callback);
154
155  Event_events_firstBasicEvent(jsObject) : super._(jsObject, 0);
156}
157
158/// Documentation for the second basic event.
159class Event_events_secondBasicEvent extends Event {
160  void addListener(void callback()) => super.addListener(callback);
161
162  void removeListener(void callback()) => super.removeListener(callback);
163
164  bool hasListener(void callback()) => super.hasListener(callback);
165
166  Event_events_secondBasicEvent(jsObject) : super._(jsObject, 0);
167}
168
169/// Documentation for an event with a non-optional primitive argument.
170class Event_events_nonOptionalPrimitiveArgEvent extends Event {
171  void addListener(void callback(int argument)) => super.addListener(callback);
172
173  void removeListener(void callback(int argument)) => super.removeListener(callback);
174
175  bool hasListener(void callback(int argument)) => super.hasListener(callback);
176
177  Event_events_nonOptionalPrimitiveArgEvent(jsObject) : super._(jsObject, 1);
178}
179
180/// Documentation for an event with an optional primitive argument.
181class Event_events_optionalPrimitiveArgEvent extends Event {
182  void addListener(void callback(int argument)) => super.addListener(callback);
183
184  void removeListener(void callback(int argument)) => super.removeListener(callback);
185
186  bool hasListener(void callback(int argument)) => super.hasListener(callback);
187
188  Event_events_optionalPrimitiveArgEvent(jsObject) : super._(jsObject, 1);
189}
190
191/// Documentation for an event with a non-optional dictionary argument.
192class 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));
197      }
198    }
199    super.addListener(__proxy_callback);
200  }
201
202  void removeListener(void callback(EventsEventArgument argument)) {
203    void __proxy_callback(argument) {
204      if (callback != null) {
205        callback(new EventsEventArgument._proxy(argument));
206      }
207    }
208    super.removeListener(__proxy_callback);
209  }
210
211  bool hasListener(void callback(EventsEventArgument argument)) {
212    void __proxy_callback(argument) {
213      if (callback != null) {
214        callback(new EventsEventArgument._proxy(argument));
215      }
216    }
217    super.hasListener(__proxy_callback);
218  }
219
220  Event_events_nonOptionalDictArgEvent(jsObject) : super._(jsObject, 1);
221}
222
223/// Documentation for an event with a optional dictionary argument.
224class 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));
229      }
230    }
231    super.addListener(__proxy_callback);
232  }
233
234  void removeListener(void callback(EventsEventArgument argument)) {
235    void __proxy_callback(argument) {
236      if (callback != null) {
237        callback(new EventsEventArgument._proxy(argument));
238      }
239    }
240    super.removeListener(__proxy_callback);
241  }
242
243  bool hasListener(void callback(EventsEventArgument argument)) {
244    void __proxy_callback(argument) {
245      if (callback != null) {
246        callback(new EventsEventArgument._proxy(argument));
247      }
248    }
249    super.hasListener(__proxy_callback);
250  }
251
252  Event_events_optionalDictArgEvent(jsObject) : super._(jsObject, 1);
253}
254
255/**
256 * Functions
257 */
258
259class API_events {
260  /*
261   * API connection
262   */
263  Object _jsObject;
264
265  /*
266   * Events
267   */
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));
281  }
282}
283