OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Generated from namespace: app.window | 5 // Generated from namespace: app.window |
6 | 6 |
7 part of chrome; | 7 part of chrome; |
8 | 8 |
9 /** | 9 /** |
10 * Types | 10 * Types |
11 */ | 11 */ |
12 | 12 |
13 class AppWindowBounds extends ChromeObject { | 13 class AppWindowBounds extends ChromeObject { |
14 /* | 14 /* |
15 * Public constructor | 15 * Public constructor |
16 */ | 16 */ |
17 AppWindowBounds({int left, int top, int width, int height}) { | 17 AppWindowBounds({int left, int top, int width, int height}) { |
18 if (left != null) | 18 if (left != null) this.left = left; |
19 this.left = left; | 19 if (top != null) this.top = top; |
20 if (top != null) | 20 if (width != null) this.width = width; |
21 this.top = top; | 21 if (height != null) this.height = height; |
22 if (width != null) | |
23 this.width = width; | |
24 if (height != null) | |
25 this.height = height; | |
26 } | 22 } |
27 | 23 |
28 /* | 24 /* |
29 * Private constructor | 25 * Private constructor |
30 */ | 26 */ |
31 AppWindowBounds._proxy(_jsObject) : super._proxy(_jsObject); | 27 AppWindowBounds._proxy(_jsObject) : super._proxy(_jsObject); |
32 | 28 |
33 /* | 29 /* |
34 * Public accessors | 30 * Public accessors |
35 */ | 31 */ |
(...skipping 13 matching lines...) Expand all Loading... |
49 | 45 |
50 set width(int width) { | 46 set width(int width) { |
51 JS('void', '#.width = #', this._jsObject, width); | 47 JS('void', '#.width = #', this._jsObject, width); |
52 } | 48 } |
53 | 49 |
54 int get height => JS('int', '#.height', this._jsObject); | 50 int get height => JS('int', '#.height', this._jsObject); |
55 | 51 |
56 set height(int height) { | 52 set height(int height) { |
57 JS('void', '#.height = #', this._jsObject, height); | 53 JS('void', '#.height = #', this._jsObject, height); |
58 } | 54 } |
59 | |
60 } | 55 } |
61 | 56 |
62 class AppWindowCreateWindowOptions extends ChromeObject { | 57 class AppWindowCreateWindowOptions extends ChromeObject { |
63 /* | 58 /* |
64 * Public constructor | 59 * Public constructor |
65 */ | 60 */ |
66 AppWindowCreateWindowOptions({String id, int defaultWidth, int defaultHeight,
int defaultLeft, int defaultTop, int width, int height, int left, int top, int m
inWidth, int minHeight, int maxWidth, int maxHeight, String type, String frame,
AppWindowBounds bounds, bool transparentBackground, String state, bool hidden, b
ool resizable, bool singleton}) { | 61 AppWindowCreateWindowOptions( |
67 if (id != null) | 62 {String id, |
68 this.id = id; | 63 int defaultWidth, |
69 if (defaultWidth != null) | 64 int defaultHeight, |
70 this.defaultWidth = defaultWidth; | 65 int defaultLeft, |
71 if (defaultHeight != null) | 66 int defaultTop, |
72 this.defaultHeight = defaultHeight; | 67 int width, |
73 if (defaultLeft != null) | 68 int height, |
74 this.defaultLeft = defaultLeft; | 69 int left, |
75 if (defaultTop != null) | 70 int top, |
76 this.defaultTop = defaultTop; | 71 int minWidth, |
77 if (width != null) | 72 int minHeight, |
78 this.width = width; | 73 int maxWidth, |
79 if (height != null) | 74 int maxHeight, |
80 this.height = height; | 75 String type, |
81 if (left != null) | 76 String frame, |
82 this.left = left; | 77 AppWindowBounds bounds, |
83 if (top != null) | 78 bool transparentBackground, |
84 this.top = top; | 79 String state, |
85 if (minWidth != null) | 80 bool hidden, |
86 this.minWidth = minWidth; | 81 bool resizable, |
87 if (minHeight != null) | 82 bool singleton}) { |
88 this.minHeight = minHeight; | 83 if (id != null) this.id = id; |
89 if (maxWidth != null) | 84 if (defaultWidth != null) this.defaultWidth = defaultWidth; |
90 this.maxWidth = maxWidth; | 85 if (defaultHeight != null) this.defaultHeight = defaultHeight; |
91 if (maxHeight != null) | 86 if (defaultLeft != null) this.defaultLeft = defaultLeft; |
92 this.maxHeight = maxHeight; | 87 if (defaultTop != null) this.defaultTop = defaultTop; |
93 if (type != null) | 88 if (width != null) this.width = width; |
94 this.type = type; | 89 if (height != null) this.height = height; |
95 if (frame != null) | 90 if (left != null) this.left = left; |
96 this.frame = frame; | 91 if (top != null) this.top = top; |
97 if (bounds != null) | 92 if (minWidth != null) this.minWidth = minWidth; |
98 this.bounds = bounds; | 93 if (minHeight != null) this.minHeight = minHeight; |
| 94 if (maxWidth != null) this.maxWidth = maxWidth; |
| 95 if (maxHeight != null) this.maxHeight = maxHeight; |
| 96 if (type != null) this.type = type; |
| 97 if (frame != null) this.frame = frame; |
| 98 if (bounds != null) this.bounds = bounds; |
99 if (transparentBackground != null) | 99 if (transparentBackground != null) |
100 this.transparentBackground = transparentBackground; | 100 this.transparentBackground = transparentBackground; |
101 if (state != null) | 101 if (state != null) this.state = state; |
102 this.state = state; | 102 if (hidden != null) this.hidden = hidden; |
103 if (hidden != null) | 103 if (resizable != null) this.resizable = resizable; |
104 this.hidden = hidden; | 104 if (singleton != null) this.singleton = singleton; |
105 if (resizable != null) | |
106 this.resizable = resizable; | |
107 if (singleton != null) | |
108 this.singleton = singleton; | |
109 } | 105 } |
110 | 106 |
111 /* | 107 /* |
112 * Private constructor | 108 * Private constructor |
113 */ | 109 */ |
114 AppWindowCreateWindowOptions._proxy(_jsObject) : super._proxy(_jsObject); | 110 AppWindowCreateWindowOptions._proxy(_jsObject) : super._proxy(_jsObject); |
115 | 111 |
116 /* | 112 /* |
117 * Public accessors | 113 * Public accessors |
118 */ | 114 */ |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 /// Frame type: 'none' or 'chrome' (defaults to 'chrome'). | 219 /// Frame type: 'none' or 'chrome' (defaults to 'chrome'). |
224 String get frame => JS('String', '#.frame', this._jsObject); | 220 String get frame => JS('String', '#.frame', this._jsObject); |
225 | 221 |
226 set frame(String frame) { | 222 set frame(String frame) { |
227 JS('void', '#.frame = #', this._jsObject, frame); | 223 JS('void', '#.frame = #', this._jsObject, frame); |
228 } | 224 } |
229 | 225 |
230 /// Size and position of the content in the window (excluding the titlebar). I
f | 226 /// Size and position of the content in the window (excluding the titlebar). I
f |
231 /// an id is also specified and a window with a matching id has been shown | 227 /// an id is also specified and a window with a matching id has been shown |
232 /// before, the remembered bounds of the window will be used instead. | 228 /// before, the remembered bounds of the window will be used instead. |
233 AppWindowBounds get bounds => new AppWindowBounds._proxy(JS('', '#.bounds', th
is._jsObject)); | 229 AppWindowBounds get bounds => |
| 230 new AppWindowBounds._proxy(JS('', '#.bounds', this._jsObject)); |
234 | 231 |
235 set bounds(AppWindowBounds bounds) { | 232 set bounds(AppWindowBounds bounds) { |
236 JS('void', '#.bounds = #', this._jsObject, convertArgument(bounds)); | 233 JS('void', '#.bounds = #', this._jsObject, convertArgument(bounds)); |
237 } | 234 } |
238 | 235 |
239 /// Enable window background transparency. Only supported in ash. Requires | 236 /// Enable window background transparency. Only supported in ash. Requires |
240 /// experimental API permission. | 237 /// experimental API permission. |
241 bool get transparentBackground => JS('bool', '#.transparentBackground', this._
jsObject); | 238 bool get transparentBackground => |
| 239 JS('bool', '#.transparentBackground', this._jsObject); |
242 | 240 |
243 set transparentBackground(bool transparentBackground) { | 241 set transparentBackground(bool transparentBackground) { |
244 JS('void', '#.transparentBackground = #', this._jsObject, transparentBackgro
und); | 242 JS('void', '#.transparentBackground = #', this._jsObject, |
| 243 transparentBackground); |
245 } | 244 } |
246 | 245 |
247 /// The initial state of the window, allowing it to be created already | 246 /// The initial state of the window, allowing it to be created already |
248 /// fullscreen, maximized, or minimized. Defaults to 'normal'. | 247 /// fullscreen, maximized, or minimized. Defaults to 'normal'. |
249 String get state => JS('String', '#.state', this._jsObject); | 248 String get state => JS('String', '#.state', this._jsObject); |
250 | 249 |
251 set state(String state) { | 250 set state(String state) { |
252 JS('void', '#.state = #', this._jsObject, state); | 251 JS('void', '#.state = #', this._jsObject, state); |
253 } | 252 } |
254 | 253 |
(...skipping 15 matching lines...) Expand all Loading... |
270 /// By default if you specify an id for the window, the window will only be | 269 /// By default if you specify an id for the window, the window will only be |
271 /// created if another window with the same id doesn't already exist. If a | 270 /// created if another window with the same id doesn't already exist. If a |
272 /// window with the same id already exists that window is activated instead. I
f | 271 /// window with the same id already exists that window is activated instead. I
f |
273 /// you do want to create multiple windows with the same id, you can set this | 272 /// you do want to create multiple windows with the same id, you can set this |
274 /// property to false. | 273 /// property to false. |
275 bool get singleton => JS('bool', '#.singleton', this._jsObject); | 274 bool get singleton => JS('bool', '#.singleton', this._jsObject); |
276 | 275 |
277 set singleton(bool singleton) { | 276 set singleton(bool singleton) { |
278 JS('void', '#.singleton = #', this._jsObject, singleton); | 277 JS('void', '#.singleton = #', this._jsObject, singleton); |
279 } | 278 } |
280 | |
281 } | 279 } |
282 | 280 |
283 class AppWindowAppWindow extends ChromeObject { | 281 class AppWindowAppWindow extends ChromeObject { |
284 /* | 282 /* |
285 * Private constructor | 283 * Private constructor |
286 */ | 284 */ |
287 AppWindowAppWindow._proxy(_jsObject) : super._proxy(_jsObject); | 285 AppWindowAppWindow._proxy(_jsObject) : super._proxy(_jsObject); |
288 | 286 |
289 /* | 287 /* |
290 * Public accessors | 288 * Public accessors |
291 */ | 289 */ |
292 /// The JavaScript 'window' object for the created child. | 290 /// The JavaScript 'window' object for the created child. |
293 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 291 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
294 // for details. All rights reserved. Use of this source code is governed by a | 292 // for details. All rights reserved. Use of this source code is governed by a |
295 // BSD-style license that can be found in the LICENSE file. | 293 // BSD-style license that can be found in the LICENSE file. |
296 | 294 |
297 // TODO(sashab, sra): Detect whether this is the current window, or an | 295 // TODO(sashab, sra): Detect whether this is the current window, or an |
298 // external one, and return an appropriately-typed object | 296 // external one, and return an appropriately-typed object |
299 WindowBase get contentWindow => | 297 WindowBase get contentWindow => |
300 JS("Window", "#.contentWindow", this._jsObject); | 298 JS("Window", "#.contentWindow", this._jsObject); |
301 | 299 |
302 /* | 300 /* |
303 * Methods | 301 * Methods |
304 */ | 302 */ |
305 /// Focus the window. | 303 /// Focus the window. |
306 void focus() => JS('void', '#.focus()', this._jsObject); | 304 void focus() => JS('void', '#.focus()', this._jsObject); |
307 | 305 |
308 /// Fullscreens the window. | 306 /// Fullscreens the window. |
309 void fullscreen() => JS('void', '#.fullscreen()', this._jsObject); | 307 void fullscreen() => JS('void', '#.fullscreen()', this._jsObject); |
310 | 308 |
311 /// Is the window fullscreen? | 309 /// Is the window fullscreen? |
312 bool isFullscreen() => JS('bool', '#.isFullscreen()', this._jsObject); | 310 bool isFullscreen() => JS('bool', '#.isFullscreen()', this._jsObject); |
313 | 311 |
314 /// Minimize the window. | 312 /// Minimize the window. |
315 void minimize() => JS('void', '#.minimize()', this._jsObject); | 313 void minimize() => JS('void', '#.minimize()', this._jsObject); |
316 | 314 |
317 /// Is the window minimized? | 315 /// Is the window minimized? |
318 bool isMinimized() => JS('bool', '#.isMinimized()', this._jsObject); | 316 bool isMinimized() => JS('bool', '#.isMinimized()', this._jsObject); |
319 | 317 |
320 /// Maximize the window. | 318 /// Maximize the window. |
321 void maximize() => JS('void', '#.maximize()', this._jsObject); | 319 void maximize() => JS('void', '#.maximize()', this._jsObject); |
322 | 320 |
323 /// Is the window maximized? | 321 /// Is the window maximized? |
324 bool isMaximized() => JS('bool', '#.isMaximized()', this._jsObject); | 322 bool isMaximized() => JS('bool', '#.isMaximized()', this._jsObject); |
325 | 323 |
326 /// Restore the window, exiting a maximized, minimized, or fullscreen state. | 324 /// Restore the window, exiting a maximized, minimized, or fullscreen state. |
327 void restore() => JS('void', '#.restore()', this._jsObject); | 325 void restore() => JS('void', '#.restore()', this._jsObject); |
328 | 326 |
329 /// Move the window to the position (|left|, |top|). | 327 /// Move the window to the position (|left|, |top|). |
330 void moveTo(int left, int top) => JS('void', '#.moveTo(#, #)', this._jsObject,
left, top); | 328 void moveTo(int left, int top) => |
| 329 JS('void', '#.moveTo(#, #)', this._jsObject, left, top); |
331 | 330 |
332 /// Resize the window to |width|x|height| pixels in size. | 331 /// Resize the window to |width|x|height| pixels in size. |
333 void resizeTo(int width, int height) => JS('void', '#.resizeTo(#, #)', this._j
sObject, width, height); | 332 void resizeTo(int width, int height) => |
| 333 JS('void', '#.resizeTo(#, #)', this._jsObject, width, height); |
334 | 334 |
335 /// Draw attention to the window. | 335 /// Draw attention to the window. |
336 void drawAttention() => JS('void', '#.drawAttention()', this._jsObject); | 336 void drawAttention() => JS('void', '#.drawAttention()', this._jsObject); |
337 | 337 |
338 /// Clear attention to the window. | 338 /// Clear attention to the window. |
339 void clearAttention() => JS('void', '#.clearAttention()', this._jsObject); | 339 void clearAttention() => JS('void', '#.clearAttention()', this._jsObject); |
340 | 340 |
341 /// Close the window. | 341 /// Close the window. |
342 void close() => JS('void', '#.close()', this._jsObject); | 342 void close() => JS('void', '#.close()', this._jsObject); |
343 | 343 |
344 /// Show the window. Does nothing if the window is already visible. | 344 /// Show the window. Does nothing if the window is already visible. |
345 void show() => JS('void', '#.show()', this._jsObject); | 345 void show() => JS('void', '#.show()', this._jsObject); |
346 | 346 |
347 /// Hide the window. Does nothing if the window is already hidden. | 347 /// Hide the window. Does nothing if the window is already hidden. |
348 void hide() => JS('void', '#.hide()', this._jsObject); | 348 void hide() => JS('void', '#.hide()', this._jsObject); |
349 | 349 |
350 /// Get the window's bounds as a $ref:Bounds object. | 350 /// Get the window's bounds as a $ref:Bounds object. |
351 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 351 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
352 // for details. All rights reserved. Use of this source code is governed by a | 352 // for details. All rights reserved. Use of this source code is governed by a |
353 // BSD-style license that can be found in the LICENSE file. | 353 // BSD-style license that can be found in the LICENSE file. |
354 | 354 |
355 // TODO(sashab, kalman): Fix IDL parser to read function return values | 355 // TODO(sashab, kalman): Fix IDL parser to read function return values |
356 // correctly. Currently, it just reads void for all functions. | 356 // correctly. Currently, it just reads void for all functions. |
357 AppWindowBounds getBounds() => | 357 AppWindowBounds getBounds() => |
358 new AppWindowBounds._proxy(JS('void', '#.getBounds()', this._jsObject)); | 358 new AppWindowBounds._proxy(JS('void', '#.getBounds()', this._jsObject)); |
359 | 359 |
360 /// Set the window's bounds. | 360 /// Set the window's bounds. |
361 void setBounds(AppWindowBounds bounds) => JS('void', '#.setBounds(#)', this._j
sObject, convertArgument(bounds)); | 361 void setBounds(AppWindowBounds bounds) => |
| 362 JS('void', '#.setBounds(#)', this._jsObject, convertArgument(bounds)); |
362 | 363 |
363 /// Set the app icon for the window (experimental). Currently this is only | 364 /// Set the app icon for the window (experimental). Currently this is only |
364 /// being implemented on Ash. TODO(stevenjb): Investigate implementing this on | 365 /// being implemented on Ash. TODO(stevenjb): Investigate implementing this on |
365 /// Windows and OSX. | 366 /// Windows and OSX. |
366 void setIcon(String icon_url) => JS('void', '#.setIcon(#)', this._jsObject, ic
on_url); | 367 void setIcon(String icon_url) => |
367 | 368 JS('void', '#.setIcon(#)', this._jsObject, icon_url); |
368 } | 369 } |
369 | 370 |
370 /** | 371 /** |
371 * Events | 372 * Events |
372 */ | 373 */ |
373 | 374 |
374 /// Fired when the window is resized. | 375 /// Fired when the window is resized. |
375 class Event_app_window_onBoundsChanged extends Event { | 376 class Event_app_window_onBoundsChanged extends Event { |
376 void addListener(void callback()) => super.addListener(callback); | 377 void addListener(void callback()) => super.addListener(callback); |
377 | 378 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 /// position is then used instead of the specified bounds on subsequent openin
g | 474 /// position is then used instead of the specified bounds on subsequent openin
g |
474 /// of a window with the same id. If you need to open a window with an id at a | 475 /// of a window with the same id. If you need to open a window with an id at a |
475 /// location other than the remembered default, you can create it hidden, move | 476 /// location other than the remembered default, you can create it hidden, move |
476 /// it to the desired location, then show it. | 477 /// it to the desired location, then show it. |
477 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 478 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
478 // for details. All rights reserved. Use of this source code is governed by a | 479 // for details. All rights reserved. Use of this source code is governed by a |
479 // BSD-style license that can be found in the LICENSE file. | 480 // BSD-style license that can be found in the LICENSE file. |
480 | 481 |
481 // TODO(sashab): This override is no longer needed once prefixes are removed. | 482 // TODO(sashab): This override is no longer needed once prefixes are removed. |
482 void create(String url, | 483 void create(String url, |
483 [AppWindowCreateWindowOptions options, | 484 [AppWindowCreateWindowOptions options, |
484 void callback(AppWindowAppWindow created_window)]) { | 485 void callback(AppWindowAppWindow created_window)]) { |
485 void __proxy_callback(created_window) { | 486 void __proxy_callback(created_window) { |
486 if (callback != null) | 487 if (callback != null) |
487 callback(new AppWindowAppWindow._proxy(created_window)); | 488 callback(new AppWindowAppWindow._proxy(created_window)); |
488 } | 489 } |
489 JS('void', '#.create(#, #, #)', this._jsObject, url, convertArgument(options
), | 490 |
490 convertDartClosureToJS(__proxy_callback, 1)); | 491 JS('void', '#.create(#, #, #)', this._jsObject, url, |
| 492 convertArgument(options), convertDartClosureToJS(__proxy_callback, 1)); |
491 } | 493 } |
492 | 494 |
493 /// Returns an $ref:AppWindow object for the current script context (ie | 495 /// Returns an $ref:AppWindow object for the current script context (ie |
494 /// JavaScript 'window' object). This can also be called on a handle to a | 496 /// JavaScript 'window' object). This can also be called on a handle to a |
495 /// script context for another page, for example: | 497 /// script context for another page, for example: |
496 /// otherWindow.chrome.app.window.current(). | 498 /// otherWindow.chrome.app.window.current(). |
497 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 499 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
498 // for details. All rights reserved. Use of this source code is governed by a | 500 // for details. All rights reserved. Use of this source code is governed by a |
499 // BSD-style license that can be found in the LICENSE file. | 501 // BSD-style license that can be found in the LICENSE file. |
500 | 502 |
501 // TODO(sashab, kalman): Fix IDL parser to read function return values | 503 // TODO(sashab, kalman): Fix IDL parser to read function return values |
502 // correctly. Currently, it just reads void for all functions. | 504 // correctly. Currently, it just reads void for all functions. |
503 AppWindowAppWindow current() => | 505 AppWindowAppWindow current() => |
504 new AppWindowAppWindow._proxy(JS('void', '#.current()', this._jsObject)); | 506 new AppWindowAppWindow._proxy(JS('void', '#.current()', this._jsObject)); |
505 | 507 |
506 void initializeAppWindow(Object state) => JS('void', '#.initializeAppWindow(#)
', this._jsObject, convertArgument(state)); | 508 void initializeAppWindow(Object state) => JS('void', |
| 509 '#.initializeAppWindow(#)', this._jsObject, convertArgument(state)); |
507 | 510 |
508 API_app_window(this._jsObject) { | 511 API_app_window(this._jsObject) { |
509 onBoundsChanged = new Event_app_window_onBoundsChanged(JS('', '#.onBoundsCha
nged', this._jsObject)); | 512 onBoundsChanged = new Event_app_window_onBoundsChanged( |
510 onClosed = new Event_app_window_onClosed(JS('', '#.onClosed', this._jsObject
)); | 513 JS('', '#.onBoundsChanged', this._jsObject)); |
511 onFullscreened = new Event_app_window_onFullscreened(JS('', '#.onFullscreene
d', this._jsObject)); | 514 onClosed = |
512 onMaximized = new Event_app_window_onMaximized(JS('', '#.onMaximized', this.
_jsObject)); | 515 new Event_app_window_onClosed(JS('', '#.onClosed', this._jsObject)); |
513 onMinimized = new Event_app_window_onMinimized(JS('', '#.onMinimized', this.
_jsObject)); | 516 onFullscreened = new Event_app_window_onFullscreened( |
514 onRestored = new Event_app_window_onRestored(JS('', '#.onRestored', this._js
Object)); | 517 JS('', '#.onFullscreened', this._jsObject)); |
| 518 onMaximized = new Event_app_window_onMaximized( |
| 519 JS('', '#.onMaximized', this._jsObject)); |
| 520 onMinimized = new Event_app_window_onMinimized( |
| 521 JS('', '#.onMinimized', this._jsObject)); |
| 522 onRestored = |
| 523 new Event_app_window_onRestored(JS('', '#.onRestored', this._jsObject)); |
515 } | 524 } |
516 } | 525 } |
OLD | NEW |