| OLD | NEW |
| 1 library chrome; | 1 library chrome; |
| 2 | 2 |
| 3 import 'dart:_foreign_helper' show JS; | 3 import 'dart:_foreign_helper' show JS; |
| 4 import 'dart:_js_helper'; | 4 import 'dart:_js_helper'; |
| 5 import 'dart:html_common'; | 5 import 'dart:html_common'; |
| 6 import 'dart:html'; | 6 import 'dart:html'; |
| 7 | 7 |
| 8 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 8 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 9 // for details. All rights reserved. Use of this source code is governed by a | 9 // for details. All rights reserved. Use of this source code is governed by a |
| 10 // BSD-style license that can be found in the LICENSE file. | 10 // BSD-style license that can be found in the LICENSE file. |
| 11 | 11 |
| 12 // DO NOT EDIT - unless you are editing documentation as per: | 12 // DO NOT EDIT |
| 13 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation | |
| 14 // Auto-generated dart:chrome library. | 13 // Auto-generated dart:chrome library. |
| 15 | 14 |
| 16 /// Native wrappers for the Chrome Packaged App APIs. | 15 /// Native wrappers for the Chrome Packaged App APIs. |
| 17 /// | 16 /// |
| 18 /// These functions allow direct access to the Packaged App APIs, allowing | 17 /// These functions allow direct access to the Packaged App APIs, allowing |
| 19 /// Chrome Packaged Apps to be written using Dart. | 18 /// Chrome Packaged Apps to be written using Dart. |
| 20 /// | 19 /// |
| 21 /// For more information on these APIs, see the Chrome.* APIs Documentation: | 20 /// For more information on these APIs, see the Chrome.* APIs Documentation: |
| 22 /// http://developer.chrome.com/extensions/api_index.html | 21 /// http://developer.chrome.com/extensions/api_index.html |
| 23 | 22 |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 app = new API_ChromeApp(app_object); | 378 app = new API_ChromeApp(app_object); |
| 380 } | 379 } |
| 381 } | 380 } |
| 382 | 381 |
| 383 // The final chrome objects | 382 // The final chrome objects |
| 384 final API_Chrome chrome = new API_Chrome(); | 383 final API_Chrome chrome = new API_Chrome(); |
| 385 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 384 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 386 // for details. All rights reserved. Use of this source code is governed by a | 385 // for details. All rights reserved. Use of this source code is governed by a |
| 387 // BSD-style license that can be found in the LICENSE file. | 386 // BSD-style license that can be found in the LICENSE file. |
| 388 | 387 |
| 388 // Generated from namespace: alarms |
| 389 |
| 390 |
| 391 /** |
| 392 * Types |
| 393 */ |
| 394 |
| 395 class AlarmsAlarm extends ChromeObject { |
| 396 /* |
| 397 * Public constructor |
| 398 */ |
| 399 AlarmsAlarm({String name, double scheduledTime, double periodInMinutes}) { |
| 400 if (?name) |
| 401 this.name = name; |
| 402 if (?scheduledTime) |
| 403 this.scheduledTime = scheduledTime; |
| 404 if (?periodInMinutes) |
| 405 this.periodInMinutes = periodInMinutes; |
| 406 } |
| 407 |
| 408 /* |
| 409 * Private constructor |
| 410 */ |
| 411 AlarmsAlarm._proxy(_jsObject) : super._proxy(_jsObject); |
| 412 |
| 413 /* |
| 414 * Public accessors |
| 415 */ |
| 416 /// Name of this alarm. |
| 417 String get name => JS('String', '#.name', this._jsObject); |
| 418 |
| 419 void set name(String name) { |
| 420 JS('void', '#.name = #', this._jsObject, name); |
| 421 } |
| 422 |
| 423 /// Time at which this alarm was scheduled to fire, in milliseconds past the |
| 424 /// epoch (e.g. <code>Date.now() + n</code>). For performance reasons, the |
| 425 /// alarm may have been delayed an arbitrary amount beyond this. |
| 426 double get scheduledTime => JS('double', '#.scheduledTime', this._jsObject); |
| 427 |
| 428 void set scheduledTime(double scheduledTime) { |
| 429 JS('void', '#.scheduledTime = #', this._jsObject, scheduledTime); |
| 430 } |
| 431 |
| 432 /// If not null, the alarm is a repeating alarm and will fire again in |
| 433 /// <var>periodInMinutes</var> minutes. |
| 434 double get periodInMinutes => JS('double', '#.periodInMinutes', this._jsObject
); |
| 435 |
| 436 void set periodInMinutes(double periodInMinutes) { |
| 437 JS('void', '#.periodInMinutes = #', this._jsObject, periodInMinutes); |
| 438 } |
| 439 |
| 440 } |
| 441 |
| 442 class AlarmsAlarmCreateInfo extends ChromeObject { |
| 443 /* |
| 444 * Public constructor |
| 445 */ |
| 446 AlarmsAlarmCreateInfo({double when, double delayInMinutes, double periodInMinu
tes}) { |
| 447 if (?when) |
| 448 this.when = when; |
| 449 if (?delayInMinutes) |
| 450 this.delayInMinutes = delayInMinutes; |
| 451 if (?periodInMinutes) |
| 452 this.periodInMinutes = periodInMinutes; |
| 453 } |
| 454 |
| 455 /* |
| 456 * Private constructor |
| 457 */ |
| 458 AlarmsAlarmCreateInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 459 |
| 460 /* |
| 461 * Public accessors |
| 462 */ |
| 463 /// Time at which the alarm should fire, in milliseconds past the epoch (e.g. |
| 464 /// <code>Date.now() + n</code>). |
| 465 double get when => JS('double', '#.when', this._jsObject); |
| 466 |
| 467 void set when(double when) { |
| 468 JS('void', '#.when = #', this._jsObject, when); |
| 469 } |
| 470 |
| 471 /// Length of time in minutes after which the <code>onAlarm</code> event shoul
d |
| 472 /// fire.<br/><br/> <!-- TODO: need minimum=0 --> |
| 473 double get delayInMinutes => JS('double', '#.delayInMinutes', this._jsObject); |
| 474 |
| 475 void set delayInMinutes(double delayInMinutes) { |
| 476 JS('void', '#.delayInMinutes = #', this._jsObject, delayInMinutes); |
| 477 } |
| 478 |
| 479 /// If set, the onAlarm event should fire every <var>periodInMinutes</var> |
| 480 /// minutes after the initial event specified by <var>when</var> or |
| 481 /// <var>delayInMinutes</var>. If not set, the alarm will only fire |
| 482 /// once.<br/><br/> <!-- TODO: need minimum=0 --> |
| 483 double get periodInMinutes => JS('double', '#.periodInMinutes', this._jsObject
); |
| 484 |
| 485 void set periodInMinutes(double periodInMinutes) { |
| 486 JS('void', '#.periodInMinutes = #', this._jsObject, periodInMinutes); |
| 487 } |
| 488 |
| 489 } |
| 490 |
| 491 /** |
| 492 * Events |
| 493 */ |
| 494 |
| 495 /// Fired when an alarm has elapsed. Useful for event pages. |
| 496 class Event_alarms_onAlarm extends Event { |
| 497 void addListener(void callback(AlarmsAlarm alarm)) { |
| 498 void __proxy_callback(alarm) { |
| 499 if (?callback) { |
| 500 callback(new AlarmsAlarm._proxy(alarm)); |
| 501 } |
| 502 } |
| 503 super.addListener(callback); |
| 504 } |
| 505 |
| 506 void removeListener(void callback(AlarmsAlarm alarm)) { |
| 507 void __proxy_callback(alarm) { |
| 508 if (?callback) { |
| 509 callback(new AlarmsAlarm._proxy(alarm)); |
| 510 } |
| 511 } |
| 512 super.removeListener(callback); |
| 513 } |
| 514 |
| 515 bool hasListener(void callback(AlarmsAlarm alarm)) { |
| 516 void __proxy_callback(alarm) { |
| 517 if (?callback) { |
| 518 callback(new AlarmsAlarm._proxy(alarm)); |
| 519 } |
| 520 } |
| 521 super.hasListener(callback); |
| 522 } |
| 523 |
| 524 Event_alarms_onAlarm(jsObject) : super._(jsObject, 1); |
| 525 } |
| 526 |
| 527 /** |
| 528 * Functions |
| 529 */ |
| 530 |
| 531 class API_alarms { |
| 532 /* |
| 533 * API connection |
| 534 */ |
| 535 Object _jsObject; |
| 536 |
| 537 /* |
| 538 * Events |
| 539 */ |
| 540 Event_alarms_onAlarm onAlarm; |
| 541 |
| 542 /* |
| 543 * Functions |
| 544 */ |
| 545 /// Creates an alarm. Near the time(s) specified by <var>alarmInfo</var>, the |
| 546 /// <code>onAlarm</code> event is fired. If there is another alarm with the |
| 547 /// same name (or no name if none is specified), it will be cancelled and |
| 548 /// replaced by this alarm.<br/><br/> In order to reduce the load on the user'
s |
| 549 /// machine, Chrome limits alarms to at most once every 1 minute but may delay |
| 550 /// them an arbitrary amount more. That is, setting |
| 551 /// <code>$ref:[alarms.AlarmCreateInfo.delayInMinutes delayInMinutes]</code> o
r |
| 552 /// <code>$ref:[alarms.AlarmCreateInfo.periodInMinutes periodInMinutes]</code> |
| 553 /// to less than <code>1</code> will not be honored and will cause a warning. |
| 554 /// <code>$ref:[alarms.AlarmCreateInfo.when when]</code> can be set to less |
| 555 /// than 1 minute after "now" without warning but won't actually cause the |
| 556 /// alarm to fire for at least 1 minute.<br/><br/> To help you debug your app |
| 557 /// or extension, when you've loaded it unpacked, there's no limit to how ofte
n |
| 558 /// the alarm can fire. |
| 559 void create(AlarmsAlarmCreateInfo alarmInfo, [String name]) => JS('void', '#.c
reate(#, #)', this._jsObject, name, convertArgument(alarmInfo)); |
| 560 |
| 561 /// Retrieves details about the specified alarm. |
| 562 void get(void callback(AlarmsAlarm alarm), [String name]) { |
| 563 void __proxy_callback(alarm) { |
| 564 if (?callback) { |
| 565 callback(new AlarmsAlarm._proxy(alarm)); |
| 566 } |
| 567 } |
| 568 JS('void', '#.get(#, #)', this._jsObject, name, convertDartClosureToJS(__pro
xy_callback, 1)); |
| 569 } |
| 570 |
| 571 /// Gets an array of all the alarms. |
| 572 void getAll(void callback(List<AlarmsAlarm> alarms)) { |
| 573 void __proxy_callback(alarms) { |
| 574 if (?callback) { |
| 575 List<AlarmsAlarm> __proxy_alarms = new List<AlarmsAlarm>(); |
| 576 for (var o in alarms) { |
| 577 __proxy_alarms.add(new AlarmsAlarm._proxy(o)); |
| 578 } |
| 579 callback(__proxy_alarms); |
| 580 } |
| 581 } |
| 582 JS('void', '#.getAll(#)', this._jsObject, convertDartClosureToJS(__proxy_cal
lback, 1)); |
| 583 } |
| 584 |
| 585 /// Clears the alarm with the given name. |
| 586 void clear([String name]) => JS('void', '#.clear(#)', this._jsObject, name); |
| 587 |
| 588 /// Clears all alarms. |
| 589 void clearAll() => JS('void', '#.clearAll()', this._jsObject); |
| 590 |
| 591 API_alarms(this._jsObject) { |
| 592 onAlarm = new Event_alarms_onAlarm(JS('', '#.onAlarm', this._jsObject)); |
| 593 } |
| 594 } |
| 595 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 596 // for details. All rights reserved. Use of this source code is governed by a |
| 597 // BSD-style license that can be found in the LICENSE file. |
| 598 |
| 389 // Generated from namespace: app.window | 599 // Generated from namespace: app.window |
| 390 | 600 |
| 391 | 601 |
| 392 /** | 602 /** |
| 393 * Types | 603 * Types |
| 394 */ | 604 */ |
| 395 | 605 |
| 606 class AppWindowBounds extends ChromeObject { |
| 607 /* |
| 608 * Public constructor |
| 609 */ |
| 610 AppWindowBounds({int left, int top, int width, int height}) { |
| 611 if (?left) |
| 612 this.left = left; |
| 613 if (?top) |
| 614 this.top = top; |
| 615 if (?width) |
| 616 this.width = width; |
| 617 if (?height) |
| 618 this.height = height; |
| 619 } |
| 620 |
| 621 /* |
| 622 * Private constructor |
| 623 */ |
| 624 AppWindowBounds._proxy(_jsObject) : super._proxy(_jsObject); |
| 625 |
| 626 /* |
| 627 * Public accessors |
| 628 */ |
| 629 int get left => JS('int', '#.left', this._jsObject); |
| 630 |
| 631 void set left(int left) { |
| 632 JS('void', '#.left = #', this._jsObject, left); |
| 633 } |
| 634 |
| 635 int get top => JS('int', '#.top', this._jsObject); |
| 636 |
| 637 void set top(int top) { |
| 638 JS('void', '#.top = #', this._jsObject, top); |
| 639 } |
| 640 |
| 641 int get width => JS('int', '#.width', this._jsObject); |
| 642 |
| 643 void set width(int width) { |
| 644 JS('void', '#.width = #', this._jsObject, width); |
| 645 } |
| 646 |
| 647 int get height => JS('int', '#.height', this._jsObject); |
| 648 |
| 649 void set height(int height) { |
| 650 JS('void', '#.height = #', this._jsObject, height); |
| 651 } |
| 652 |
| 653 } |
| 654 |
| 396 class AppWindowCreateWindowOptions extends ChromeObject { | 655 class AppWindowCreateWindowOptions extends ChromeObject { |
| 397 /* | 656 /* |
| 398 * Public constructor | 657 * Public constructor |
| 399 */ | 658 */ |
| 400 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, bool hidden, bool singleton}
) { | 659 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, bool hidden, bool singleton}
) { |
| 401 if (?id) | 660 if (?id) |
| 402 this.id = id; | 661 this.id = id; |
| 403 if (?defaultWidth) | 662 if (?defaultWidth) |
| 404 this.defaultWidth = defaultWidth; | 663 this.defaultWidth = defaultWidth; |
| 405 if (?defaultHeight) | 664 if (?defaultHeight) |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 /// you do want to create multiple windows with the same id, you can set this | 848 /// you do want to create multiple windows with the same id, you can set this |
| 590 /// property to false. | 849 /// property to false. |
| 591 bool get singleton => JS('bool', '#.singleton', this._jsObject); | 850 bool get singleton => JS('bool', '#.singleton', this._jsObject); |
| 592 | 851 |
| 593 void set singleton(bool singleton) { | 852 void set singleton(bool singleton) { |
| 594 JS('void', '#.singleton = #', this._jsObject, singleton); | 853 JS('void', '#.singleton = #', this._jsObject, singleton); |
| 595 } | 854 } |
| 596 | 855 |
| 597 } | 856 } |
| 598 | 857 |
| 599 class AppWindowBounds extends ChromeObject { | |
| 600 /* | |
| 601 * Public constructor | |
| 602 */ | |
| 603 AppWindowBounds({int left, int top, int width, int height}) { | |
| 604 if (?left) | |
| 605 this.left = left; | |
| 606 if (?top) | |
| 607 this.top = top; | |
| 608 if (?width) | |
| 609 this.width = width; | |
| 610 if (?height) | |
| 611 this.height = height; | |
| 612 } | |
| 613 | |
| 614 /* | |
| 615 * Private constructor | |
| 616 */ | |
| 617 AppWindowBounds._proxy(_jsObject) : super._proxy(_jsObject); | |
| 618 | |
| 619 /* | |
| 620 * Public accessors | |
| 621 */ | |
| 622 int get left => JS('int', '#.left', this._jsObject); | |
| 623 | |
| 624 void set left(int left) { | |
| 625 JS('void', '#.left = #', this._jsObject, left); | |
| 626 } | |
| 627 | |
| 628 int get top => JS('int', '#.top', this._jsObject); | |
| 629 | |
| 630 void set top(int top) { | |
| 631 JS('void', '#.top = #', this._jsObject, top); | |
| 632 } | |
| 633 | |
| 634 int get width => JS('int', '#.width', this._jsObject); | |
| 635 | |
| 636 void set width(int width) { | |
| 637 JS('void', '#.width = #', this._jsObject, width); | |
| 638 } | |
| 639 | |
| 640 int get height => JS('int', '#.height', this._jsObject); | |
| 641 | |
| 642 void set height(int height) { | |
| 643 JS('void', '#.height = #', this._jsObject, height); | |
| 644 } | |
| 645 | |
| 646 } | |
| 647 | |
| 648 class AppWindowAppWindow extends ChromeObject { | 858 class AppWindowAppWindow extends ChromeObject { |
| 649 /* | 859 /* |
| 650 * Private constructor | 860 * Private constructor |
| 651 */ | 861 */ |
| 652 AppWindowAppWindow._proxy(_jsObject) : super._proxy(_jsObject); | 862 AppWindowAppWindow._proxy(_jsObject) : super._proxy(_jsObject); |
| 653 | 863 |
| 654 /* | 864 /* |
| 655 * Public accessors | 865 * Public accessors |
| 656 */ | 866 */ |
| 657 /// The JavaScript 'window' object for the created child. | 867 /// The JavaScript 'window' object for the created child. |
| 658 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 868 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 659 // for details. All rights reserved. Use of this source code is governed by a | 869 // for details. All rights reserved. Use of this source code is governed by a |
| 660 // BSD-style license that can be found in the LICENSE file. | 870 // BSD-style license that can be found in the LICENSE file. |
| 661 | 871 |
| 662 // TODO(sashab, sra): Detect whether this is the current window, or an | 872 // TODO(sashab, sra): Detect whether this is the current window, or an |
| 663 // external one, and return an appropriately-typed object | 873 // external one, and return an appropriately-typed object |
| 664 WindowBase get contentWindow => | 874 WindowBase get contentWindow => |
| 665 JS("Window", "#.contentWindow", this._jsObject); | 875 JS("Window", "#.contentWindow", this._jsObject); |
| 666 | 876 |
| 667 /* | 877 /* |
| 668 * Methods | 878 * Methods |
| 669 */ | 879 */ |
| 670 /// Focus the window. | 880 /// Focus the window. |
| 671 void focus() => JS('void', '#.focus()', this._jsObject); | 881 void focus() => JS('void', '#.focus()', this._jsObject); |
| 672 | 882 |
| 673 /// Minimize the window. | 883 /// Minimize the window. |
| 674 void minimize() => JS('void', '#.minimize()', this._jsObject); | 884 void minimize() => JS('void', '#.minimize()', this._jsObject); |
| 675 | 885 |
| 676 /// Is the window minimized? | 886 /// Is the window minimized? |
| 677 void isMinimized() => JS('void', '#.isMinimized()', this._jsObject); | 887 bool isMinimized() => JS('bool', '#.isMinimized()', this._jsObject); |
| 678 | 888 |
| 679 /// Maximize the window. | 889 /// Maximize the window. |
| 680 void maximize() => JS('void', '#.maximize()', this._jsObject); | 890 void maximize() => JS('void', '#.maximize()', this._jsObject); |
| 681 | 891 |
| 682 /// Is the window maximized? | 892 /// Is the window maximized? |
| 683 void isMaximized() => JS('void', '#.isMaximized()', this._jsObject); | 893 bool isMaximized() => new bool._proxy(JS('', '#.isMaximized()', this._jsObject
)); |
| 684 | 894 |
| 685 /// Restore the window. | 895 /// Restore the window. |
| 686 void restore() => JS('void', '#.restore()', this._jsObject); | 896 void restore() => JS('void', '#.restore()', this._jsObject); |
| 687 | 897 |
| 688 /// Move the window to the position (|left|, |top|). | 898 /// Move the window to the position (|left|, |top|). |
| 689 void moveTo(int left, int top) => JS('void', '#.moveTo(#, #)', this._jsObject,
left, top); | 899 void moveTo(int left, int top) => JS('void', '#.moveTo(#, #)', this._jsObject,
left, top); |
| 690 | 900 |
| 691 /// Resize the window to |width|x|height| pixels in size. | 901 /// Resize the window to |width|x|height| pixels in size. |
| 692 void resizeTo(int width, int height) => JS('void', '#.resizeTo(#, #)', this._j
sObject, width, height); | 902 void resizeTo(int width, int height) => JS('void', '#.resizeTo(#, #)', this._j
sObject, width, height); |
| 693 | 903 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 // for details. All rights reserved. Use of this source code is governed by a | 1079 // for details. All rights reserved. Use of this source code is governed by a |
| 870 // BSD-style license that can be found in the LICENSE file. | 1080 // BSD-style license that can be found in the LICENSE file. |
| 871 | 1081 |
| 872 // Generated from namespace: app.runtime | 1082 // Generated from namespace: app.runtime |
| 873 | 1083 |
| 874 | 1084 |
| 875 /** | 1085 /** |
| 876 * Types | 1086 * Types |
| 877 */ | 1087 */ |
| 878 | 1088 |
| 879 class AppRuntimeIntent extends ChromeObject { | |
| 880 /* | |
| 881 * Private constructor | |
| 882 */ | |
| 883 AppRuntimeIntent._proxy(_jsObject) : super._proxy(_jsObject); | |
| 884 | |
| 885 /* | |
| 886 * Public accessors | |
| 887 */ | |
| 888 /// The WebIntent being invoked. | |
| 889 String get action => JS('String', '#.action', this._jsObject); | |
| 890 | |
| 891 void set action(String action) { | |
| 892 JS('void', '#.action = #', this._jsObject, action); | |
| 893 } | |
| 894 | |
| 895 /// The MIME type of the data. | |
| 896 String get type => JS('String', '#.type', this._jsObject); | |
| 897 | |
| 898 void set type(String type) { | |
| 899 JS('void', '#.type = #', this._jsObject, type); | |
| 900 } | |
| 901 | |
| 902 /// Data associated with the intent. | |
| 903 Object get data => JS('Object', '#.data', this._jsObject); | |
| 904 | |
| 905 void set data(Object data) { | |
| 906 JS('void', '#.data = #', this._jsObject, convertArgument(data)); | |
| 907 } | |
| 908 | |
| 909 | |
| 910 /* | |
| 911 * Methods | |
| 912 */ | |
| 913 /// Callback to be compatible with WebIntents. | |
| 914 void postResult() => JS('void', '#.postResult()', this._jsObject); | |
| 915 | |
| 916 /// Callback to be compatible with WebIntents. | |
| 917 void postFailure() => JS('void', '#.postFailure()', this._jsObject); | |
| 918 | |
| 919 } | |
| 920 | |
| 921 class AppRuntimeLaunchItem extends ChromeObject { | 1089 class AppRuntimeLaunchItem extends ChromeObject { |
| 922 /* | 1090 /* |
| 923 * Public constructor | 1091 * Public constructor |
| 924 */ | 1092 */ |
| 925 AppRuntimeLaunchItem({FileEntry entry, String type}) { | 1093 AppRuntimeLaunchItem({FileEntry entry, String type}) { |
| 926 if (?entry) | 1094 if (?entry) |
| 927 this.entry = entry; | 1095 this.entry = entry; |
| 928 if (?type) | 1096 if (?type) |
| 929 this.type = type; | 1097 this.type = type; |
| 930 } | 1098 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 950 void set type(String type) { | 1118 void set type(String type) { |
| 951 JS('void', '#.type = #', this._jsObject, type); | 1119 JS('void', '#.type = #', this._jsObject, type); |
| 952 } | 1120 } |
| 953 | 1121 |
| 954 } | 1122 } |
| 955 | 1123 |
| 956 class AppRuntimeLaunchData extends ChromeObject { | 1124 class AppRuntimeLaunchData extends ChromeObject { |
| 957 /* | 1125 /* |
| 958 * Public constructor | 1126 * Public constructor |
| 959 */ | 1127 */ |
| 960 AppRuntimeLaunchData({AppRuntimeIntent intent, String id, List<AppRuntimeLaunc
hItem> items}) { | 1128 AppRuntimeLaunchData({String id, List<AppRuntimeLaunchItem> items}) { |
| 961 if (?intent) | |
| 962 this.intent = intent; | |
| 963 if (?id) | 1129 if (?id) |
| 964 this.id = id; | 1130 this.id = id; |
| 965 if (?items) | 1131 if (?items) |
| 966 this.items = items; | 1132 this.items = items; |
| 967 } | 1133 } |
| 968 | 1134 |
| 969 /* | 1135 /* |
| 970 * Private constructor | 1136 * Private constructor |
| 971 */ | 1137 */ |
| 972 AppRuntimeLaunchData._proxy(_jsObject) : super._proxy(_jsObject); | 1138 AppRuntimeLaunchData._proxy(_jsObject) : super._proxy(_jsObject); |
| 973 | 1139 |
| 974 /* | 1140 /* |
| 975 * Public accessors | 1141 * Public accessors |
| 976 */ | 1142 */ |
| 977 AppRuntimeIntent get intent => new AppRuntimeIntent._proxy(JS('', '#.intent',
this._jsObject)); | |
| 978 | |
| 979 void set intent(AppRuntimeIntent intent) { | |
| 980 JS('void', '#.intent = #', this._jsObject, convertArgument(intent)); | |
| 981 } | |
| 982 | |
| 983 /// The id of the file handler that the app is being invoked with. | 1143 /// The id of the file handler that the app is being invoked with. |
| 984 String get id => JS('String', '#.id', this._jsObject); | 1144 String get id => JS('String', '#.id', this._jsObject); |
| 985 | 1145 |
| 986 void set id(String id) { | 1146 void set id(String id) { |
| 987 JS('void', '#.id = #', this._jsObject, id); | 1147 JS('void', '#.id = #', this._jsObject, id); |
| 988 } | 1148 } |
| 989 | 1149 |
| 990 List<AppRuntimeLaunchItem> get items { | 1150 List<AppRuntimeLaunchItem> get items { |
| 991 List<AppRuntimeLaunchItem> __proxy_items = new List<AppRuntimeLaunchItem>(); | 1151 List<AppRuntimeLaunchItem> __proxy_items = new List<AppRuntimeLaunchItem>(); |
| 992 for (var o in JS('List', '#.items', this._jsObject)) { | 1152 for (var o in JS('List', '#.items', this._jsObject)) { |
| 993 __proxy_items.add(new AppRuntimeLaunchItem._proxy(o)); | 1153 __proxy_items.add(new AppRuntimeLaunchItem._proxy(o)); |
| 994 } | 1154 } |
| 995 return __proxy_items; | 1155 return __proxy_items; |
| 996 } | 1156 } |
| 997 | 1157 |
| 998 void set items(List<AppRuntimeLaunchItem> items) { | 1158 void set items(List<AppRuntimeLaunchItem> items) { |
| 999 JS('void', '#.items = #', this._jsObject, convertArgument(items)); | 1159 JS('void', '#.items = #', this._jsObject, convertArgument(items)); |
| 1000 } | 1160 } |
| 1001 | 1161 |
| 1002 } | 1162 } |
| 1003 | 1163 |
| 1004 class AppRuntimeIntentResponse extends ChromeObject { | |
| 1005 /* | |
| 1006 * Public constructor | |
| 1007 */ | |
| 1008 AppRuntimeIntentResponse({int intentId, bool success, Object data}) { | |
| 1009 if (?intentId) | |
| 1010 this.intentId = intentId; | |
| 1011 if (?success) | |
| 1012 this.success = success; | |
| 1013 if (?data) | |
| 1014 this.data = data; | |
| 1015 } | |
| 1016 | |
| 1017 /* | |
| 1018 * Private constructor | |
| 1019 */ | |
| 1020 AppRuntimeIntentResponse._proxy(_jsObject) : super._proxy(_jsObject); | |
| 1021 | |
| 1022 /* | |
| 1023 * Public accessors | |
| 1024 */ | |
| 1025 /// Identifies the intent. | |
| 1026 int get intentId => JS('int', '#.intentId', this._jsObject); | |
| 1027 | |
| 1028 void set intentId(int intentId) { | |
| 1029 JS('void', '#.intentId = #', this._jsObject, intentId); | |
| 1030 } | |
| 1031 | |
| 1032 /// Was this intent successful? (i.e., postSuccess vs postFailure). | |
| 1033 bool get success => JS('bool', '#.success', this._jsObject); | |
| 1034 | |
| 1035 void set success(bool success) { | |
| 1036 JS('void', '#.success = #', this._jsObject, success); | |
| 1037 } | |
| 1038 | |
| 1039 /// Data associated with the intent response. | |
| 1040 Object get data => JS('Object', '#.data', this._jsObject); | |
| 1041 | |
| 1042 void set data(Object data) { | |
| 1043 JS('void', '#.data = #', this._jsObject, convertArgument(data)); | |
| 1044 } | |
| 1045 | |
| 1046 } | |
| 1047 | |
| 1048 /** | 1164 /** |
| 1049 * Events | 1165 * Events |
| 1050 */ | 1166 */ |
| 1051 | 1167 |
| 1052 /// Fired when an app is launched from the launcher or in response to a web | 1168 /// Fired when an app is launched from the launcher. |
| 1053 /// intent. | |
| 1054 class Event_app_runtime_onLaunched extends Event { | 1169 class Event_app_runtime_onLaunched extends Event { |
| 1055 void addListener(void callback(AppRuntimeLaunchData launchData)) { | 1170 void addListener(void callback(AppRuntimeLaunchData launchData)) { |
| 1056 void __proxy_callback(launchData) { | 1171 void __proxy_callback(launchData) { |
| 1057 if (?callback) { | 1172 if (?callback) { |
| 1058 callback(new AppRuntimeLaunchData._proxy(launchData)); | 1173 callback(new AppRuntimeLaunchData._proxy(launchData)); |
| 1059 } | 1174 } |
| 1060 } | 1175 } |
| 1061 super.addListener(callback); | 1176 super.addListener(callback); |
| 1062 } | 1177 } |
| 1063 | 1178 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 /* | 1217 /* |
| 1103 * API connection | 1218 * API connection |
| 1104 */ | 1219 */ |
| 1105 Object _jsObject; | 1220 Object _jsObject; |
| 1106 | 1221 |
| 1107 /* | 1222 /* |
| 1108 * Events | 1223 * Events |
| 1109 */ | 1224 */ |
| 1110 Event_app_runtime_onLaunched onLaunched; | 1225 Event_app_runtime_onLaunched onLaunched; |
| 1111 Event_app_runtime_onRestarted onRestarted; | 1226 Event_app_runtime_onRestarted onRestarted; |
| 1112 | |
| 1113 /* | |
| 1114 * Functions | |
| 1115 */ | |
| 1116 /// postIntentResponse is an internal method to responds to an intent | |
| 1117 /// previously sent to a packaged app. This is identified by intentId, and | |
| 1118 /// should only be invoked at most once per intentId. | |
| 1119 void postIntentResponse(AppRuntimeIntentResponse intentResponse) => JS('void',
'#.postIntentResponse(#)', this._jsObject, convertArgument(intentResponse)); | |
| 1120 | |
| 1121 API_app_runtime(this._jsObject) { | 1227 API_app_runtime(this._jsObject) { |
| 1122 onLaunched = new Event_app_runtime_onLaunched(JS('', '#.onLaunched', this._j
sObject)); | 1228 onLaunched = new Event_app_runtime_onLaunched(JS('', '#.onLaunched', this._j
sObject)); |
| 1123 onRestarted = new Event_app_runtime_onRestarted(JS('', '#.onRestarted', this
._jsObject)); | 1229 onRestarted = new Event_app_runtime_onRestarted(JS('', '#.onRestarted', this
._jsObject)); |
| 1124 } | 1230 } |
| 1125 } | 1231 } |
| 1232 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 1233 // for details. All rights reserved. Use of this source code is governed by a |
| 1234 // BSD-style license that can be found in the LICENSE file. |
| 1235 |
| 1236 // Generated from namespace: bluetooth |
| 1237 |
| 1238 |
| 1239 /** |
| 1240 * Types |
| 1241 */ |
| 1242 |
| 1243 class BluetoothAdapterState extends ChromeObject { |
| 1244 /* |
| 1245 * Public constructor |
| 1246 */ |
| 1247 BluetoothAdapterState({String address, String name, bool powered, bool availab
le, bool discovering}) { |
| 1248 if (?address) |
| 1249 this.address = address; |
| 1250 if (?name) |
| 1251 this.name = name; |
| 1252 if (?powered) |
| 1253 this.powered = powered; |
| 1254 if (?available) |
| 1255 this.available = available; |
| 1256 if (?discovering) |
| 1257 this.discovering = discovering; |
| 1258 } |
| 1259 |
| 1260 /* |
| 1261 * Private constructor |
| 1262 */ |
| 1263 BluetoothAdapterState._proxy(_jsObject) : super._proxy(_jsObject); |
| 1264 |
| 1265 /* |
| 1266 * Public accessors |
| 1267 */ |
| 1268 /// The address of the adapter, in the format 'XX:XX:XX:XX:XX:XX'. |
| 1269 String get address => JS('String', '#.address', this._jsObject); |
| 1270 |
| 1271 void set address(String address) { |
| 1272 JS('void', '#.address = #', this._jsObject, address); |
| 1273 } |
| 1274 |
| 1275 /// The human-readable name of the adapter. |
| 1276 String get name => JS('String', '#.name', this._jsObject); |
| 1277 |
| 1278 void set name(String name) { |
| 1279 JS('void', '#.name = #', this._jsObject, name); |
| 1280 } |
| 1281 |
| 1282 /// Indicates whether or not the adapter has power. |
| 1283 bool get powered => JS('bool', '#.powered', this._jsObject); |
| 1284 |
| 1285 void set powered(bool powered) { |
| 1286 JS('void', '#.powered = #', this._jsObject, powered); |
| 1287 } |
| 1288 |
| 1289 /// Indicates whether or not the adapter is available (i.e. enabled). |
| 1290 bool get available => JS('bool', '#.available', this._jsObject); |
| 1291 |
| 1292 void set available(bool available) { |
| 1293 JS('void', '#.available = #', this._jsObject, available); |
| 1294 } |
| 1295 |
| 1296 /// Indicates whether or not the adapter is currently discovering. |
| 1297 bool get discovering => JS('bool', '#.discovering', this._jsObject); |
| 1298 |
| 1299 void set discovering(bool discovering) { |
| 1300 JS('void', '#.discovering = #', this._jsObject, discovering); |
| 1301 } |
| 1302 |
| 1303 } |
| 1304 |
| 1305 class BluetoothDevice extends ChromeObject { |
| 1306 /* |
| 1307 * Public constructor |
| 1308 */ |
| 1309 BluetoothDevice({String address, String name, bool paired, bool bonded, bool c
onnected}) { |
| 1310 if (?address) |
| 1311 this.address = address; |
| 1312 if (?name) |
| 1313 this.name = name; |
| 1314 if (?paired) |
| 1315 this.paired = paired; |
| 1316 if (?bonded) |
| 1317 this.bonded = bonded; |
| 1318 if (?connected) |
| 1319 this.connected = connected; |
| 1320 } |
| 1321 |
| 1322 /* |
| 1323 * Private constructor |
| 1324 */ |
| 1325 BluetoothDevice._proxy(_jsObject) : super._proxy(_jsObject); |
| 1326 |
| 1327 /* |
| 1328 * Public accessors |
| 1329 */ |
| 1330 /// The address of the device, in the format 'XX:XX:XX:XX:XX:XX'. |
| 1331 String get address => JS('String', '#.address', this._jsObject); |
| 1332 |
| 1333 void set address(String address) { |
| 1334 JS('void', '#.address = #', this._jsObject, address); |
| 1335 } |
| 1336 |
| 1337 /// The human-readable name of the device. |
| 1338 String get name => JS('String', '#.name', this._jsObject); |
| 1339 |
| 1340 void set name(String name) { |
| 1341 JS('void', '#.name = #', this._jsObject, name); |
| 1342 } |
| 1343 |
| 1344 /// Indicates whether or not the device is paired with the system. |
| 1345 bool get paired => JS('bool', '#.paired', this._jsObject); |
| 1346 |
| 1347 void set paired(bool paired) { |
| 1348 JS('void', '#.paired = #', this._jsObject, paired); |
| 1349 } |
| 1350 |
| 1351 /// Indicates whether or not the device is bonded with the system. A device is |
| 1352 /// bonded if it is paired and high-security link keys have been exchanged so |
| 1353 /// that connections may be encrypted. |
| 1354 bool get bonded => JS('bool', '#.bonded', this._jsObject); |
| 1355 |
| 1356 void set bonded(bool bonded) { |
| 1357 JS('void', '#.bonded = #', this._jsObject, bonded); |
| 1358 } |
| 1359 |
| 1360 /// Indicates whether the device is currently connected to the system. |
| 1361 bool get connected => JS('bool', '#.connected', this._jsObject); |
| 1362 |
| 1363 void set connected(bool connected) { |
| 1364 JS('void', '#.connected = #', this._jsObject, connected); |
| 1365 } |
| 1366 |
| 1367 } |
| 1368 |
| 1369 class BluetoothServiceRecord extends ChromeObject { |
| 1370 /* |
| 1371 * Public constructor |
| 1372 */ |
| 1373 BluetoothServiceRecord({String name, String uuid}) { |
| 1374 if (?name) |
| 1375 this.name = name; |
| 1376 if (?uuid) |
| 1377 this.uuid = uuid; |
| 1378 } |
| 1379 |
| 1380 /* |
| 1381 * Private constructor |
| 1382 */ |
| 1383 BluetoothServiceRecord._proxy(_jsObject) : super._proxy(_jsObject); |
| 1384 |
| 1385 /* |
| 1386 * Public accessors |
| 1387 */ |
| 1388 /// The name of the service. |
| 1389 String get name => JS('String', '#.name', this._jsObject); |
| 1390 |
| 1391 void set name(String name) { |
| 1392 JS('void', '#.name = #', this._jsObject, name); |
| 1393 } |
| 1394 |
| 1395 /// The UUID of the service. |
| 1396 String get uuid => JS('String', '#.uuid', this._jsObject); |
| 1397 |
| 1398 void set uuid(String uuid) { |
| 1399 JS('void', '#.uuid = #', this._jsObject, uuid); |
| 1400 } |
| 1401 |
| 1402 } |
| 1403 |
| 1404 class BluetoothSocket extends ChromeObject { |
| 1405 /* |
| 1406 * Public constructor |
| 1407 */ |
| 1408 BluetoothSocket({BluetoothDevice device, String serviceUuid, int id}) { |
| 1409 if (?device) |
| 1410 this.device = device; |
| 1411 if (?serviceUuid) |
| 1412 this.serviceUuid = serviceUuid; |
| 1413 if (?id) |
| 1414 this.id = id; |
| 1415 } |
| 1416 |
| 1417 /* |
| 1418 * Private constructor |
| 1419 */ |
| 1420 BluetoothSocket._proxy(_jsObject) : super._proxy(_jsObject); |
| 1421 |
| 1422 /* |
| 1423 * Public accessors |
| 1424 */ |
| 1425 /// The remote Bluetooth device associated with this socket. |
| 1426 BluetoothDevice get device => new BluetoothDevice._proxy(JS('', '#.device', th
is._jsObject)); |
| 1427 |
| 1428 void set device(BluetoothDevice device) { |
| 1429 JS('void', '#.device = #', this._jsObject, convertArgument(device)); |
| 1430 } |
| 1431 |
| 1432 /// The remote Bluetooth service associated with this socket. |
| 1433 String get serviceUuid => JS('String', '#.serviceUuid', this._jsObject); |
| 1434 |
| 1435 void set serviceUuid(String serviceUuid) { |
| 1436 JS('void', '#.serviceUuid = #', this._jsObject, serviceUuid); |
| 1437 } |
| 1438 |
| 1439 /// An identifier for this socket that should be used with the |
| 1440 /// read/write/disconnect methods. |
| 1441 int get id => JS('int', '#.id', this._jsObject); |
| 1442 |
| 1443 void set id(int id) { |
| 1444 JS('void', '#.id = #', this._jsObject, id); |
| 1445 } |
| 1446 |
| 1447 } |
| 1448 |
| 1449 class BluetoothOutOfBandPairingData extends ChromeObject { |
| 1450 /* |
| 1451 * Public constructor |
| 1452 */ |
| 1453 BluetoothOutOfBandPairingData({String hash, String randomizer}) { |
| 1454 if (?hash) |
| 1455 this.hash = hash; |
| 1456 if (?randomizer) |
| 1457 this.randomizer = randomizer; |
| 1458 } |
| 1459 |
| 1460 /* |
| 1461 * Private constructor |
| 1462 */ |
| 1463 BluetoothOutOfBandPairingData._proxy(_jsObject) : super._proxy(_jsObject); |
| 1464 |
| 1465 /* |
| 1466 * Public accessors |
| 1467 */ |
| 1468 /// Simple Pairing Hash C. Always 16 octets long. |
| 1469 String get hash => JS('String', '#.hash', this._jsObject); |
| 1470 |
| 1471 void set hash(String hash) { |
| 1472 JS('void', '#.hash = #', this._jsObject, hash); |
| 1473 } |
| 1474 |
| 1475 /// Simple Pairing Randomizer R. Always 16 octets long. |
| 1476 String get randomizer => JS('String', '#.randomizer', this._jsObject); |
| 1477 |
| 1478 void set randomizer(String randomizer) { |
| 1479 JS('void', '#.randomizer = #', this._jsObject, randomizer); |
| 1480 } |
| 1481 |
| 1482 } |
| 1483 |
| 1484 class BluetoothGetDevicesOptions extends ChromeObject { |
| 1485 /* |
| 1486 * Private constructor |
| 1487 */ |
| 1488 BluetoothGetDevicesOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 1489 |
| 1490 /* |
| 1491 * Public accessors |
| 1492 */ |
| 1493 /// Only devices providing a service with a UUID that matches |uuid| will be |
| 1494 /// returned. |
| 1495 String get uuid => JS('String', '#.uuid', this._jsObject); |
| 1496 |
| 1497 void set uuid(String uuid) { |
| 1498 JS('void', '#.uuid = #', this._jsObject, uuid); |
| 1499 } |
| 1500 |
| 1501 /// Only devices providing a service with a name that matches |name| will be |
| 1502 /// returned. |
| 1503 String get name => JS('String', '#.name', this._jsObject); |
| 1504 |
| 1505 void set name(String name) { |
| 1506 JS('void', '#.name = #', this._jsObject, name); |
| 1507 } |
| 1508 |
| 1509 |
| 1510 /* |
| 1511 * Methods |
| 1512 */ |
| 1513 /// Called for each matching device. Note that a service discovery request |
| 1514 /// must be made to each non-matching device before it can be definitively |
| 1515 /// excluded. This can take some time. |
| 1516 void deviceCallback(BluetoothDevice device) => JS('void', '#.deviceCallback(#)
', this._jsObject, convertArgument(device)); |
| 1517 |
| 1518 } |
| 1519 |
| 1520 class BluetoothGetServicesOptions extends ChromeObject { |
| 1521 /* |
| 1522 * Public constructor |
| 1523 */ |
| 1524 BluetoothGetServicesOptions({String deviceAddress}) { |
| 1525 if (?deviceAddress) |
| 1526 this.deviceAddress = deviceAddress; |
| 1527 } |
| 1528 |
| 1529 /* |
| 1530 * Private constructor |
| 1531 */ |
| 1532 BluetoothGetServicesOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 1533 |
| 1534 /* |
| 1535 * Public accessors |
| 1536 */ |
| 1537 /// The address of the device to inquire about. |deviceAddress| should be in |
| 1538 /// the format 'XX:XX:XX:XX:XX:XX'. |
| 1539 String get deviceAddress => JS('String', '#.deviceAddress', this._jsObject); |
| 1540 |
| 1541 void set deviceAddress(String deviceAddress) { |
| 1542 JS('void', '#.deviceAddress = #', this._jsObject, deviceAddress); |
| 1543 } |
| 1544 |
| 1545 } |
| 1546 |
| 1547 class BluetoothConnectOptions extends ChromeObject { |
| 1548 /* |
| 1549 * Public constructor |
| 1550 */ |
| 1551 BluetoothConnectOptions({String deviceAddress, String serviceUuid}) { |
| 1552 if (?deviceAddress) |
| 1553 this.deviceAddress = deviceAddress; |
| 1554 if (?serviceUuid) |
| 1555 this.serviceUuid = serviceUuid; |
| 1556 } |
| 1557 |
| 1558 /* |
| 1559 * Private constructor |
| 1560 */ |
| 1561 BluetoothConnectOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 1562 |
| 1563 /* |
| 1564 * Public accessors |
| 1565 */ |
| 1566 /// The connection is made to the device at |deviceAddress|. |deviceAddress| |
| 1567 /// should be in the format 'XX:XX:XX:XX:XX:XX'. |
| 1568 String get deviceAddress => JS('String', '#.deviceAddress', this._jsObject); |
| 1569 |
| 1570 void set deviceAddress(String deviceAddress) { |
| 1571 JS('void', '#.deviceAddress = #', this._jsObject, deviceAddress); |
| 1572 } |
| 1573 |
| 1574 /// The connection is made to the service with UUID |serviceUuid|. |
| 1575 String get serviceUuid => JS('String', '#.serviceUuid', this._jsObject); |
| 1576 |
| 1577 void set serviceUuid(String serviceUuid) { |
| 1578 JS('void', '#.serviceUuid = #', this._jsObject, serviceUuid); |
| 1579 } |
| 1580 |
| 1581 } |
| 1582 |
| 1583 class BluetoothDisconnectOptions extends ChromeObject { |
| 1584 /* |
| 1585 * Public constructor |
| 1586 */ |
| 1587 BluetoothDisconnectOptions({int socketId}) { |
| 1588 if (?socketId) |
| 1589 this.socketId = socketId; |
| 1590 } |
| 1591 |
| 1592 /* |
| 1593 * Private constructor |
| 1594 */ |
| 1595 BluetoothDisconnectOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 1596 |
| 1597 /* |
| 1598 * Public accessors |
| 1599 */ |
| 1600 /// The socket to disconnect. |
| 1601 int get socketId => JS('int', '#.socketId', this._jsObject); |
| 1602 |
| 1603 void set socketId(int socketId) { |
| 1604 JS('void', '#.socketId = #', this._jsObject, socketId); |
| 1605 } |
| 1606 |
| 1607 } |
| 1608 |
| 1609 class BluetoothReadOptions extends ChromeObject { |
| 1610 /* |
| 1611 * Public constructor |
| 1612 */ |
| 1613 BluetoothReadOptions({int socketId}) { |
| 1614 if (?socketId) |
| 1615 this.socketId = socketId; |
| 1616 } |
| 1617 |
| 1618 /* |
| 1619 * Private constructor |
| 1620 */ |
| 1621 BluetoothReadOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 1622 |
| 1623 /* |
| 1624 * Public accessors |
| 1625 */ |
| 1626 /// The socket to read from. |
| 1627 int get socketId => JS('int', '#.socketId', this._jsObject); |
| 1628 |
| 1629 void set socketId(int socketId) { |
| 1630 JS('void', '#.socketId = #', this._jsObject, socketId); |
| 1631 } |
| 1632 |
| 1633 } |
| 1634 |
| 1635 class BluetoothWriteOptions extends ChromeObject { |
| 1636 /* |
| 1637 * Public constructor |
| 1638 */ |
| 1639 BluetoothWriteOptions({int socketId, String data}) { |
| 1640 if (?socketId) |
| 1641 this.socketId = socketId; |
| 1642 if (?data) |
| 1643 this.data = data; |
| 1644 } |
| 1645 |
| 1646 /* |
| 1647 * Private constructor |
| 1648 */ |
| 1649 BluetoothWriteOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 1650 |
| 1651 /* |
| 1652 * Public accessors |
| 1653 */ |
| 1654 /// The socket to write to. |
| 1655 int get socketId => JS('int', '#.socketId', this._jsObject); |
| 1656 |
| 1657 void set socketId(int socketId) { |
| 1658 JS('void', '#.socketId = #', this._jsObject, socketId); |
| 1659 } |
| 1660 |
| 1661 /// The data to write. |
| 1662 String get data => JS('String', '#.data', this._jsObject); |
| 1663 |
| 1664 void set data(String data) { |
| 1665 JS('void', '#.data = #', this._jsObject, data); |
| 1666 } |
| 1667 |
| 1668 } |
| 1669 |
| 1670 class BluetoothSetOutOfBandPairingDataOptions extends ChromeObject { |
| 1671 /* |
| 1672 * Public constructor |
| 1673 */ |
| 1674 BluetoothSetOutOfBandPairingDataOptions({String address, BluetoothOutOfBandPai
ringData data}) { |
| 1675 if (?address) |
| 1676 this.address = address; |
| 1677 if (?data) |
| 1678 this.data = data; |
| 1679 } |
| 1680 |
| 1681 /* |
| 1682 * Private constructor |
| 1683 */ |
| 1684 BluetoothSetOutOfBandPairingDataOptions._proxy(_jsObject) : super._proxy(_jsOb
ject); |
| 1685 |
| 1686 /* |
| 1687 * Public accessors |
| 1688 */ |
| 1689 /// The address of the remote device that the data should be associated with. |
| 1690 /// |deviceAddress| should be in the format 'XX:XX:XX:XX:XX:XX'. |
| 1691 String get address => JS('String', '#.address', this._jsObject); |
| 1692 |
| 1693 void set address(String address) { |
| 1694 JS('void', '#.address = #', this._jsObject, address); |
| 1695 } |
| 1696 |
| 1697 /// The Out Of Band Pairing Data. If this is omitted, the data for the device |
| 1698 /// is cleared instead. |
| 1699 BluetoothOutOfBandPairingData get data => new BluetoothOutOfBandPairingData._p
roxy(JS('', '#.data', this._jsObject)); |
| 1700 |
| 1701 void set data(BluetoothOutOfBandPairingData data) { |
| 1702 JS('void', '#.data = #', this._jsObject, convertArgument(data)); |
| 1703 } |
| 1704 |
| 1705 } |
| 1706 |
| 1707 class BluetoothStartDiscoveryOptions extends ChromeObject { |
| 1708 /* |
| 1709 * Private constructor |
| 1710 */ |
| 1711 BluetoothStartDiscoveryOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 1712 |
| 1713 /* |
| 1714 * Methods |
| 1715 */ |
| 1716 /// Called for each device that is discovered. |
| 1717 void deviceCallback(BluetoothDevice device) => JS('void', '#.deviceCallback(#)
', this._jsObject, convertArgument(device)); |
| 1718 |
| 1719 } |
| 1720 |
| 1721 /** |
| 1722 * Events |
| 1723 */ |
| 1724 |
| 1725 /// Fired when the state of the Bluetooth adapter changes. |
| 1726 class Event_bluetooth_onAdapterStateChanged extends Event { |
| 1727 void addListener(void callback(BluetoothAdapterState state)) { |
| 1728 void __proxy_callback(state) { |
| 1729 if (?callback) { |
| 1730 callback(new BluetoothAdapterState._proxy(state)); |
| 1731 } |
| 1732 } |
| 1733 super.addListener(callback); |
| 1734 } |
| 1735 |
| 1736 void removeListener(void callback(BluetoothAdapterState state)) { |
| 1737 void __proxy_callback(state) { |
| 1738 if (?callback) { |
| 1739 callback(new BluetoothAdapterState._proxy(state)); |
| 1740 } |
| 1741 } |
| 1742 super.removeListener(callback); |
| 1743 } |
| 1744 |
| 1745 bool hasListener(void callback(BluetoothAdapterState state)) { |
| 1746 void __proxy_callback(state) { |
| 1747 if (?callback) { |
| 1748 callback(new BluetoothAdapterState._proxy(state)); |
| 1749 } |
| 1750 } |
| 1751 super.hasListener(callback); |
| 1752 } |
| 1753 |
| 1754 Event_bluetooth_onAdapterStateChanged(jsObject) : super._(jsObject, 1); |
| 1755 } |
| 1756 |
| 1757 /** |
| 1758 * Functions |
| 1759 */ |
| 1760 |
| 1761 class API_bluetooth { |
| 1762 /* |
| 1763 * API connection |
| 1764 */ |
| 1765 Object _jsObject; |
| 1766 |
| 1767 /* |
| 1768 * Events |
| 1769 */ |
| 1770 Event_bluetooth_onAdapterStateChanged onAdapterStateChanged; |
| 1771 |
| 1772 /* |
| 1773 * Functions |
| 1774 */ |
| 1775 /// Get information about the Bluetooth adapter. |
| 1776 void getAdapterState(void callback(BluetoothAdapterState result)) { |
| 1777 void __proxy_callback(result) { |
| 1778 if (?callback) { |
| 1779 callback(new BluetoothAdapterState._proxy(result)); |
| 1780 } |
| 1781 } |
| 1782 JS('void', '#.getAdapterState(#)', this._jsObject, convertDartClosureToJS(__
proxy_callback, 1)); |
| 1783 } |
| 1784 |
| 1785 /// Get a bluetooth devices known to the system. Known devices are either |
| 1786 /// currently bonded, or have been bonded in the past. |
| 1787 void getDevices(BluetoothGetDevicesOptions options, void callback()) => JS('vo
id', '#.getDevices(#, #)', this._jsObject, convertArgument(options), convertDart
ClosureToJS(callback, 0)); |
| 1788 |
| 1789 /// Get a list of services provided by a device. |
| 1790 void getServices(BluetoothGetServicesOptions options, void callback(List<Bluet
oothServiceRecord> result)) { |
| 1791 void __proxy_callback(result) { |
| 1792 if (?callback) { |
| 1793 List<BluetoothServiceRecord> __proxy_result = new List<BluetoothServiceR
ecord>(); |
| 1794 for (var o in result) { |
| 1795 __proxy_result.add(new BluetoothServiceRecord._proxy(o)); |
| 1796 } |
| 1797 callback(__proxy_result); |
| 1798 } |
| 1799 } |
| 1800 JS('void', '#.getServices(#, #)', this._jsObject, convertArgument(options),
convertDartClosureToJS(__proxy_callback, 1)); |
| 1801 } |
| 1802 |
| 1803 /// Connect to a service on a device. |
| 1804 void connect(BluetoothConnectOptions options, void callback(BluetoothSocket re
sult)) { |
| 1805 void __proxy_callback(result) { |
| 1806 if (?callback) { |
| 1807 callback(new BluetoothSocket._proxy(result)); |
| 1808 } |
| 1809 } |
| 1810 JS('void', '#.connect(#, #)', this._jsObject, convertArgument(options), conv
ertDartClosureToJS(__proxy_callback, 1)); |
| 1811 } |
| 1812 |
| 1813 /// Close a Bluetooth connection. |
| 1814 void disconnect(BluetoothDisconnectOptions options, [void callback()]) => JS('
void', '#.disconnect(#, #)', this._jsObject, convertArgument(options), convertDa
rtClosureToJS(callback, 0)); |
| 1815 |
| 1816 /// Read data from a Bluetooth connection. |
| 1817 void read(BluetoothReadOptions options, void callback(String result)) => JS('v
oid', '#.read(#, #)', this._jsObject, convertArgument(options), convertDartClosu
reToJS(callback, 1)); |
| 1818 |
| 1819 /// Write data to a Bluetooth connection. |
| 1820 void write(BluetoothWriteOptions options, [void callback(int result)]) => JS('
void', '#.write(#, #)', this._jsObject, convertArgument(options), convertDartClo
sureToJS(callback, 1)); |
| 1821 |
| 1822 /// Get the local Out of Band Pairing data. |
| 1823 void getLocalOutOfBandPairingData(void callback(BluetoothOutOfBandPairingData
data)) { |
| 1824 void __proxy_callback(data) { |
| 1825 if (?callback) { |
| 1826 callback(new BluetoothOutOfBandPairingData._proxy(data)); |
| 1827 } |
| 1828 } |
| 1829 JS('void', '#.getLocalOutOfBandPairingData(#)', this._jsObject, convertDartC
losureToJS(__proxy_callback, 1)); |
| 1830 } |
| 1831 |
| 1832 /// Set the Out of Band Pairing data for a remote device. Any previous Out Of |
| 1833 /// Band Pairing Data for this device is overwritten. |
| 1834 void setOutOfBandPairingData(BluetoothSetOutOfBandPairingDataOptions options,
[void callback()]) => JS('void', '#.setOutOfBandPairingData(#, #)', this._jsObje
ct, convertArgument(options), convertDartClosureToJS(callback, 0)); |
| 1835 |
| 1836 /// Start discovery. Discovered devices will be returned via the |
| 1837 /// |onDeviceDiscovered| callback. Discovery will fail to start if it is |
| 1838 /// already in progress. Discovery can be resource intensive: stopDiscovery |
| 1839 /// should be called as soon as possible. |
| 1840 void startDiscovery(BluetoothStartDiscoveryOptions options, [void callback()])
=> JS('void', '#.startDiscovery(#, #)', this._jsObject, convertArgument(options
), convertDartClosureToJS(callback, 0)); |
| 1841 |
| 1842 /// Stop discovery. |
| 1843 void stopDiscovery([void callback()]) => JS('void', '#.stopDiscovery(#)', this
._jsObject, convertDartClosureToJS(callback, 0)); |
| 1844 |
| 1845 API_bluetooth(this._jsObject) { |
| 1846 onAdapterStateChanged = new Event_bluetooth_onAdapterStateChanged(JS('', '#.
onAdapterStateChanged', this._jsObject)); |
| 1847 } |
| 1848 } |
| 1849 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 1850 // for details. All rights reserved. Use of this source code is governed by a |
| 1851 // BSD-style license that can be found in the LICENSE file. |
| 1852 |
| 1853 // Generated from namespace: contextMenus |
| 1854 |
| 1855 |
| 1856 /** |
| 1857 * Types |
| 1858 */ |
| 1859 |
| 1860 /// Information sent when a context menu item is clicked. |
| 1861 class ContextmenusOnClickData extends ChromeObject { |
| 1862 /* |
| 1863 * Public constructor |
| 1864 */ |
| 1865 ContextmenusOnClickData({Object menuItemId, Object parentMenuItemId, String me
diaType, String linkUrl, String srcUrl, String pageUrl, String frameUrl, String
selectionText, bool editable, bool wasChecked, bool checked}) { |
| 1866 if (?menuItemId) |
| 1867 this.menuItemId = menuItemId; |
| 1868 if (?parentMenuItemId) |
| 1869 this.parentMenuItemId = parentMenuItemId; |
| 1870 if (?mediaType) |
| 1871 this.mediaType = mediaType; |
| 1872 if (?linkUrl) |
| 1873 this.linkUrl = linkUrl; |
| 1874 if (?srcUrl) |
| 1875 this.srcUrl = srcUrl; |
| 1876 if (?pageUrl) |
| 1877 this.pageUrl = pageUrl; |
| 1878 if (?frameUrl) |
| 1879 this.frameUrl = frameUrl; |
| 1880 if (?selectionText) |
| 1881 this.selectionText = selectionText; |
| 1882 if (?editable) |
| 1883 this.editable = editable; |
| 1884 if (?wasChecked) |
| 1885 this.wasChecked = wasChecked; |
| 1886 if (?checked) |
| 1887 this.checked = checked; |
| 1888 } |
| 1889 |
| 1890 /* |
| 1891 * Private constructor |
| 1892 */ |
| 1893 ContextmenusOnClickData._proxy(_jsObject) : super._proxy(_jsObject); |
| 1894 |
| 1895 /* |
| 1896 * Public accessors |
| 1897 */ |
| 1898 /// The ID of the menu item that was clicked. |
| 1899 Object get menuItemId => JS('Object', '#.menuItemId', this._jsObject); |
| 1900 |
| 1901 void set menuItemId(Object menuItemId) { |
| 1902 JS('void', '#.menuItemId = #', this._jsObject, menuItemId); |
| 1903 } |
| 1904 |
| 1905 /// The parent ID, if any, for the item clicked. |
| 1906 Object get parentMenuItemId => JS('Object', '#.parentMenuItemId', this._jsObje
ct); |
| 1907 |
| 1908 void set parentMenuItemId(Object parentMenuItemId) { |
| 1909 JS('void', '#.parentMenuItemId = #', this._jsObject, parentMenuItemId); |
| 1910 } |
| 1911 |
| 1912 /// One of 'image', 'video', or 'audio' if the context menu was activated on |
| 1913 /// one of these types of elements. |
| 1914 String get mediaType => JS('String', '#.mediaType', this._jsObject); |
| 1915 |
| 1916 void set mediaType(String mediaType) { |
| 1917 JS('void', '#.mediaType = #', this._jsObject, mediaType); |
| 1918 } |
| 1919 |
| 1920 /// If the element is a link, the URL it points to. |
| 1921 String get linkUrl => JS('String', '#.linkUrl', this._jsObject); |
| 1922 |
| 1923 void set linkUrl(String linkUrl) { |
| 1924 JS('void', '#.linkUrl = #', this._jsObject, linkUrl); |
| 1925 } |
| 1926 |
| 1927 /// Will be present for elements with a 'src' URL. |
| 1928 String get srcUrl => JS('String', '#.srcUrl', this._jsObject); |
| 1929 |
| 1930 void set srcUrl(String srcUrl) { |
| 1931 JS('void', '#.srcUrl = #', this._jsObject, srcUrl); |
| 1932 } |
| 1933 |
| 1934 /// The URL of the page where the menu item was clicked. This property is not |
| 1935 /// set if the click occured in a context where there is no current page, such |
| 1936 /// as in a launcher context menu. |
| 1937 String get pageUrl => JS('String', '#.pageUrl', this._jsObject); |
| 1938 |
| 1939 void set pageUrl(String pageUrl) { |
| 1940 JS('void', '#.pageUrl = #', this._jsObject, pageUrl); |
| 1941 } |
| 1942 |
| 1943 /// The URL of the frame of the element where the context menu was clicked, i
f |
| 1944 /// it was in a frame. |
| 1945 String get frameUrl => JS('String', '#.frameUrl', this._jsObject); |
| 1946 |
| 1947 void set frameUrl(String frameUrl) { |
| 1948 JS('void', '#.frameUrl = #', this._jsObject, frameUrl); |
| 1949 } |
| 1950 |
| 1951 /// The text for the context selection, if any. |
| 1952 String get selectionText => JS('String', '#.selectionText', this._jsObject); |
| 1953 |
| 1954 void set selectionText(String selectionText) { |
| 1955 JS('void', '#.selectionText = #', this._jsObject, selectionText); |
| 1956 } |
| 1957 |
| 1958 /// A flag indicating whether the element is editable (text input, textarea, |
| 1959 /// etc.). |
| 1960 bool get editable => JS('bool', '#.editable', this._jsObject); |
| 1961 |
| 1962 void set editable(bool editable) { |
| 1963 JS('void', '#.editable = #', this._jsObject, editable); |
| 1964 } |
| 1965 |
| 1966 /// A flag indicating the state of a checkbox or radio item before it was |
| 1967 /// clicked. |
| 1968 bool get wasChecked => JS('bool', '#.wasChecked', this._jsObject); |
| 1969 |
| 1970 void set wasChecked(bool wasChecked) { |
| 1971 JS('void', '#.wasChecked = #', this._jsObject, wasChecked); |
| 1972 } |
| 1973 |
| 1974 /// A flag indicating the state of a checkbox or radio item after it is |
| 1975 /// clicked. |
| 1976 bool get checked => JS('bool', '#.checked', this._jsObject); |
| 1977 |
| 1978 void set checked(bool checked) { |
| 1979 JS('void', '#.checked = #', this._jsObject, checked); |
| 1980 } |
| 1981 |
| 1982 } |
| 1983 |
| 1984 /** |
| 1985 * Events |
| 1986 */ |
| 1987 |
| 1988 /// Fired when a context menu item is clicked. |
| 1989 class Event_context_menus_onClicked extends Event { |
| 1990 void addListener(void callback(ContextmenusOnClickData info, Tab tab)) { |
| 1991 void __proxy_callback(info, tab) { |
| 1992 if (?callback) { |
| 1993 callback(new ContextmenusOnClickData._proxy(info), new Tab._proxy(tab)); |
| 1994 } |
| 1995 } |
| 1996 super.addListener(callback); |
| 1997 } |
| 1998 |
| 1999 void removeListener(void callback(ContextmenusOnClickData info, Tab tab)) { |
| 2000 void __proxy_callback(info, tab) { |
| 2001 if (?callback) { |
| 2002 callback(new ContextmenusOnClickData._proxy(info), new Tab._proxy(tab)); |
| 2003 } |
| 2004 } |
| 2005 super.removeListener(callback); |
| 2006 } |
| 2007 |
| 2008 bool hasListener(void callback(ContextmenusOnClickData info, Tab tab)) { |
| 2009 void __proxy_callback(info, tab) { |
| 2010 if (?callback) { |
| 2011 callback(new ContextmenusOnClickData._proxy(info), new Tab._proxy(tab)); |
| 2012 } |
| 2013 } |
| 2014 super.hasListener(callback); |
| 2015 } |
| 2016 |
| 2017 Event_context_menus_onClicked(jsObject) : super._(jsObject, 2); |
| 2018 } |
| 2019 |
| 2020 /** |
| 2021 * Functions |
| 2022 */ |
| 2023 |
| 2024 class API_context_menus { |
| 2025 /* |
| 2026 * API connection |
| 2027 */ |
| 2028 Object _jsObject; |
| 2029 |
| 2030 /* |
| 2031 * Events |
| 2032 */ |
| 2033 Event_context_menus_onClicked onClicked; |
| 2034 |
| 2035 /* |
| 2036 * Functions |
| 2037 */ |
| 2038 /// Creates a new context menu item. Note that if an error occurs during |
| 2039 /// creation, you may not find out until the creation callback fires (the |
| 2040 /// details will be in chrome.runtime.lastError). |
| 2041 Object create(Object createProperties, [void callback()]) => JS('Object', '#.c
reate(#, #)', this._jsObject, convertArgument(createProperties), convertDartClos
ureToJS(callback, 0)); |
| 2042 |
| 2043 /// Updates a previously created context menu item. |
| 2044 void update(Object id, Object updateProperties, [void callback()]) => JS('void
', '#.update(#, #, #)', this._jsObject, id, convertArgument(updateProperties), c
onvertDartClosureToJS(callback, 0)); |
| 2045 |
| 2046 /// Removes a context menu item. |
| 2047 void remove(Object menuItemId, [void callback()]) => JS('void', '#.remove(#, #
)', this._jsObject, menuItemId, convertDartClosureToJS(callback, 0)); |
| 2048 |
| 2049 /// Removes all context menu items added by this extension. |
| 2050 void removeAll([void callback()]) => JS('void', '#.removeAll(#)', this._jsObje
ct, convertDartClosureToJS(callback, 0)); |
| 2051 |
| 2052 API_context_menus(this._jsObject) { |
| 2053 onClicked = new Event_context_menus_onClicked(JS('', '#.onClicked', this._js
Object)); |
| 2054 } |
| 2055 } |
| 2056 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2057 // for details. All rights reserved. Use of this source code is governed by a |
| 2058 // BSD-style license that can be found in the LICENSE file. |
| 2059 |
| 2060 // Generated from namespace: fileSystem |
| 2061 |
| 2062 |
| 2063 /** |
| 2064 * Types |
| 2065 */ |
| 2066 |
| 2067 class FilesystemAcceptOption extends ChromeObject { |
| 2068 /* |
| 2069 * Public constructor |
| 2070 */ |
| 2071 FilesystemAcceptOption({String description, List<String> mimeTypes, List<Strin
g> extensions}) { |
| 2072 if (?description) |
| 2073 this.description = description; |
| 2074 if (?mimeTypes) |
| 2075 this.mimeTypes = mimeTypes; |
| 2076 if (?extensions) |
| 2077 this.extensions = extensions; |
| 2078 } |
| 2079 |
| 2080 /* |
| 2081 * Private constructor |
| 2082 */ |
| 2083 FilesystemAcceptOption._proxy(_jsObject) : super._proxy(_jsObject); |
| 2084 |
| 2085 /* |
| 2086 * Public accessors |
| 2087 */ |
| 2088 /// This is the optional text description for this option. If not present, a |
| 2089 /// description will be automatically generated; typically containing an |
| 2090 /// expanded list of valid extensions (e.g. "text/html" may expand to "*.html, |
| 2091 /// *.htm"). |
| 2092 String get description => JS('String', '#.description', this._jsObject); |
| 2093 |
| 2094 void set description(String description) { |
| 2095 JS('void', '#.description = #', this._jsObject, description); |
| 2096 } |
| 2097 |
| 2098 /// Mime-types to accept, e.g. "image/jpeg" or "audio/*". One of mimeTypes or |
| 2099 /// extensions must contain at least one valid element. |
| 2100 List<String> get mimeTypes => JS('List<String>', '#.mimeTypes', this._jsObject
); |
| 2101 |
| 2102 void set mimeTypes(List<String> mimeTypes) { |
| 2103 JS('void', '#.mimeTypes = #', this._jsObject, mimeTypes); |
| 2104 } |
| 2105 |
| 2106 /// Extensions to accept, e.g. "jpg", "gif", "crx". |
| 2107 List<String> get extensions => JS('List<String>', '#.extensions', this._jsObje
ct); |
| 2108 |
| 2109 void set extensions(List<String> extensions) { |
| 2110 JS('void', '#.extensions = #', this._jsObject, extensions); |
| 2111 } |
| 2112 |
| 2113 } |
| 2114 |
| 2115 class FilesystemChooseEntryOptions extends ChromeObject { |
| 2116 /* |
| 2117 * Public constructor |
| 2118 */ |
| 2119 FilesystemChooseEntryOptions({String type, String suggestedName, List<Filesyst
emAcceptOption> accepts, bool acceptsAllTypes}) { |
| 2120 if (?type) |
| 2121 this.type = type; |
| 2122 if (?suggestedName) |
| 2123 this.suggestedName = suggestedName; |
| 2124 if (?accepts) |
| 2125 this.accepts = accepts; |
| 2126 if (?acceptsAllTypes) |
| 2127 this.acceptsAllTypes = acceptsAllTypes; |
| 2128 } |
| 2129 |
| 2130 /* |
| 2131 * Private constructor |
| 2132 */ |
| 2133 FilesystemChooseEntryOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 2134 |
| 2135 /* |
| 2136 * Public accessors |
| 2137 */ |
| 2138 /// Type of the prompt to show. Valid types are 'openFile', 'openWritableFile' |
| 2139 /// or 'saveFile'.<br/><br/> Both 'openFile' and 'openWritableFile' will promp
t |
| 2140 /// the user to open an existing file, with 'openFile' returning a read-only |
| 2141 /// FileEntry on success. 'saveFile' will prompt the user to choose an existin
g |
| 2142 /// file or a new file, and will return a writable FileEntry. Calls to |
| 2143 /// chooseFile with either 'openWritableFile' or 'saveFile' will fail unless |
| 2144 /// the application has the 'write' permission under 'fileSystem'.<br/><br/> |
| 2145 /// The default is 'openFile'. |
| 2146 String get type => JS('String', '#.type', this._jsObject); |
| 2147 |
| 2148 void set type(String type) { |
| 2149 JS('void', '#.type = #', this._jsObject, type); |
| 2150 } |
| 2151 |
| 2152 /// The suggested file name that will be presented to the user as the default |
| 2153 /// name to read or write. This is optional. |
| 2154 String get suggestedName => JS('String', '#.suggestedName', this._jsObject); |
| 2155 |
| 2156 void set suggestedName(String suggestedName) { |
| 2157 JS('void', '#.suggestedName = #', this._jsObject, suggestedName); |
| 2158 } |
| 2159 |
| 2160 /// The optional list of accept options for this file opener. Each option will |
| 2161 /// be presented as a unique group to the end-user. |
| 2162 List<FilesystemAcceptOption> get accepts { |
| 2163 List<FilesystemAcceptOption> __proxy_accepts = new List<FilesystemAcceptOpti
on>(); |
| 2164 for (var o in JS('List', '#.accepts', this._jsObject)) { |
| 2165 __proxy_accepts.add(new FilesystemAcceptOption._proxy(o)); |
| 2166 } |
| 2167 return __proxy_accepts; |
| 2168 } |
| 2169 |
| 2170 void set accepts(List<FilesystemAcceptOption> accepts) { |
| 2171 JS('void', '#.accepts = #', this._jsObject, convertArgument(accepts)); |
| 2172 } |
| 2173 |
| 2174 /// Whether to accept all file types, in addition to the options specified in |
| 2175 /// the accepts argument. The default is true. If the accepts field is unset o
r |
| 2176 /// contains no valid entries, this will always be reset to true. |
| 2177 bool get acceptsAllTypes => JS('bool', '#.acceptsAllTypes', this._jsObject); |
| 2178 |
| 2179 void set acceptsAllTypes(bool acceptsAllTypes) { |
| 2180 JS('void', '#.acceptsAllTypes = #', this._jsObject, acceptsAllTypes); |
| 2181 } |
| 2182 |
| 2183 } |
| 2184 |
| 2185 /** |
| 2186 * Functions |
| 2187 */ |
| 2188 |
| 2189 class API_file_system { |
| 2190 /* |
| 2191 * API connection |
| 2192 */ |
| 2193 Object _jsObject; |
| 2194 |
| 2195 /* |
| 2196 * Functions |
| 2197 */ |
| 2198 /// Get the display path of a FileEntry object. The display path is based on |
| 2199 /// the full path of the file on the local file system, but may be made more |
| 2200 /// readable for display purposes. |
| 2201 void getDisplayPath(FileEntry fileEntry, void callback(String displayPath)) =>
JS('void', '#.getDisplayPath(#, #)', this._jsObject, convertArgument(fileEntry)
, convertDartClosureToJS(callback, 1)); |
| 2202 |
| 2203 /// Get a writable FileEntry from another FileEntry. This call will fail if th
e |
| 2204 /// application does not have the 'write' permission under 'fileSystem'. |
| 2205 void getWritableEntry(FileEntry fileEntry, void callback(FileEntry fileEntry))
{ |
| 2206 void __proxy_callback(fileEntry) { |
| 2207 if (?callback) { |
| 2208 callback(fileEntry); |
| 2209 } |
| 2210 } |
| 2211 JS('void', '#.getWritableEntry(#, #)', this._jsObject, convertArgument(fileE
ntry), convertDartClosureToJS(__proxy_callback, 1)); |
| 2212 } |
| 2213 |
| 2214 /// Gets whether this FileEntry is writable or not. |
| 2215 void isWritableEntry(FileEntry fileEntry, void callback(bool isWritable)) => J
S('void', '#.isWritableEntry(#, #)', this._jsObject, convertArgument(fileEntry),
convertDartClosureToJS(callback, 1)); |
| 2216 |
| 2217 /// Ask the user to choose a file. |
| 2218 void chooseEntry(void callback(FileEntry fileEntry), [FilesystemChooseEntryOpt
ions options]) { |
| 2219 void __proxy_callback(fileEntry) { |
| 2220 if (?callback) { |
| 2221 callback(fileEntry); |
| 2222 } |
| 2223 } |
| 2224 JS('void', '#.chooseEntry(#, #)', this._jsObject, convertArgument(options),
convertDartClosureToJS(__proxy_callback, 1)); |
| 2225 } |
| 2226 |
| 2227 /// Returns the file entry with the given id. |
| 2228 FileEntry getEntryById(String id) => new FileEntry._proxy(JS('', '#.getEntryBy
Id(#)', this._jsObject, id)); |
| 2229 |
| 2230 /// Returns the id of the given file entry. |
| 2231 String getEntryId(FileEntry fileEntry) => JS('String', '#.getEntryId(#)', this
._jsObject, convertArgument(fileEntry)); |
| 2232 |
| 2233 API_file_system(this._jsObject) { |
| 2234 } |
| 2235 } |
| 2236 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2237 // for details. All rights reserved. Use of this source code is governed by a |
| 2238 // BSD-style license that can be found in the LICENSE file. |
| 2239 |
| 2240 // Generated from namespace: mediaGalleries |
| 2241 |
| 2242 |
| 2243 /** |
| 2244 * Types |
| 2245 */ |
| 2246 |
| 2247 class MediagalleriesMediaFileSystemsDetails extends ChromeObject { |
| 2248 /* |
| 2249 * Public constructor |
| 2250 */ |
| 2251 MediagalleriesMediaFileSystemsDetails({String interactive}) { |
| 2252 if (?interactive) |
| 2253 this.interactive = interactive; |
| 2254 } |
| 2255 |
| 2256 /* |
| 2257 * Private constructor |
| 2258 */ |
| 2259 MediagalleriesMediaFileSystemsDetails._proxy(_jsObject) : super._proxy(_jsObje
ct); |
| 2260 |
| 2261 /* |
| 2262 * Public accessors |
| 2263 */ |
| 2264 /// Whether to prompt the user for permission to additional media galleries |
| 2265 /// before returning the permitted set. Default is silent. If the value 'yes' |
| 2266 /// is passed, or if the application has not been granted access to any media |
| 2267 /// galleries and the value 'if_needed' is passed, then the media gallery |
| 2268 /// configuration dialog will be displayed. |
| 2269 String get interactive => JS('String', '#.interactive', this._jsObject); |
| 2270 |
| 2271 void set interactive(String interactive) { |
| 2272 JS('void', '#.interactive = #', this._jsObject, interactive); |
| 2273 } |
| 2274 |
| 2275 } |
| 2276 |
| 2277 class MediagalleriesMediaFileSystemMetadata extends ChromeObject { |
| 2278 /* |
| 2279 * Public constructor |
| 2280 */ |
| 2281 MediagalleriesMediaFileSystemMetadata({String name, int galleryId, int deviceI
d, bool isRemovable, bool isMediaDevice}) { |
| 2282 if (?name) |
| 2283 this.name = name; |
| 2284 if (?galleryId) |
| 2285 this.galleryId = galleryId; |
| 2286 if (?deviceId) |
| 2287 this.deviceId = deviceId; |
| 2288 if (?isRemovable) |
| 2289 this.isRemovable = isRemovable; |
| 2290 if (?isMediaDevice) |
| 2291 this.isMediaDevice = isMediaDevice; |
| 2292 } |
| 2293 |
| 2294 /* |
| 2295 * Private constructor |
| 2296 */ |
| 2297 MediagalleriesMediaFileSystemMetadata._proxy(_jsObject) : super._proxy(_jsObje
ct); |
| 2298 |
| 2299 /* |
| 2300 * Public accessors |
| 2301 */ |
| 2302 /// The name of the file system. |
| 2303 String get name => JS('String', '#.name', this._jsObject); |
| 2304 |
| 2305 void set name(String name) { |
| 2306 JS('void', '#.name = #', this._jsObject, name); |
| 2307 } |
| 2308 |
| 2309 /// A unique and persistent id for the media gallery. |
| 2310 int get galleryId => JS('int', '#.galleryId', this._jsObject); |
| 2311 |
| 2312 void set galleryId(int galleryId) { |
| 2313 JS('void', '#.galleryId = #', this._jsObject, galleryId); |
| 2314 } |
| 2315 |
| 2316 /// If the media gallery is on a removable device, a unique id for the device. |
| 2317 int get deviceId => JS('int', '#.deviceId', this._jsObject); |
| 2318 |
| 2319 void set deviceId(int deviceId) { |
| 2320 JS('void', '#.deviceId = #', this._jsObject, deviceId); |
| 2321 } |
| 2322 |
| 2323 /// True if the media gallery is on a removable device. |
| 2324 bool get isRemovable => JS('bool', '#.isRemovable', this._jsObject); |
| 2325 |
| 2326 void set isRemovable(bool isRemovable) { |
| 2327 JS('void', '#.isRemovable = #', this._jsObject, isRemovable); |
| 2328 } |
| 2329 |
| 2330 /// True if the device the media gallery is on was detected as a media device. |
| 2331 /// i.e. a PTP or MTP device, or a DCIM directory is present. |
| 2332 bool get isMediaDevice => JS('bool', '#.isMediaDevice', this._jsObject); |
| 2333 |
| 2334 void set isMediaDevice(bool isMediaDevice) { |
| 2335 JS('void', '#.isMediaDevice = #', this._jsObject, isMediaDevice); |
| 2336 } |
| 2337 |
| 2338 } |
| 2339 |
| 2340 /** |
| 2341 * Functions |
| 2342 */ |
| 2343 |
| 2344 class API_media_galleries { |
| 2345 /* |
| 2346 * API connection |
| 2347 */ |
| 2348 Object _jsObject; |
| 2349 |
| 2350 /* |
| 2351 * Functions |
| 2352 */ |
| 2353 /// Get the media galleries configured in this user agent. If none are |
| 2354 /// configured or available, the callback will receive an empty array. |
| 2355 void getMediaFileSystems(void callback(List<DOMFileSystem> mediaFileSystems),
[MediagalleriesMediaFileSystemsDetails details]) { |
| 2356 void __proxy_callback(mediaFileSystems) { |
| 2357 if (?callback) { |
| 2358 callback(mediaFileSystems); |
| 2359 } |
| 2360 } |
| 2361 JS('void', '#.getMediaFileSystems(#, #)', this._jsObject, convertArgument(de
tails), convertDartClosureToJS(__proxy_callback, 1)); |
| 2362 } |
| 2363 |
| 2364 /// Get metadata about a specific media file system. |
| 2365 MediagalleriesMediaFileSystemMetadata getMediaFileSystemMetadata(DOMFileSystem
mediaFileSystem) => new MediagalleriesMediaFileSystemMetadata._proxy(JS('', '#.
getMediaFileSystemMetadata(#)', this._jsObject, convertArgument(mediaFileSystem)
)); |
| 2366 |
| 2367 API_media_galleries(this._jsObject) { |
| 2368 } |
| 2369 } |
| 2370 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2371 // for details. All rights reserved. Use of this source code is governed by a |
| 2372 // BSD-style license that can be found in the LICENSE file. |
| 2373 |
| 2374 // Generated from namespace: mediaGalleriesPrivate |
| 2375 |
| 2376 |
| 2377 /** |
| 2378 * Types |
| 2379 */ |
| 2380 |
| 2381 class MediagalleriesprivateDeviceAttachmentDetails extends ChromeObject { |
| 2382 /* |
| 2383 * Public constructor |
| 2384 */ |
| 2385 MediagalleriesprivateDeviceAttachmentDetails({String deviceName, String device
Id}) { |
| 2386 if (?deviceName) |
| 2387 this.deviceName = deviceName; |
| 2388 if (?deviceId) |
| 2389 this.deviceId = deviceId; |
| 2390 } |
| 2391 |
| 2392 /* |
| 2393 * Private constructor |
| 2394 */ |
| 2395 MediagalleriesprivateDeviceAttachmentDetails._proxy(_jsObject) : super._proxy(
_jsObject); |
| 2396 |
| 2397 /* |
| 2398 * Public accessors |
| 2399 */ |
| 2400 /// The name of the device. |
| 2401 String get deviceName => JS('String', '#.deviceName', this._jsObject); |
| 2402 |
| 2403 void set deviceName(String deviceName) { |
| 2404 JS('void', '#.deviceName = #', this._jsObject, deviceName); |
| 2405 } |
| 2406 |
| 2407 /// A transient id that unique identifies the device. |
| 2408 String get deviceId => JS('String', '#.deviceId', this._jsObject); |
| 2409 |
| 2410 void set deviceId(String deviceId) { |
| 2411 JS('void', '#.deviceId = #', this._jsObject, deviceId); |
| 2412 } |
| 2413 |
| 2414 } |
| 2415 |
| 2416 class MediagalleriesprivateDeviceDetachmentDetails extends ChromeObject { |
| 2417 /* |
| 2418 * Public constructor |
| 2419 */ |
| 2420 MediagalleriesprivateDeviceDetachmentDetails({String deviceId}) { |
| 2421 if (?deviceId) |
| 2422 this.deviceId = deviceId; |
| 2423 } |
| 2424 |
| 2425 /* |
| 2426 * Private constructor |
| 2427 */ |
| 2428 MediagalleriesprivateDeviceDetachmentDetails._proxy(_jsObject) : super._proxy(
_jsObject); |
| 2429 |
| 2430 /* |
| 2431 * Public accessors |
| 2432 */ |
| 2433 /// A transient id that unique identifies the device. |
| 2434 String get deviceId => JS('String', '#.deviceId', this._jsObject); |
| 2435 |
| 2436 void set deviceId(String deviceId) { |
| 2437 JS('void', '#.deviceId = #', this._jsObject, deviceId); |
| 2438 } |
| 2439 |
| 2440 } |
| 2441 |
| 2442 class MediagalleriesprivateGalleryChangeDetails extends ChromeObject { |
| 2443 /* |
| 2444 * Public constructor |
| 2445 */ |
| 2446 MediagalleriesprivateGalleryChangeDetails({int galleryId}) { |
| 2447 if (?galleryId) |
| 2448 this.galleryId = galleryId; |
| 2449 } |
| 2450 |
| 2451 /* |
| 2452 * Private constructor |
| 2453 */ |
| 2454 MediagalleriesprivateGalleryChangeDetails._proxy(_jsObject) : super._proxy(_js
Object); |
| 2455 |
| 2456 /* |
| 2457 * Public accessors |
| 2458 */ |
| 2459 /// Gallery identifier. |
| 2460 int get galleryId => JS('int', '#.galleryId', this._jsObject); |
| 2461 |
| 2462 void set galleryId(int galleryId) { |
| 2463 JS('void', '#.galleryId = #', this._jsObject, galleryId); |
| 2464 } |
| 2465 |
| 2466 } |
| 2467 |
| 2468 class MediagalleriesprivateAddGalleryWatchResult extends ChromeObject { |
| 2469 /* |
| 2470 * Public constructor |
| 2471 */ |
| 2472 MediagalleriesprivateAddGalleryWatchResult({int galleryId, bool success}) { |
| 2473 if (?galleryId) |
| 2474 this.galleryId = galleryId; |
| 2475 if (?success) |
| 2476 this.success = success; |
| 2477 } |
| 2478 |
| 2479 /* |
| 2480 * Private constructor |
| 2481 */ |
| 2482 MediagalleriesprivateAddGalleryWatchResult._proxy(_jsObject) : super._proxy(_j
sObject); |
| 2483 |
| 2484 /* |
| 2485 * Public accessors |
| 2486 */ |
| 2487 int get galleryId => JS('int', '#.galleryId', this._jsObject); |
| 2488 |
| 2489 void set galleryId(int galleryId) { |
| 2490 JS('void', '#.galleryId = #', this._jsObject, galleryId); |
| 2491 } |
| 2492 |
| 2493 bool get success => JS('bool', '#.success', this._jsObject); |
| 2494 |
| 2495 void set success(bool success) { |
| 2496 JS('void', '#.success = #', this._jsObject, success); |
| 2497 } |
| 2498 |
| 2499 } |
| 2500 |
| 2501 /** |
| 2502 * Events |
| 2503 */ |
| 2504 |
| 2505 /// Fired when a media device gets attached. |
| 2506 class Event_media_galleries_private_onDeviceAttached extends Event { |
| 2507 void addListener(void callback(MediagalleriesprivateDeviceAttachmentDetails de
tails)) { |
| 2508 void __proxy_callback(details) { |
| 2509 if (?callback) { |
| 2510 callback(new MediagalleriesprivateDeviceAttachmentDetails._proxy(details
)); |
| 2511 } |
| 2512 } |
| 2513 super.addListener(callback); |
| 2514 } |
| 2515 |
| 2516 void removeListener(void callback(MediagalleriesprivateDeviceAttachmentDetails
details)) { |
| 2517 void __proxy_callback(details) { |
| 2518 if (?callback) { |
| 2519 callback(new MediagalleriesprivateDeviceAttachmentDetails._proxy(details
)); |
| 2520 } |
| 2521 } |
| 2522 super.removeListener(callback); |
| 2523 } |
| 2524 |
| 2525 bool hasListener(void callback(MediagalleriesprivateDeviceAttachmentDetails de
tails)) { |
| 2526 void __proxy_callback(details) { |
| 2527 if (?callback) { |
| 2528 callback(new MediagalleriesprivateDeviceAttachmentDetails._proxy(details
)); |
| 2529 } |
| 2530 } |
| 2531 super.hasListener(callback); |
| 2532 } |
| 2533 |
| 2534 Event_media_galleries_private_onDeviceAttached(jsObject) : super._(jsObject, 1
); |
| 2535 } |
| 2536 |
| 2537 /// Fired when a media device gets detached. |
| 2538 class Event_media_galleries_private_onDeviceDetached extends Event { |
| 2539 void addListener(void callback(MediagalleriesprivateDeviceDetachmentDetails de
tails)) { |
| 2540 void __proxy_callback(details) { |
| 2541 if (?callback) { |
| 2542 callback(new MediagalleriesprivateDeviceDetachmentDetails._proxy(details
)); |
| 2543 } |
| 2544 } |
| 2545 super.addListener(callback); |
| 2546 } |
| 2547 |
| 2548 void removeListener(void callback(MediagalleriesprivateDeviceDetachmentDetails
details)) { |
| 2549 void __proxy_callback(details) { |
| 2550 if (?callback) { |
| 2551 callback(new MediagalleriesprivateDeviceDetachmentDetails._proxy(details
)); |
| 2552 } |
| 2553 } |
| 2554 super.removeListener(callback); |
| 2555 } |
| 2556 |
| 2557 bool hasListener(void callback(MediagalleriesprivateDeviceDetachmentDetails de
tails)) { |
| 2558 void __proxy_callback(details) { |
| 2559 if (?callback) { |
| 2560 callback(new MediagalleriesprivateDeviceDetachmentDetails._proxy(details
)); |
| 2561 } |
| 2562 } |
| 2563 super.hasListener(callback); |
| 2564 } |
| 2565 |
| 2566 Event_media_galleries_private_onDeviceDetached(jsObject) : super._(jsObject, 1
); |
| 2567 } |
| 2568 |
| 2569 /// Fired when a media gallery is changed. |
| 2570 class Event_media_galleries_private_onGalleryChanged extends Event { |
| 2571 void addListener(void callback(MediagalleriesprivateGalleryChangeDetails detai
ls)) { |
| 2572 void __proxy_callback(details) { |
| 2573 if (?callback) { |
| 2574 callback(new MediagalleriesprivateGalleryChangeDetails._proxy(details)); |
| 2575 } |
| 2576 } |
| 2577 super.addListener(callback); |
| 2578 } |
| 2579 |
| 2580 void removeListener(void callback(MediagalleriesprivateGalleryChangeDetails de
tails)) { |
| 2581 void __proxy_callback(details) { |
| 2582 if (?callback) { |
| 2583 callback(new MediagalleriesprivateGalleryChangeDetails._proxy(details)); |
| 2584 } |
| 2585 } |
| 2586 super.removeListener(callback); |
| 2587 } |
| 2588 |
| 2589 bool hasListener(void callback(MediagalleriesprivateGalleryChangeDetails detai
ls)) { |
| 2590 void __proxy_callback(details) { |
| 2591 if (?callback) { |
| 2592 callback(new MediagalleriesprivateGalleryChangeDetails._proxy(details)); |
| 2593 } |
| 2594 } |
| 2595 super.hasListener(callback); |
| 2596 } |
| 2597 |
| 2598 Event_media_galleries_private_onGalleryChanged(jsObject) : super._(jsObject, 1
); |
| 2599 } |
| 2600 |
| 2601 /** |
| 2602 * Functions |
| 2603 */ |
| 2604 |
| 2605 class API_media_galleries_private { |
| 2606 /* |
| 2607 * API connection |
| 2608 */ |
| 2609 Object _jsObject; |
| 2610 |
| 2611 /* |
| 2612 * Events |
| 2613 */ |
| 2614 Event_media_galleries_private_onDeviceAttached onDeviceAttached; |
| 2615 Event_media_galleries_private_onDeviceDetached onDeviceDetached; |
| 2616 Event_media_galleries_private_onGalleryChanged onGalleryChanged; |
| 2617 |
| 2618 /* |
| 2619 * Functions |
| 2620 */ |
| 2621 void addGalleryWatch(int galleryId, void callback(MediagalleriesprivateAddGall
eryWatchResult result)) { |
| 2622 void __proxy_callback(result) { |
| 2623 if (?callback) { |
| 2624 callback(new MediagalleriesprivateAddGalleryWatchResult._proxy(result)); |
| 2625 } |
| 2626 } |
| 2627 JS('void', '#.addGalleryWatch(#, #)', this._jsObject, galleryId, convertDart
ClosureToJS(__proxy_callback, 1)); |
| 2628 } |
| 2629 |
| 2630 void removeGalleryWatch(int galleryId) => JS('void', '#.removeGalleryWatch(#)'
, this._jsObject, galleryId); |
| 2631 |
| 2632 void getAllGalleryWatch(void callback(List<int> galleryIds)) => JS('void', '#.
getAllGalleryWatch(#)', this._jsObject, convertDartClosureToJS(callback, 1)); |
| 2633 |
| 2634 void removeAllGalleryWatch() => JS('void', '#.removeAllGalleryWatch()', this._
jsObject); |
| 2635 |
| 2636 API_media_galleries_private(this._jsObject) { |
| 2637 onDeviceAttached = new Event_media_galleries_private_onDeviceAttached(JS('',
'#.onDeviceAttached', this._jsObject)); |
| 2638 onDeviceDetached = new Event_media_galleries_private_onDeviceDetached(JS('',
'#.onDeviceDetached', this._jsObject)); |
| 2639 onGalleryChanged = new Event_media_galleries_private_onGalleryChanged(JS('',
'#.onGalleryChanged', this._jsObject)); |
| 2640 } |
| 2641 } |
| 2642 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2643 // for details. All rights reserved. Use of this source code is governed by a |
| 2644 // BSD-style license that can be found in the LICENSE file. |
| 2645 |
| 2646 // Generated from namespace: pushMessaging |
| 2647 |
| 2648 |
| 2649 /** |
| 2650 * Types |
| 2651 */ |
| 2652 |
| 2653 class PushmessagingMessage extends ChromeObject { |
| 2654 /* |
| 2655 * Public constructor |
| 2656 */ |
| 2657 PushmessagingMessage({int subchannelId, String payload}) { |
| 2658 if (?subchannelId) |
| 2659 this.subchannelId = subchannelId; |
| 2660 if (?payload) |
| 2661 this.payload = payload; |
| 2662 } |
| 2663 |
| 2664 /* |
| 2665 * Private constructor |
| 2666 */ |
| 2667 PushmessagingMessage._proxy(_jsObject) : super._proxy(_jsObject); |
| 2668 |
| 2669 /* |
| 2670 * Public accessors |
| 2671 */ |
| 2672 /// The subchannel the message was sent on; only values 0-3 are valid. |
| 2673 int get subchannelId => JS('int', '#.subchannelId', this._jsObject); |
| 2674 |
| 2675 void set subchannelId(int subchannelId) { |
| 2676 JS('void', '#.subchannelId = #', this._jsObject, subchannelId); |
| 2677 } |
| 2678 |
| 2679 /// The payload associated with the message, if any. |
| 2680 String get payload => JS('String', '#.payload', this._jsObject); |
| 2681 |
| 2682 void set payload(String payload) { |
| 2683 JS('void', '#.payload = #', this._jsObject, payload); |
| 2684 } |
| 2685 |
| 2686 } |
| 2687 |
| 2688 class PushmessagingChannelIdResult extends ChromeObject { |
| 2689 /* |
| 2690 * Public constructor |
| 2691 */ |
| 2692 PushmessagingChannelIdResult({String channelId}) { |
| 2693 if (?channelId) |
| 2694 this.channelId = channelId; |
| 2695 } |
| 2696 |
| 2697 /* |
| 2698 * Private constructor |
| 2699 */ |
| 2700 PushmessagingChannelIdResult._proxy(_jsObject) : super._proxy(_jsObject); |
| 2701 |
| 2702 /* |
| 2703 * Public accessors |
| 2704 */ |
| 2705 /// The channel ID for this app to use for push messaging. |
| 2706 String get channelId => JS('String', '#.channelId', this._jsObject); |
| 2707 |
| 2708 void set channelId(String channelId) { |
| 2709 JS('void', '#.channelId = #', this._jsObject, channelId); |
| 2710 } |
| 2711 |
| 2712 } |
| 2713 |
| 2714 /** |
| 2715 * Events |
| 2716 */ |
| 2717 |
| 2718 /// Fired when a push message has been received. |
| 2719 class Event_push_messaging_onMessage extends Event { |
| 2720 void addListener(void callback(PushmessagingMessage message)) { |
| 2721 void __proxy_callback(message) { |
| 2722 if (?callback) { |
| 2723 callback(new PushmessagingMessage._proxy(message)); |
| 2724 } |
| 2725 } |
| 2726 super.addListener(callback); |
| 2727 } |
| 2728 |
| 2729 void removeListener(void callback(PushmessagingMessage message)) { |
| 2730 void __proxy_callback(message) { |
| 2731 if (?callback) { |
| 2732 callback(new PushmessagingMessage._proxy(message)); |
| 2733 } |
| 2734 } |
| 2735 super.removeListener(callback); |
| 2736 } |
| 2737 |
| 2738 bool hasListener(void callback(PushmessagingMessage message)) { |
| 2739 void __proxy_callback(message) { |
| 2740 if (?callback) { |
| 2741 callback(new PushmessagingMessage._proxy(message)); |
| 2742 } |
| 2743 } |
| 2744 super.hasListener(callback); |
| 2745 } |
| 2746 |
| 2747 Event_push_messaging_onMessage(jsObject) : super._(jsObject, 1); |
| 2748 } |
| 2749 |
| 2750 /** |
| 2751 * Functions |
| 2752 */ |
| 2753 |
| 2754 class API_push_messaging { |
| 2755 /* |
| 2756 * API connection |
| 2757 */ |
| 2758 Object _jsObject; |
| 2759 |
| 2760 /* |
| 2761 * Events |
| 2762 */ |
| 2763 Event_push_messaging_onMessage onMessage; |
| 2764 |
| 2765 /* |
| 2766 * Functions |
| 2767 */ |
| 2768 /// Retrieves the channel ID associated with this app or extension. Typically |
| 2769 /// an app or extension will want to send this value to its application server |
| 2770 /// so the server can use it to trigger push messages back to the app or |
| 2771 /// extension. If the interactive flag is set, we will ask the user to log in |
| 2772 /// when they are not already logged in. |
| 2773 void getChannelId(void callback(PushmessagingChannelIdResult channelId), [bool
interactive]) { |
| 2774 void __proxy_callback(channelId) { |
| 2775 if (?callback) { |
| 2776 callback(new PushmessagingChannelIdResult._proxy(channelId)); |
| 2777 } |
| 2778 } |
| 2779 JS('void', '#.getChannelId(#, #)', this._jsObject, interactive, convertDartC
losureToJS(__proxy_callback, 1)); |
| 2780 } |
| 2781 |
| 2782 API_push_messaging(this._jsObject) { |
| 2783 onMessage = new Event_push_messaging_onMessage(JS('', '#.onMessage', this._j
sObject)); |
| 2784 } |
| 2785 } |
| 2786 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2787 // for details. All rights reserved. Use of this source code is governed by a |
| 2788 // BSD-style license that can be found in the LICENSE file. |
| 2789 |
| 2790 // Generated from namespace: serial |
| 2791 |
| 2792 |
| 2793 /** |
| 2794 * Types |
| 2795 */ |
| 2796 |
| 2797 class SerialOpenOptions extends ChromeObject { |
| 2798 /* |
| 2799 * Public constructor |
| 2800 */ |
| 2801 SerialOpenOptions({int bitrate}) { |
| 2802 if (?bitrate) |
| 2803 this.bitrate = bitrate; |
| 2804 } |
| 2805 |
| 2806 /* |
| 2807 * Private constructor |
| 2808 */ |
| 2809 SerialOpenOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 2810 |
| 2811 /* |
| 2812 * Public accessors |
| 2813 */ |
| 2814 /// The requested bitrate of the connection to be opened. For compatibility |
| 2815 /// with the widest range of hardware, this number should match one of |
| 2816 /// commonly-available bitrates, such as 110, 300, 1200, 2400, 4800, 9600, |
| 2817 /// 14400, 19200, 38400, 57600, 115200. There is no guarantee, of course, that |
| 2818 /// the device connected to the serial port will support the requested bitrate
, |
| 2819 /// even if the port itself supports that bitrate. |
| 2820 int get bitrate => JS('int', '#.bitrate', this._jsObject); |
| 2821 |
| 2822 void set bitrate(int bitrate) { |
| 2823 JS('void', '#.bitrate = #', this._jsObject, bitrate); |
| 2824 } |
| 2825 |
| 2826 } |
| 2827 |
| 2828 class SerialOpenInfo extends ChromeObject { |
| 2829 /* |
| 2830 * Public constructor |
| 2831 */ |
| 2832 SerialOpenInfo({int connectionId}) { |
| 2833 if (?connectionId) |
| 2834 this.connectionId = connectionId; |
| 2835 } |
| 2836 |
| 2837 /* |
| 2838 * Private constructor |
| 2839 */ |
| 2840 SerialOpenInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 2841 |
| 2842 /* |
| 2843 * Public accessors |
| 2844 */ |
| 2845 /// The id of the opened connection. |
| 2846 int get connectionId => JS('int', '#.connectionId', this._jsObject); |
| 2847 |
| 2848 void set connectionId(int connectionId) { |
| 2849 JS('void', '#.connectionId = #', this._jsObject, connectionId); |
| 2850 } |
| 2851 |
| 2852 } |
| 2853 |
| 2854 class SerialReadInfo extends ChromeObject { |
| 2855 /* |
| 2856 * Public constructor |
| 2857 */ |
| 2858 SerialReadInfo({int bytesRead, String data}) { |
| 2859 if (?bytesRead) |
| 2860 this.bytesRead = bytesRead; |
| 2861 if (?data) |
| 2862 this.data = data; |
| 2863 } |
| 2864 |
| 2865 /* |
| 2866 * Private constructor |
| 2867 */ |
| 2868 SerialReadInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 2869 |
| 2870 /* |
| 2871 * Public accessors |
| 2872 */ |
| 2873 /// The number of bytes received, or a negative number if an error occurred. |
| 2874 /// This number will be smaller than the number of bytes requested in the |
| 2875 /// original read call if the call would need to block to read that number of |
| 2876 /// bytes. |
| 2877 int get bytesRead => JS('int', '#.bytesRead', this._jsObject); |
| 2878 |
| 2879 void set bytesRead(int bytesRead) { |
| 2880 JS('void', '#.bytesRead = #', this._jsObject, bytesRead); |
| 2881 } |
| 2882 |
| 2883 /// The data received. |
| 2884 String get data => JS('String', '#.data', this._jsObject); |
| 2885 |
| 2886 void set data(String data) { |
| 2887 JS('void', '#.data = #', this._jsObject, data); |
| 2888 } |
| 2889 |
| 2890 } |
| 2891 |
| 2892 class SerialWriteInfo extends ChromeObject { |
| 2893 /* |
| 2894 * Public constructor |
| 2895 */ |
| 2896 SerialWriteInfo({int bytesWritten}) { |
| 2897 if (?bytesWritten) |
| 2898 this.bytesWritten = bytesWritten; |
| 2899 } |
| 2900 |
| 2901 /* |
| 2902 * Private constructor |
| 2903 */ |
| 2904 SerialWriteInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 2905 |
| 2906 /* |
| 2907 * Public accessors |
| 2908 */ |
| 2909 /// The number of bytes written. |
| 2910 int get bytesWritten => JS('int', '#.bytesWritten', this._jsObject); |
| 2911 |
| 2912 void set bytesWritten(int bytesWritten) { |
| 2913 JS('void', '#.bytesWritten = #', this._jsObject, bytesWritten); |
| 2914 } |
| 2915 |
| 2916 } |
| 2917 |
| 2918 class SerialControlSignalOptions extends ChromeObject { |
| 2919 /* |
| 2920 * Public constructor |
| 2921 */ |
| 2922 SerialControlSignalOptions({bool dtr, bool rts, bool dcd, bool cts}) { |
| 2923 if (?dtr) |
| 2924 this.dtr = dtr; |
| 2925 if (?rts) |
| 2926 this.rts = rts; |
| 2927 if (?dcd) |
| 2928 this.dcd = dcd; |
| 2929 if (?cts) |
| 2930 this.cts = cts; |
| 2931 } |
| 2932 |
| 2933 /* |
| 2934 * Private constructor |
| 2935 */ |
| 2936 SerialControlSignalOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 2937 |
| 2938 /* |
| 2939 * Public accessors |
| 2940 */ |
| 2941 /// Serial control signals that your machine can send. Missing fields will be |
| 2942 /// set to false. |
| 2943 bool get dtr => JS('bool', '#.dtr', this._jsObject); |
| 2944 |
| 2945 void set dtr(bool dtr) { |
| 2946 JS('void', '#.dtr = #', this._jsObject, dtr); |
| 2947 } |
| 2948 |
| 2949 bool get rts => JS('bool', '#.rts', this._jsObject); |
| 2950 |
| 2951 void set rts(bool rts) { |
| 2952 JS('void', '#.rts = #', this._jsObject, rts); |
| 2953 } |
| 2954 |
| 2955 /// Serial control signals that your machine can receive. If a get operation |
| 2956 /// fails, success will be false, and these fields will be absent.<br/><br/> |
| 2957 /// DCD (Data Carrier Detect) is equivalent to RLSD (Receive Line Signal |
| 2958 /// Detect) on some platforms. |
| 2959 bool get dcd => JS('bool', '#.dcd', this._jsObject); |
| 2960 |
| 2961 void set dcd(bool dcd) { |
| 2962 JS('void', '#.dcd = #', this._jsObject, dcd); |
| 2963 } |
| 2964 |
| 2965 bool get cts => JS('bool', '#.cts', this._jsObject); |
| 2966 |
| 2967 void set cts(bool cts) { |
| 2968 JS('void', '#.cts = #', this._jsObject, cts); |
| 2969 } |
| 2970 |
| 2971 } |
| 2972 |
| 2973 /** |
| 2974 * Functions |
| 2975 */ |
| 2976 |
| 2977 class API_serial { |
| 2978 /* |
| 2979 * API connection |
| 2980 */ |
| 2981 Object _jsObject; |
| 2982 |
| 2983 /* |
| 2984 * Functions |
| 2985 */ |
| 2986 /// Returns names of valid ports on this machine, each of which is likely to b
e |
| 2987 /// valid to pass as the port argument to open(). The list is regenerated each |
| 2988 /// time this method is called, as port validity is dynamic. |
| 2989 void getPorts(void callback(List<String> ports)) => JS('void', '#.getPorts(#)'
, this._jsObject, convertDartClosureToJS(callback, 1)); |
| 2990 |
| 2991 /// Opens a connection to the given serial port. |
| 2992 void open(String port, void callback(SerialOpenInfo openInfo), [SerialOpenOpti
ons options]) { |
| 2993 void __proxy_callback(openInfo) { |
| 2994 if (?callback) { |
| 2995 callback(new SerialOpenInfo._proxy(openInfo)); |
| 2996 } |
| 2997 } |
| 2998 JS('void', '#.open(#, #, #)', this._jsObject, port, convertArgument(options)
, convertDartClosureToJS(__proxy_callback, 1)); |
| 2999 } |
| 3000 |
| 3001 /// Closes an open connection. |
| 3002 void close(int connectionId, void callback(bool result)) => JS('void', '#.clos
e(#, #)', this._jsObject, connectionId, convertDartClosureToJS(callback, 1)); |
| 3003 |
| 3004 /// Reads a byte from the given connection. |
| 3005 void read(int connectionId, int bytesToRead, void callback(SerialReadInfo read
Info)) { |
| 3006 void __proxy_callback(readInfo) { |
| 3007 if (?callback) { |
| 3008 callback(new SerialReadInfo._proxy(readInfo)); |
| 3009 } |
| 3010 } |
| 3011 JS('void', '#.read(#, #, #)', this._jsObject, connectionId, bytesToRead, con
vertDartClosureToJS(__proxy_callback, 1)); |
| 3012 } |
| 3013 |
| 3014 /// Writes a string to the given connection. |
| 3015 void write(int connectionId, String data, void callback(SerialWriteInfo writeI
nfo)) { |
| 3016 void __proxy_callback(writeInfo) { |
| 3017 if (?callback) { |
| 3018 callback(new SerialWriteInfo._proxy(writeInfo)); |
| 3019 } |
| 3020 } |
| 3021 JS('void', '#.write(#, #, #)', this._jsObject, connectionId, data, convertDa
rtClosureToJS(__proxy_callback, 1)); |
| 3022 } |
| 3023 |
| 3024 /// Flushes all bytes in the given connection's input and output buffers. |
| 3025 void flush(int connectionId, void callback(bool result)) => JS('void', '#.flus
h(#, #)', this._jsObject, connectionId, convertDartClosureToJS(callback, 1)); |
| 3026 |
| 3027 void getControlSignals(int connectionId, void callback(SerialControlSignalOpti
ons options)) { |
| 3028 void __proxy_callback(options) { |
| 3029 if (?callback) { |
| 3030 callback(new SerialControlSignalOptions._proxy(options)); |
| 3031 } |
| 3032 } |
| 3033 JS('void', '#.getControlSignals(#, #)', this._jsObject, connectionId, conver
tDartClosureToJS(__proxy_callback, 1)); |
| 3034 } |
| 3035 |
| 3036 void setControlSignals(int connectionId, SerialControlSignalOptions options, v
oid callback(bool result)) => JS('void', '#.setControlSignals(#, #, #)', this._j
sObject, connectionId, convertArgument(options), convertDartClosureToJS(callback
, 1)); |
| 3037 |
| 3038 API_serial(this._jsObject) { |
| 3039 } |
| 3040 } |
| 3041 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 3042 // for details. All rights reserved. Use of this source code is governed by a |
| 3043 // BSD-style license that can be found in the LICENSE file. |
| 3044 |
| 3045 // Generated from namespace: socket |
| 3046 |
| 3047 |
| 3048 /** |
| 3049 * Types |
| 3050 */ |
| 3051 |
| 3052 class SocketCreateOptions extends ChromeObject { |
| 3053 /* |
| 3054 * Public constructor |
| 3055 */ |
| 3056 SocketCreateOptions({}) { |
| 3057 } |
| 3058 |
| 3059 /* |
| 3060 * Private constructor |
| 3061 */ |
| 3062 SocketCreateOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 3063 } |
| 3064 |
| 3065 class SocketCreateInfo extends ChromeObject { |
| 3066 /* |
| 3067 * Public constructor |
| 3068 */ |
| 3069 SocketCreateInfo({int socketId}) { |
| 3070 if (?socketId) |
| 3071 this.socketId = socketId; |
| 3072 } |
| 3073 |
| 3074 /* |
| 3075 * Private constructor |
| 3076 */ |
| 3077 SocketCreateInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 3078 |
| 3079 /* |
| 3080 * Public accessors |
| 3081 */ |
| 3082 /// The id of the newly created socket. |
| 3083 int get socketId => JS('int', '#.socketId', this._jsObject); |
| 3084 |
| 3085 void set socketId(int socketId) { |
| 3086 JS('void', '#.socketId = #', this._jsObject, socketId); |
| 3087 } |
| 3088 |
| 3089 } |
| 3090 |
| 3091 class SocketAcceptInfo extends ChromeObject { |
| 3092 /* |
| 3093 * Public constructor |
| 3094 */ |
| 3095 SocketAcceptInfo({int resultCode, int socketId}) { |
| 3096 if (?resultCode) |
| 3097 this.resultCode = resultCode; |
| 3098 if (?socketId) |
| 3099 this.socketId = socketId; |
| 3100 } |
| 3101 |
| 3102 /* |
| 3103 * Private constructor |
| 3104 */ |
| 3105 SocketAcceptInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 3106 |
| 3107 /* |
| 3108 * Public accessors |
| 3109 */ |
| 3110 int get resultCode => JS('int', '#.resultCode', this._jsObject); |
| 3111 |
| 3112 void set resultCode(int resultCode) { |
| 3113 JS('void', '#.resultCode = #', this._jsObject, resultCode); |
| 3114 } |
| 3115 |
| 3116 /// The id of the accepted socket. |
| 3117 int get socketId => JS('int', '#.socketId', this._jsObject); |
| 3118 |
| 3119 void set socketId(int socketId) { |
| 3120 JS('void', '#.socketId = #', this._jsObject, socketId); |
| 3121 } |
| 3122 |
| 3123 } |
| 3124 |
| 3125 class SocketReadInfo extends ChromeObject { |
| 3126 /* |
| 3127 * Public constructor |
| 3128 */ |
| 3129 SocketReadInfo({int resultCode, String data}) { |
| 3130 if (?resultCode) |
| 3131 this.resultCode = resultCode; |
| 3132 if (?data) |
| 3133 this.data = data; |
| 3134 } |
| 3135 |
| 3136 /* |
| 3137 * Private constructor |
| 3138 */ |
| 3139 SocketReadInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 3140 |
| 3141 /* |
| 3142 * Public accessors |
| 3143 */ |
| 3144 /// The resultCode returned from the underlying read() call. |
| 3145 int get resultCode => JS('int', '#.resultCode', this._jsObject); |
| 3146 |
| 3147 void set resultCode(int resultCode) { |
| 3148 JS('void', '#.resultCode = #', this._jsObject, resultCode); |
| 3149 } |
| 3150 |
| 3151 String get data => JS('String', '#.data', this._jsObject); |
| 3152 |
| 3153 void set data(String data) { |
| 3154 JS('void', '#.data = #', this._jsObject, data); |
| 3155 } |
| 3156 |
| 3157 } |
| 3158 |
| 3159 class SocketWriteInfo extends ChromeObject { |
| 3160 /* |
| 3161 * Public constructor |
| 3162 */ |
| 3163 SocketWriteInfo({int bytesWritten}) { |
| 3164 if (?bytesWritten) |
| 3165 this.bytesWritten = bytesWritten; |
| 3166 } |
| 3167 |
| 3168 /* |
| 3169 * Private constructor |
| 3170 */ |
| 3171 SocketWriteInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 3172 |
| 3173 /* |
| 3174 * Public accessors |
| 3175 */ |
| 3176 /// The number of bytes sent, or a negative error code. |
| 3177 int get bytesWritten => JS('int', '#.bytesWritten', this._jsObject); |
| 3178 |
| 3179 void set bytesWritten(int bytesWritten) { |
| 3180 JS('void', '#.bytesWritten = #', this._jsObject, bytesWritten); |
| 3181 } |
| 3182 |
| 3183 } |
| 3184 |
| 3185 class SocketRecvFromInfo extends ChromeObject { |
| 3186 /* |
| 3187 * Public constructor |
| 3188 */ |
| 3189 SocketRecvFromInfo({int resultCode, String data, String address, int port}) { |
| 3190 if (?resultCode) |
| 3191 this.resultCode = resultCode; |
| 3192 if (?data) |
| 3193 this.data = data; |
| 3194 if (?address) |
| 3195 this.address = address; |
| 3196 if (?port) |
| 3197 this.port = port; |
| 3198 } |
| 3199 |
| 3200 /* |
| 3201 * Private constructor |
| 3202 */ |
| 3203 SocketRecvFromInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 3204 |
| 3205 /* |
| 3206 * Public accessors |
| 3207 */ |
| 3208 /// The resultCode returned from the underlying recvfrom() call. |
| 3209 int get resultCode => JS('int', '#.resultCode', this._jsObject); |
| 3210 |
| 3211 void set resultCode(int resultCode) { |
| 3212 JS('void', '#.resultCode = #', this._jsObject, resultCode); |
| 3213 } |
| 3214 |
| 3215 String get data => JS('String', '#.data', this._jsObject); |
| 3216 |
| 3217 void set data(String data) { |
| 3218 JS('void', '#.data = #', this._jsObject, data); |
| 3219 } |
| 3220 |
| 3221 /// The address of the remote machine. |
| 3222 String get address => JS('String', '#.address', this._jsObject); |
| 3223 |
| 3224 void set address(String address) { |
| 3225 JS('void', '#.address = #', this._jsObject, address); |
| 3226 } |
| 3227 |
| 3228 int get port => JS('int', '#.port', this._jsObject); |
| 3229 |
| 3230 void set port(int port) { |
| 3231 JS('void', '#.port = #', this._jsObject, port); |
| 3232 } |
| 3233 |
| 3234 } |
| 3235 |
| 3236 class SocketSocketInfo extends ChromeObject { |
| 3237 /* |
| 3238 * Public constructor |
| 3239 */ |
| 3240 SocketSocketInfo({String socketType, bool connected, String peerAddress, int p
eerPort, String localAddress, int localPort}) { |
| 3241 if (?socketType) |
| 3242 this.socketType = socketType; |
| 3243 if (?connected) |
| 3244 this.connected = connected; |
| 3245 if (?peerAddress) |
| 3246 this.peerAddress = peerAddress; |
| 3247 if (?peerPort) |
| 3248 this.peerPort = peerPort; |
| 3249 if (?localAddress) |
| 3250 this.localAddress = localAddress; |
| 3251 if (?localPort) |
| 3252 this.localPort = localPort; |
| 3253 } |
| 3254 |
| 3255 /* |
| 3256 * Private constructor |
| 3257 */ |
| 3258 SocketSocketInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 3259 |
| 3260 /* |
| 3261 * Public accessors |
| 3262 */ |
| 3263 /// The type of the passed socket. This will be <code>tcp</code> or |
| 3264 /// <code>udp</code>. |
| 3265 String get socketType => JS('String', '#.socketType', this._jsObject); |
| 3266 |
| 3267 void set socketType(String socketType) { |
| 3268 JS('void', '#.socketType = #', this._jsObject, socketType); |
| 3269 } |
| 3270 |
| 3271 /// Whether or not the underlying socket is connected.<br/><br/> For |
| 3272 /// <code>tcp</code> sockets, this will remain true even if the remote peer ha
s |
| 3273 /// disconnected. Reading or writing to the socket may then result in an error
, |
| 3274 /// hinting that this socket should be disconnected via |
| 3275 /// <code>disconnect()</code>.<br/><br/> For <code>udp</code> sockets, this |
| 3276 /// just represents whether a default remote address has been specified for |
| 3277 /// reading and writing packets. |
| 3278 bool get connected => JS('bool', '#.connected', this._jsObject); |
| 3279 |
| 3280 void set connected(bool connected) { |
| 3281 JS('void', '#.connected = #', this._jsObject, connected); |
| 3282 } |
| 3283 |
| 3284 /// If the underlying socket is connected, contains the IPv4/6 address of the |
| 3285 /// peer. |
| 3286 String get peerAddress => JS('String', '#.peerAddress', this._jsObject); |
| 3287 |
| 3288 void set peerAddress(String peerAddress) { |
| 3289 JS('void', '#.peerAddress = #', this._jsObject, peerAddress); |
| 3290 } |
| 3291 |
| 3292 /// If the underlying socket is connected, contains the port of the connected |
| 3293 /// peer. |
| 3294 int get peerPort => JS('int', '#.peerPort', this._jsObject); |
| 3295 |
| 3296 void set peerPort(int peerPort) { |
| 3297 JS('void', '#.peerPort = #', this._jsObject, peerPort); |
| 3298 } |
| 3299 |
| 3300 /// If the underlying socket is bound or connected, contains its local IPv4/6 |
| 3301 /// address. |
| 3302 String get localAddress => JS('String', '#.localAddress', this._jsObject); |
| 3303 |
| 3304 void set localAddress(String localAddress) { |
| 3305 JS('void', '#.localAddress = #', this._jsObject, localAddress); |
| 3306 } |
| 3307 |
| 3308 /// If the underlying socket is bound or connected, contains its local port. |
| 3309 int get localPort => JS('int', '#.localPort', this._jsObject); |
| 3310 |
| 3311 void set localPort(int localPort) { |
| 3312 JS('void', '#.localPort = #', this._jsObject, localPort); |
| 3313 } |
| 3314 |
| 3315 } |
| 3316 |
| 3317 class SocketNetworkInterface extends ChromeObject { |
| 3318 /* |
| 3319 * Public constructor |
| 3320 */ |
| 3321 SocketNetworkInterface({String name, String address}) { |
| 3322 if (?name) |
| 3323 this.name = name; |
| 3324 if (?address) |
| 3325 this.address = address; |
| 3326 } |
| 3327 |
| 3328 /* |
| 3329 * Private constructor |
| 3330 */ |
| 3331 SocketNetworkInterface._proxy(_jsObject) : super._proxy(_jsObject); |
| 3332 |
| 3333 /* |
| 3334 * Public accessors |
| 3335 */ |
| 3336 /// The underlying name of the adapter. On *nix, this will typically be "eth0"
, |
| 3337 /// "lo", etc. |
| 3338 String get name => JS('String', '#.name', this._jsObject); |
| 3339 |
| 3340 void set name(String name) { |
| 3341 JS('void', '#.name = #', this._jsObject, name); |
| 3342 } |
| 3343 |
| 3344 /// The available IPv4/6 address. |
| 3345 String get address => JS('String', '#.address', this._jsObject); |
| 3346 |
| 3347 void set address(String address) { |
| 3348 JS('void', '#.address = #', this._jsObject, address); |
| 3349 } |
| 3350 |
| 3351 } |
| 3352 |
| 3353 /** |
| 3354 * Functions |
| 3355 */ |
| 3356 |
| 3357 class API_socket { |
| 3358 /* |
| 3359 * API connection |
| 3360 */ |
| 3361 Object _jsObject; |
| 3362 |
| 3363 /* |
| 3364 * Functions |
| 3365 */ |
| 3366 /// Creates a socket of the specified type that will connect to the specified |
| 3367 /// remote machine. |
| 3368 void create(String type, void callback(SocketCreateInfo createInfo), [SocketCr
eateOptions options]) { |
| 3369 void __proxy_callback(createInfo) { |
| 3370 if (?callback) { |
| 3371 callback(new SocketCreateInfo._proxy(createInfo)); |
| 3372 } |
| 3373 } |
| 3374 JS('void', '#.create(#, #, #)', this._jsObject, type, convertArgument(option
s), convertDartClosureToJS(__proxy_callback, 1)); |
| 3375 } |
| 3376 |
| 3377 /// Destroys the socket. Each socket created should be destroyed after use. |
| 3378 void destroy(int socketId) => JS('void', '#.destroy(#)', this._jsObject, socke
tId); |
| 3379 |
| 3380 /// Connects the socket to the remote machine (for a <code>tcp</code> socket). |
| 3381 /// For a <code>udp</code> socket, this sets the default address which packets |
| 3382 /// are sent to and read from for <code>read()</code> and <code>write()</code> |
| 3383 /// calls. |
| 3384 void connect(int socketId, String hostname, int port, void callback(int result
)) => JS('void', '#.connect(#, #, #, #)', this._jsObject, socketId, hostname, po
rt, convertDartClosureToJS(callback, 1)); |
| 3385 |
| 3386 /// Binds the local address for socket. Currently, it does not support TCP |
| 3387 /// socket. |
| 3388 void bind(int socketId, String address, int port, void callback(int result)) =
> JS('void', '#.bind(#, #, #, #)', this._jsObject, socketId, address, port, conv
ertDartClosureToJS(callback, 1)); |
| 3389 |
| 3390 /// Disconnects the socket. For UDP sockets, <code>disconnect</code> is a |
| 3391 /// non-operation but is safe to call. |
| 3392 void disconnect(int socketId) => JS('void', '#.disconnect(#)', this._jsObject,
socketId); |
| 3393 |
| 3394 /// Reads data from the given connected socket. |
| 3395 void read(int socketId, void callback(SocketReadInfo readInfo), [int bufferSiz
e]) { |
| 3396 void __proxy_callback(readInfo) { |
| 3397 if (?callback) { |
| 3398 callback(new SocketReadInfo._proxy(readInfo)); |
| 3399 } |
| 3400 } |
| 3401 JS('void', '#.read(#, #, #)', this._jsObject, socketId, bufferSize, convertD
artClosureToJS(__proxy_callback, 1)); |
| 3402 } |
| 3403 |
| 3404 /// Writes data on the given connected socket. |
| 3405 void write(int socketId, String data, void callback(SocketWriteInfo writeInfo)
) { |
| 3406 void __proxy_callback(writeInfo) { |
| 3407 if (?callback) { |
| 3408 callback(new SocketWriteInfo._proxy(writeInfo)); |
| 3409 } |
| 3410 } |
| 3411 JS('void', '#.write(#, #, #)', this._jsObject, socketId, data, convertDartCl
osureToJS(__proxy_callback, 1)); |
| 3412 } |
| 3413 |
| 3414 /// Receives data from the given UDP socket. |
| 3415 void recvFrom(int socketId, void callback(SocketRecvFromInfo recvFromInfo), [i
nt bufferSize]) { |
| 3416 void __proxy_callback(recvFromInfo) { |
| 3417 if (?callback) { |
| 3418 callback(new SocketRecvFromInfo._proxy(recvFromInfo)); |
| 3419 } |
| 3420 } |
| 3421 JS('void', '#.recvFrom(#, #, #)', this._jsObject, socketId, bufferSize, conv
ertDartClosureToJS(__proxy_callback, 1)); |
| 3422 } |
| 3423 |
| 3424 /// Sends data on the given UDP socket to the given address and port. |
| 3425 void sendTo(int socketId, String data, String address, int port, void callback
(SocketWriteInfo writeInfo)) { |
| 3426 void __proxy_callback(writeInfo) { |
| 3427 if (?callback) { |
| 3428 callback(new SocketWriteInfo._proxy(writeInfo)); |
| 3429 } |
| 3430 } |
| 3431 JS('void', '#.sendTo(#, #, #, #, #)', this._jsObject, socketId, data, addres
s, port, convertDartClosureToJS(__proxy_callback, 1)); |
| 3432 } |
| 3433 |
| 3434 /// This method applies to TCP sockets only. Listens for connections on the |
| 3435 /// specified port and address. This effectively makes this a server socket, |
| 3436 /// and client socket functions (connect, read, write) can no longer be used o
n |
| 3437 /// this socket. |
| 3438 void listen(int socketId, String address, int port, void callback(int result),
[int backlog]) => JS('void', '#.listen(#, #, #, #, #)', this._jsObject, socketI
d, address, port, backlog, convertDartClosureToJS(callback, 1)); |
| 3439 |
| 3440 /// This method applies to TCP sockets only. Registers a callback function to |
| 3441 /// be called when a connection is accepted on this listening server socket. |
| 3442 /// Listen must be called first. If there is already an active accept callback
, |
| 3443 /// this callback will be invoked immediately with an error as the resultCode. |
| 3444 void accept(int socketId, void callback(SocketAcceptInfo acceptInfo)) { |
| 3445 void __proxy_callback(acceptInfo) { |
| 3446 if (?callback) { |
| 3447 callback(new SocketAcceptInfo._proxy(acceptInfo)); |
| 3448 } |
| 3449 } |
| 3450 JS('void', '#.accept(#, #)', this._jsObject, socketId, convertDartClosureToJ
S(__proxy_callback, 1)); |
| 3451 } |
| 3452 |
| 3453 /// Enables or disables the keep-alive functionality for a TCP connection. |
| 3454 void setKeepAlive(int socketId, bool enable, void callback(bool result), [int
delay]) => JS('void', '#.setKeepAlive(#, #, #, #)', this._jsObject, socketId, en
able, delay, convertDartClosureToJS(callback, 1)); |
| 3455 |
| 3456 /// Sets or clears <code>TCP_NODELAY</code> for a TCP connection. Nagle's |
| 3457 /// algorithm will be disabled when <code>TCP_NODELAY</code> is set. |
| 3458 void setNoDelay(int socketId, bool noDelay, void callback(bool result)) => JS(
'void', '#.setNoDelay(#, #, #)', this._jsObject, socketId, noDelay, convertDartC
losureToJS(callback, 1)); |
| 3459 |
| 3460 /// Retrieves the state of the given socket. |
| 3461 void getInfo(int socketId, void callback(SocketSocketInfo result)) { |
| 3462 void __proxy_callback(result) { |
| 3463 if (?callback) { |
| 3464 callback(new SocketSocketInfo._proxy(result)); |
| 3465 } |
| 3466 } |
| 3467 JS('void', '#.getInfo(#, #)', this._jsObject, socketId, convertDartClosureTo
JS(__proxy_callback, 1)); |
| 3468 } |
| 3469 |
| 3470 /// Retrieves information about local adapters on this system. |
| 3471 void getNetworkList(void callback(List<SocketNetworkInterface> result)) { |
| 3472 void __proxy_callback(result) { |
| 3473 if (?callback) { |
| 3474 List<SocketNetworkInterface> __proxy_result = new List<SocketNetworkInte
rface>(); |
| 3475 for (var o in result) { |
| 3476 __proxy_result.add(new SocketNetworkInterface._proxy(o)); |
| 3477 } |
| 3478 callback(__proxy_result); |
| 3479 } |
| 3480 } |
| 3481 JS('void', '#.getNetworkList(#)', this._jsObject, convertDartClosureToJS(__p
roxy_callback, 1)); |
| 3482 } |
| 3483 |
| 3484 API_socket(this._jsObject) { |
| 3485 } |
| 3486 } |
| 3487 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 3488 // for details. All rights reserved. Use of this source code is governed by a |
| 3489 // BSD-style license that can be found in the LICENSE file. |
| 3490 |
| 3491 // Generated from namespace: syncFileSystem |
| 3492 |
| 3493 |
| 3494 /** |
| 3495 * Types |
| 3496 */ |
| 3497 |
| 3498 class SyncfilesystemFileInfo extends ChromeObject { |
| 3499 /* |
| 3500 * Public constructor |
| 3501 */ |
| 3502 SyncfilesystemFileInfo({FileEntry fileEntry, String status, String action, Str
ing direction}) { |
| 3503 if (?fileEntry) |
| 3504 this.fileEntry = fileEntry; |
| 3505 if (?status) |
| 3506 this.status = status; |
| 3507 if (?action) |
| 3508 this.action = action; |
| 3509 if (?direction) |
| 3510 this.direction = direction; |
| 3511 } |
| 3512 |
| 3513 /* |
| 3514 * Private constructor |
| 3515 */ |
| 3516 SyncfilesystemFileInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 3517 |
| 3518 /* |
| 3519 * Public accessors |
| 3520 */ |
| 3521 /// |fileEntry| will contain name and path information of synchronized file. O
n |
| 3522 /// file deletion, fileEntry information will still be available but file will |
| 3523 /// no longer exist. |
| 3524 FileEntry get fileEntry => JS('FileEntry', '#.fileEntry', this._jsObject); |
| 3525 |
| 3526 void set fileEntry(FileEntry fileEntry) { |
| 3527 JS('void', '#.fileEntry = #', this._jsObject, convertArgument(fileEntry)); |
| 3528 } |
| 3529 |
| 3530 String get status => JS('String', '#.status', this._jsObject); |
| 3531 |
| 3532 void set status(String status) { |
| 3533 JS('void', '#.status = #', this._jsObject, status); |
| 3534 } |
| 3535 |
| 3536 /// Only applies if status is synced. |
| 3537 String get action => JS('String', '#.action', this._jsObject); |
| 3538 |
| 3539 void set action(String action) { |
| 3540 JS('void', '#.action = #', this._jsObject, action); |
| 3541 } |
| 3542 |
| 3543 /// Only applies if status is synced. |
| 3544 String get direction => JS('String', '#.direction', this._jsObject); |
| 3545 |
| 3546 void set direction(String direction) { |
| 3547 JS('void', '#.direction = #', this._jsObject, direction); |
| 3548 } |
| 3549 |
| 3550 } |
| 3551 |
| 3552 class SyncfilesystemStorageInfo extends ChromeObject { |
| 3553 /* |
| 3554 * Public constructor |
| 3555 */ |
| 3556 SyncfilesystemStorageInfo({int usageBytes, int quotaBytes}) { |
| 3557 if (?usageBytes) |
| 3558 this.usageBytes = usageBytes; |
| 3559 if (?quotaBytes) |
| 3560 this.quotaBytes = quotaBytes; |
| 3561 } |
| 3562 |
| 3563 /* |
| 3564 * Private constructor |
| 3565 */ |
| 3566 SyncfilesystemStorageInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 3567 |
| 3568 /* |
| 3569 * Public accessors |
| 3570 */ |
| 3571 int get usageBytes => JS('int', '#.usageBytes', this._jsObject); |
| 3572 |
| 3573 void set usageBytes(int usageBytes) { |
| 3574 JS('void', '#.usageBytes = #', this._jsObject, usageBytes); |
| 3575 } |
| 3576 |
| 3577 int get quotaBytes => JS('int', '#.quotaBytes', this._jsObject); |
| 3578 |
| 3579 void set quotaBytes(int quotaBytes) { |
| 3580 JS('void', '#.quotaBytes = #', this._jsObject, quotaBytes); |
| 3581 } |
| 3582 |
| 3583 } |
| 3584 |
| 3585 class SyncfilesystemServiceInfo extends ChromeObject { |
| 3586 /* |
| 3587 * Public constructor |
| 3588 */ |
| 3589 SyncfilesystemServiceInfo({String state, String description}) { |
| 3590 if (?state) |
| 3591 this.state = state; |
| 3592 if (?description) |
| 3593 this.description = description; |
| 3594 } |
| 3595 |
| 3596 /* |
| 3597 * Private constructor |
| 3598 */ |
| 3599 SyncfilesystemServiceInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 3600 |
| 3601 /* |
| 3602 * Public accessors |
| 3603 */ |
| 3604 String get state => JS('String', '#.state', this._jsObject); |
| 3605 |
| 3606 void set state(String state) { |
| 3607 JS('void', '#.state = #', this._jsObject, state); |
| 3608 } |
| 3609 |
| 3610 String get description => JS('String', '#.description', this._jsObject); |
| 3611 |
| 3612 void set description(String description) { |
| 3613 JS('void', '#.description = #', this._jsObject, description); |
| 3614 } |
| 3615 |
| 3616 } |
| 3617 |
| 3618 /** |
| 3619 * Events |
| 3620 */ |
| 3621 |
| 3622 /// Fired when an error or other status change has happened in the sync |
| 3623 /// backend. (e.g. the sync is temporarily disabled due to network or |
| 3624 /// authentication error etc). |
| 3625 class Event_sync_file_system_onServiceStatusChanged extends Event { |
| 3626 void addListener(void callback(SyncfilesystemServiceInfo detail)) { |
| 3627 void __proxy_callback(detail) { |
| 3628 if (?callback) { |
| 3629 callback(new SyncfilesystemServiceInfo._proxy(detail)); |
| 3630 } |
| 3631 } |
| 3632 super.addListener(callback); |
| 3633 } |
| 3634 |
| 3635 void removeListener(void callback(SyncfilesystemServiceInfo detail)) { |
| 3636 void __proxy_callback(detail) { |
| 3637 if (?callback) { |
| 3638 callback(new SyncfilesystemServiceInfo._proxy(detail)); |
| 3639 } |
| 3640 } |
| 3641 super.removeListener(callback); |
| 3642 } |
| 3643 |
| 3644 bool hasListener(void callback(SyncfilesystemServiceInfo detail)) { |
| 3645 void __proxy_callback(detail) { |
| 3646 if (?callback) { |
| 3647 callback(new SyncfilesystemServiceInfo._proxy(detail)); |
| 3648 } |
| 3649 } |
| 3650 super.hasListener(callback); |
| 3651 } |
| 3652 |
| 3653 Event_sync_file_system_onServiceStatusChanged(jsObject) : super._(jsObject, 1)
; |
| 3654 } |
| 3655 |
| 3656 /// Fired when a file has been updated by the background sync service. |
| 3657 class Event_sync_file_system_onFileStatusChanged extends Event { |
| 3658 void addListener(void callback(SyncfilesystemFileInfo detail)) { |
| 3659 void __proxy_callback(detail) { |
| 3660 if (?callback) { |
| 3661 callback(new SyncfilesystemFileInfo._proxy(detail)); |
| 3662 } |
| 3663 } |
| 3664 super.addListener(callback); |
| 3665 } |
| 3666 |
| 3667 void removeListener(void callback(SyncfilesystemFileInfo detail)) { |
| 3668 void __proxy_callback(detail) { |
| 3669 if (?callback) { |
| 3670 callback(new SyncfilesystemFileInfo._proxy(detail)); |
| 3671 } |
| 3672 } |
| 3673 super.removeListener(callback); |
| 3674 } |
| 3675 |
| 3676 bool hasListener(void callback(SyncfilesystemFileInfo detail)) { |
| 3677 void __proxy_callback(detail) { |
| 3678 if (?callback) { |
| 3679 callback(new SyncfilesystemFileInfo._proxy(detail)); |
| 3680 } |
| 3681 } |
| 3682 super.hasListener(callback); |
| 3683 } |
| 3684 |
| 3685 Event_sync_file_system_onFileStatusChanged(jsObject) : super._(jsObject, 1); |
| 3686 } |
| 3687 |
| 3688 /** |
| 3689 * Functions |
| 3690 */ |
| 3691 |
| 3692 class API_sync_file_system { |
| 3693 /* |
| 3694 * API connection |
| 3695 */ |
| 3696 Object _jsObject; |
| 3697 |
| 3698 /* |
| 3699 * Events |
| 3700 */ |
| 3701 Event_sync_file_system_onServiceStatusChanged onServiceStatusChanged; |
| 3702 Event_sync_file_system_onFileStatusChanged onFileStatusChanged; |
| 3703 |
| 3704 /* |
| 3705 * Functions |
| 3706 */ |
| 3707 /// Returns a syncable filesystem backed by Google Drive. The returned |
| 3708 /// DOMFileSystem instance can be operated on in the same way as the Temporary |
| 3709 /// and Persistant file systems. (http://www.w3.org/TR/file-system-api/). |
| 3710 /// Calling this multiple times from the same app will return the same handle |
| 3711 /// to the same file system. |
| 3712 void requestFileSystem(void callback(DOMFileSystem fileSystem)) { |
| 3713 void __proxy_callback(fileSystem) { |
| 3714 if (?callback) { |
| 3715 callback(fileSystem); |
| 3716 } |
| 3717 } |
| 3718 JS('void', '#.requestFileSystem(#)', this._jsObject, convertDartClosureToJS(
__proxy_callback, 1)); |
| 3719 } |
| 3720 |
| 3721 /// Get usage and quota in bytes for sync file system with |serviceName|. |
| 3722 void getUsageAndQuota(DOMFileSystem fileSystem, void callback(SyncfilesystemSt
orageInfo info)) { |
| 3723 void __proxy_callback(info) { |
| 3724 if (?callback) { |
| 3725 callback(new SyncfilesystemStorageInfo._proxy(info)); |
| 3726 } |
| 3727 } |
| 3728 JS('void', '#.getUsageAndQuota(#, #)', this._jsObject, convertArgument(fileS
ystem), convertDartClosureToJS(__proxy_callback, 1)); |
| 3729 } |
| 3730 |
| 3731 /// Deletes everything in the syncable filesystem. |
| 3732 void deleteFileSystem(DOMFileSystem fileSystem, void callback(bool result)) =>
JS('void', '#.deleteFileSystem(#, #)', this._jsObject, convertArgument(fileSyst
em), convertDartClosureToJS(callback, 1)); |
| 3733 |
| 3734 /// Get the FileStatus for the given |fileEntry|. |
| 3735 void getFileStatus(FileEntry fileEntry, void callback(String status)) => JS('v
oid', '#.getFileStatus(#, #)', this._jsObject, convertArgument(fileEntry), conve
rtDartClosureToJS(callback, 1)); |
| 3736 |
| 3737 API_sync_file_system(this._jsObject) { |
| 3738 onServiceStatusChanged = new Event_sync_file_system_onServiceStatusChanged(J
S('', '#.onServiceStatusChanged', this._jsObject)); |
| 3739 onFileStatusChanged = new Event_sync_file_system_onFileStatusChanged(JS('',
'#.onFileStatusChanged', this._jsObject)); |
| 3740 } |
| 3741 } |
| 3742 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 3743 // for details. All rights reserved. Use of this source code is governed by a |
| 3744 // BSD-style license that can be found in the LICENSE file. |
| 3745 |
| 3746 // Generated from namespace: systemIndicator |
| 3747 |
| 3748 |
| 3749 /** |
| 3750 * Types |
| 3751 */ |
| 3752 |
| 3753 class SystemindicatorSetIconDetails extends ChromeObject { |
| 3754 /* |
| 3755 * Public constructor |
| 3756 */ |
| 3757 SystemindicatorSetIconDetails({Object path, Object imageData}) { |
| 3758 if (?path) |
| 3759 this.path = path; |
| 3760 if (?imageData) |
| 3761 this.imageData = imageData; |
| 3762 } |
| 3763 |
| 3764 /* |
| 3765 * Private constructor |
| 3766 */ |
| 3767 SystemindicatorSetIconDetails._proxy(_jsObject) : super._proxy(_jsObject); |
| 3768 |
| 3769 /* |
| 3770 * Public accessors |
| 3771 */ |
| 3772 Object get path => JS('Object', '#.path', this._jsObject); |
| 3773 |
| 3774 void set path(Object path) { |
| 3775 JS('void', '#.path = #', this._jsObject, convertArgument(path)); |
| 3776 } |
| 3777 |
| 3778 Object get imageData => JS('Object', '#.imageData', this._jsObject); |
| 3779 |
| 3780 void set imageData(Object imageData) { |
| 3781 JS('void', '#.imageData = #', this._jsObject, convertArgument(imageData)); |
| 3782 } |
| 3783 |
| 3784 } |
| 3785 |
| 3786 /** |
| 3787 * Events |
| 3788 */ |
| 3789 |
| 3790 /// Fired only when a click on the icon does not result in a menu being shown. |
| 3791 class Event_system_indicator_onClicked extends Event { |
| 3792 void addListener(void callback()) => super.addListener(callback); |
| 3793 |
| 3794 void removeListener(void callback()) => super.removeListener(callback); |
| 3795 |
| 3796 bool hasListener(void callback()) => super.hasListener(callback); |
| 3797 |
| 3798 Event_system_indicator_onClicked(jsObject) : super._(jsObject, 0); |
| 3799 } |
| 3800 |
| 3801 /** |
| 3802 * Functions |
| 3803 */ |
| 3804 |
| 3805 class API_system_indicator { |
| 3806 /* |
| 3807 * API connection |
| 3808 */ |
| 3809 Object _jsObject; |
| 3810 |
| 3811 /* |
| 3812 * Events |
| 3813 */ |
| 3814 Event_system_indicator_onClicked onClicked; |
| 3815 |
| 3816 /* |
| 3817 * Functions |
| 3818 */ |
| 3819 /// Set the image to be used as an indicator icon, using a set of ImageData |
| 3820 /// objects. These objects should have multiple resolutions so that an |
| 3821 /// appropriate size can be selected for the given icon size and DPI scaling |
| 3822 /// settings. Only square ImageData objects are accepted. |
| 3823 void setIcon(SystemindicatorSetIconDetails details, [void callback()]) => JS('
void', '#.setIcon(#, #)', this._jsObject, convertArgument(details), convertDartC
losureToJS(callback, 0)); |
| 3824 |
| 3825 /// Show the icon in the status tray. |
| 3826 void enable() => JS('void', '#.enable()', this._jsObject); |
| 3827 |
| 3828 /// Hide the icon from the status tray. |
| 3829 void disable() => JS('void', '#.disable()', this._jsObject); |
| 3830 |
| 3831 API_system_indicator(this._jsObject) { |
| 3832 onClicked = new Event_system_indicator_onClicked(JS('', '#.onClicked', this.
_jsObject)); |
| 3833 } |
| 3834 } |
| 3835 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 3836 // for details. All rights reserved. Use of this source code is governed by a |
| 3837 // BSD-style license that can be found in the LICENSE file. |
| 3838 |
| 3839 // Generated from namespace: systemInfo.display |
| 3840 |
| 3841 |
| 3842 /** |
| 3843 * Types |
| 3844 */ |
| 3845 |
| 3846 class SysteminfoDisplayBounds extends ChromeObject { |
| 3847 /* |
| 3848 * Public constructor |
| 3849 */ |
| 3850 SysteminfoDisplayBounds({int left, int top, int width, int height}) { |
| 3851 if (?left) |
| 3852 this.left = left; |
| 3853 if (?top) |
| 3854 this.top = top; |
| 3855 if (?width) |
| 3856 this.width = width; |
| 3857 if (?height) |
| 3858 this.height = height; |
| 3859 } |
| 3860 |
| 3861 /* |
| 3862 * Private constructor |
| 3863 */ |
| 3864 SysteminfoDisplayBounds._proxy(_jsObject) : super._proxy(_jsObject); |
| 3865 |
| 3866 /* |
| 3867 * Public accessors |
| 3868 */ |
| 3869 /// The x-coordinate of the upper-left corner. |
| 3870 int get left => JS('int', '#.left', this._jsObject); |
| 3871 |
| 3872 void set left(int left) { |
| 3873 JS('void', '#.left = #', this._jsObject, left); |
| 3874 } |
| 3875 |
| 3876 /// The y-coordinate of the upper-left corner. |
| 3877 int get top => JS('int', '#.top', this._jsObject); |
| 3878 |
| 3879 void set top(int top) { |
| 3880 JS('void', '#.top = #', this._jsObject, top); |
| 3881 } |
| 3882 |
| 3883 /// The width of the display in pixels. |
| 3884 int get width => JS('int', '#.width', this._jsObject); |
| 3885 |
| 3886 void set width(int width) { |
| 3887 JS('void', '#.width = #', this._jsObject, width); |
| 3888 } |
| 3889 |
| 3890 /// The height of the display in pixels. |
| 3891 int get height => JS('int', '#.height', this._jsObject); |
| 3892 |
| 3893 void set height(int height) { |
| 3894 JS('void', '#.height = #', this._jsObject, height); |
| 3895 } |
| 3896 |
| 3897 } |
| 3898 |
| 3899 class SysteminfoDisplayDisplayUnitInfo extends ChromeObject { |
| 3900 /* |
| 3901 * Public constructor |
| 3902 */ |
| 3903 SysteminfoDisplayDisplayUnitInfo({String id, String name, bool isPrimary, bool
isInternal, bool isEnabled, double dpiX, double dpiY, SysteminfoDisplayBounds b
ounds, SysteminfoDisplayBounds workArea}) { |
| 3904 if (?id) |
| 3905 this.id = id; |
| 3906 if (?name) |
| 3907 this.name = name; |
| 3908 if (?isPrimary) |
| 3909 this.isPrimary = isPrimary; |
| 3910 if (?isInternal) |
| 3911 this.isInternal = isInternal; |
| 3912 if (?isEnabled) |
| 3913 this.isEnabled = isEnabled; |
| 3914 if (?dpiX) |
| 3915 this.dpiX = dpiX; |
| 3916 if (?dpiY) |
| 3917 this.dpiY = dpiY; |
| 3918 if (?bounds) |
| 3919 this.bounds = bounds; |
| 3920 if (?workArea) |
| 3921 this.workArea = workArea; |
| 3922 } |
| 3923 |
| 3924 /* |
| 3925 * Private constructor |
| 3926 */ |
| 3927 SysteminfoDisplayDisplayUnitInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 3928 |
| 3929 /* |
| 3930 * Public accessors |
| 3931 */ |
| 3932 /// The unique identifier of the display. |
| 3933 String get id => JS('String', '#.id', this._jsObject); |
| 3934 |
| 3935 void set id(String id) { |
| 3936 JS('void', '#.id = #', this._jsObject, id); |
| 3937 } |
| 3938 |
| 3939 /// The user-friendly name (e.g. "HP LCD monitor"). |
| 3940 String get name => JS('String', '#.name', this._jsObject); |
| 3941 |
| 3942 void set name(String name) { |
| 3943 JS('void', '#.name = #', this._jsObject, name); |
| 3944 } |
| 3945 |
| 3946 /// True if this is the primary display. |
| 3947 bool get isPrimary => JS('bool', '#.isPrimary', this._jsObject); |
| 3948 |
| 3949 void set isPrimary(bool isPrimary) { |
| 3950 JS('void', '#.isPrimary = #', this._jsObject, isPrimary); |
| 3951 } |
| 3952 |
| 3953 /// True if this is an internal display. |
| 3954 bool get isInternal => JS('bool', '#.isInternal', this._jsObject); |
| 3955 |
| 3956 void set isInternal(bool isInternal) { |
| 3957 JS('void', '#.isInternal = #', this._jsObject, isInternal); |
| 3958 } |
| 3959 |
| 3960 /// True if this display is enabled. |
| 3961 bool get isEnabled => JS('bool', '#.isEnabled', this._jsObject); |
| 3962 |
| 3963 void set isEnabled(bool isEnabled) { |
| 3964 JS('void', '#.isEnabled = #', this._jsObject, isEnabled); |
| 3965 } |
| 3966 |
| 3967 /// The number of pixels per inch along the x-axis. |
| 3968 double get dpiX => JS('double', '#.dpiX', this._jsObject); |
| 3969 |
| 3970 void set dpiX(double dpiX) { |
| 3971 JS('void', '#.dpiX = #', this._jsObject, dpiX); |
| 3972 } |
| 3973 |
| 3974 /// The number of pixels per inch along the y-axis. |
| 3975 double get dpiY => JS('double', '#.dpiY', this._jsObject); |
| 3976 |
| 3977 void set dpiY(double dpiY) { |
| 3978 JS('void', '#.dpiY = #', this._jsObject, dpiY); |
| 3979 } |
| 3980 |
| 3981 /// The bounds of the display. |
| 3982 SysteminfoDisplayBounds get bounds => new SysteminfoDisplayBounds._proxy(JS(''
, '#.bounds', this._jsObject)); |
| 3983 |
| 3984 void set bounds(SysteminfoDisplayBounds bounds) { |
| 3985 JS('void', '#.bounds = #', this._jsObject, convertArgument(bounds)); |
| 3986 } |
| 3987 |
| 3988 /// The usable work area of the display. |
| 3989 SysteminfoDisplayBounds get workArea => new SysteminfoDisplayBounds._proxy(JS(
'', '#.workArea', this._jsObject)); |
| 3990 |
| 3991 void set workArea(SysteminfoDisplayBounds workArea) { |
| 3992 JS('void', '#.workArea = #', this._jsObject, convertArgument(workArea)); |
| 3993 } |
| 3994 |
| 3995 } |
| 3996 |
| 3997 /** |
| 3998 * Events |
| 3999 */ |
| 4000 |
| 4001 /// Fired when anything changes to the display configuration. |
| 4002 class Event_system_info_display_onDisplayChanged extends Event { |
| 4003 void addListener(void callback()) => super.addListener(callback); |
| 4004 |
| 4005 void removeListener(void callback()) => super.removeListener(callback); |
| 4006 |
| 4007 bool hasListener(void callback()) => super.hasListener(callback); |
| 4008 |
| 4009 Event_system_info_display_onDisplayChanged(jsObject) : super._(jsObject, 0); |
| 4010 } |
| 4011 |
| 4012 /** |
| 4013 * Functions |
| 4014 */ |
| 4015 |
| 4016 class API_system_info_display { |
| 4017 /* |
| 4018 * API connection |
| 4019 */ |
| 4020 Object _jsObject; |
| 4021 |
| 4022 /* |
| 4023 * Events |
| 4024 */ |
| 4025 Event_system_info_display_onDisplayChanged onDisplayChanged; |
| 4026 |
| 4027 /* |
| 4028 * Functions |
| 4029 */ |
| 4030 /// Get the information of all attached display devices. |
| 4031 void getDisplayInfo(void callback(List<SysteminfoDisplayDisplayUnitInfo> displ
ayInfo)) { |
| 4032 void __proxy_callback(displayInfo) { |
| 4033 if (?callback) { |
| 4034 List<SysteminfoDisplayDisplayUnitInfo> __proxy_displayInfo = new List<Sy
steminfoDisplayDisplayUnitInfo>(); |
| 4035 for (var o in displayInfo) { |
| 4036 __proxy_displayInfo.add(new SysteminfoDisplayDisplayUnitInfo._proxy(o)
); |
| 4037 } |
| 4038 callback(__proxy_displayInfo); |
| 4039 } |
| 4040 } |
| 4041 JS('void', '#.getDisplayInfo(#)', this._jsObject, convertDartClosureToJS(__p
roxy_callback, 1)); |
| 4042 } |
| 4043 |
| 4044 API_system_info_display(this._jsObject) { |
| 4045 onDisplayChanged = new Event_system_info_display_onDisplayChanged(JS('', '#.
onDisplayChanged', this._jsObject)); |
| 4046 } |
| 4047 } |
| 4048 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 4049 // for details. All rights reserved. Use of this source code is governed by a |
| 4050 // BSD-style license that can be found in the LICENSE file. |
| 4051 |
| 4052 // Generated from namespace: usb |
| 4053 |
| 4054 |
| 4055 /** |
| 4056 * Types |
| 4057 */ |
| 4058 |
| 4059 class UsbDevice extends ChromeObject { |
| 4060 /* |
| 4061 * Public constructor |
| 4062 */ |
| 4063 UsbDevice({int handle, int vendorId, int productId}) { |
| 4064 if (?handle) |
| 4065 this.handle = handle; |
| 4066 if (?vendorId) |
| 4067 this.vendorId = vendorId; |
| 4068 if (?productId) |
| 4069 this.productId = productId; |
| 4070 } |
| 4071 |
| 4072 /* |
| 4073 * Private constructor |
| 4074 */ |
| 4075 UsbDevice._proxy(_jsObject) : super._proxy(_jsObject); |
| 4076 |
| 4077 /* |
| 4078 * Public accessors |
| 4079 */ |
| 4080 int get handle => JS('int', '#.handle', this._jsObject); |
| 4081 |
| 4082 void set handle(int handle) { |
| 4083 JS('void', '#.handle = #', this._jsObject, handle); |
| 4084 } |
| 4085 |
| 4086 int get vendorId => JS('int', '#.vendorId', this._jsObject); |
| 4087 |
| 4088 void set vendorId(int vendorId) { |
| 4089 JS('void', '#.vendorId = #', this._jsObject, vendorId); |
| 4090 } |
| 4091 |
| 4092 int get productId => JS('int', '#.productId', this._jsObject); |
| 4093 |
| 4094 void set productId(int productId) { |
| 4095 JS('void', '#.productId = #', this._jsObject, productId); |
| 4096 } |
| 4097 |
| 4098 } |
| 4099 |
| 4100 class UsbControlTransferInfo extends ChromeObject { |
| 4101 /* |
| 4102 * Public constructor |
| 4103 */ |
| 4104 UsbControlTransferInfo({String direction, String recipient, String requestType
, int request, int value, int index, int length, String data}) { |
| 4105 if (?direction) |
| 4106 this.direction = direction; |
| 4107 if (?recipient) |
| 4108 this.recipient = recipient; |
| 4109 if (?requestType) |
| 4110 this.requestType = requestType; |
| 4111 if (?request) |
| 4112 this.request = request; |
| 4113 if (?value) |
| 4114 this.value = value; |
| 4115 if (?index) |
| 4116 this.index = index; |
| 4117 if (?length) |
| 4118 this.length = length; |
| 4119 if (?data) |
| 4120 this.data = data; |
| 4121 } |
| 4122 |
| 4123 /* |
| 4124 * Private constructor |
| 4125 */ |
| 4126 UsbControlTransferInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 4127 |
| 4128 /* |
| 4129 * Public accessors |
| 4130 */ |
| 4131 /// The direction of this transfer. |
| 4132 String get direction => JS('String', '#.direction', this._jsObject); |
| 4133 |
| 4134 void set direction(String direction) { |
| 4135 JS('void', '#.direction = #', this._jsObject, direction); |
| 4136 } |
| 4137 |
| 4138 /// The intended recipient for this transfer. |
| 4139 String get recipient => JS('String', '#.recipient', this._jsObject); |
| 4140 |
| 4141 void set recipient(String recipient) { |
| 4142 JS('void', '#.recipient = #', this._jsObject, recipient); |
| 4143 } |
| 4144 |
| 4145 /// The type of this request. |
| 4146 String get requestType => JS('String', '#.requestType', this._jsObject); |
| 4147 |
| 4148 void set requestType(String requestType) { |
| 4149 JS('void', '#.requestType = #', this._jsObject, requestType); |
| 4150 } |
| 4151 |
| 4152 int get request => JS('int', '#.request', this._jsObject); |
| 4153 |
| 4154 void set request(int request) { |
| 4155 JS('void', '#.request = #', this._jsObject, request); |
| 4156 } |
| 4157 |
| 4158 int get value => JS('int', '#.value', this._jsObject); |
| 4159 |
| 4160 void set value(int value) { |
| 4161 JS('void', '#.value = #', this._jsObject, value); |
| 4162 } |
| 4163 |
| 4164 int get index => JS('int', '#.index', this._jsObject); |
| 4165 |
| 4166 void set index(int index) { |
| 4167 JS('void', '#.index = #', this._jsObject, index); |
| 4168 } |
| 4169 |
| 4170 /// If this transfer is an input transfer, then this field must be set to |
| 4171 /// indicate the expected data length. If this is an output transfer, then thi
s |
| 4172 /// field is ignored. |
| 4173 int get length => JS('int', '#.length', this._jsObject); |
| 4174 |
| 4175 void set length(int length) { |
| 4176 JS('void', '#.length = #', this._jsObject, length); |
| 4177 } |
| 4178 |
| 4179 /// The data payload carried by this transfer. If this is an output tranfer |
| 4180 /// then this field must be set. |
| 4181 String get data => JS('String', '#.data', this._jsObject); |
| 4182 |
| 4183 void set data(String data) { |
| 4184 JS('void', '#.data = #', this._jsObject, data); |
| 4185 } |
| 4186 |
| 4187 } |
| 4188 |
| 4189 class UsbGenericTransferInfo extends ChromeObject { |
| 4190 /* |
| 4191 * Public constructor |
| 4192 */ |
| 4193 UsbGenericTransferInfo({String direction, int endpoint, int length, String dat
a}) { |
| 4194 if (?direction) |
| 4195 this.direction = direction; |
| 4196 if (?endpoint) |
| 4197 this.endpoint = endpoint; |
| 4198 if (?length) |
| 4199 this.length = length; |
| 4200 if (?data) |
| 4201 this.data = data; |
| 4202 } |
| 4203 |
| 4204 /* |
| 4205 * Private constructor |
| 4206 */ |
| 4207 UsbGenericTransferInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 4208 |
| 4209 /* |
| 4210 * Public accessors |
| 4211 */ |
| 4212 /// The direction of this transfer. |
| 4213 String get direction => JS('String', '#.direction', this._jsObject); |
| 4214 |
| 4215 void set direction(String direction) { |
| 4216 JS('void', '#.direction = #', this._jsObject, direction); |
| 4217 } |
| 4218 |
| 4219 int get endpoint => JS('int', '#.endpoint', this._jsObject); |
| 4220 |
| 4221 void set endpoint(int endpoint) { |
| 4222 JS('void', '#.endpoint = #', this._jsObject, endpoint); |
| 4223 } |
| 4224 |
| 4225 /// If this is an input transfer then this field indicates the size of the |
| 4226 /// input buffer. If this is an output transfer then this field is ignored. |
| 4227 int get length => JS('int', '#.length', this._jsObject); |
| 4228 |
| 4229 void set length(int length) { |
| 4230 JS('void', '#.length = #', this._jsObject, length); |
| 4231 } |
| 4232 |
| 4233 /// If this is an output transfer then this field must be populated. Otherwise
, |
| 4234 /// it will be ignored. |
| 4235 String get data => JS('String', '#.data', this._jsObject); |
| 4236 |
| 4237 void set data(String data) { |
| 4238 JS('void', '#.data = #', this._jsObject, data); |
| 4239 } |
| 4240 |
| 4241 } |
| 4242 |
| 4243 class UsbIsochronousTransferInfo extends ChromeObject { |
| 4244 /* |
| 4245 * Public constructor |
| 4246 */ |
| 4247 UsbIsochronousTransferInfo({UsbGenericTransferInfo transferInfo, int packets,
int packetLength}) { |
| 4248 if (?transferInfo) |
| 4249 this.transferInfo = transferInfo; |
| 4250 if (?packets) |
| 4251 this.packets = packets; |
| 4252 if (?packetLength) |
| 4253 this.packetLength = packetLength; |
| 4254 } |
| 4255 |
| 4256 /* |
| 4257 * Private constructor |
| 4258 */ |
| 4259 UsbIsochronousTransferInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 4260 |
| 4261 /* |
| 4262 * Public accessors |
| 4263 */ |
| 4264 /// All of the normal transfer parameters are encapsulated in the transferInfo |
| 4265 /// parameters. Note that the data specified in this parameter block is split |
| 4266 /// along packetLength boundaries to form the individual packets of the |
| 4267 /// transfer. |
| 4268 UsbGenericTransferInfo get transferInfo => new UsbGenericTransferInfo._proxy(J
S('', '#.transferInfo', this._jsObject)); |
| 4269 |
| 4270 void set transferInfo(UsbGenericTransferInfo transferInfo) { |
| 4271 JS('void', '#.transferInfo = #', this._jsObject, convertArgument(transferInf
o)); |
| 4272 } |
| 4273 |
| 4274 /// The total number of packets in this transfer. |
| 4275 int get packets => JS('int', '#.packets', this._jsObject); |
| 4276 |
| 4277 void set packets(int packets) { |
| 4278 JS('void', '#.packets = #', this._jsObject, packets); |
| 4279 } |
| 4280 |
| 4281 /// The length of each of the packets in this transfer. |
| 4282 int get packetLength => JS('int', '#.packetLength', this._jsObject); |
| 4283 |
| 4284 void set packetLength(int packetLength) { |
| 4285 JS('void', '#.packetLength = #', this._jsObject, packetLength); |
| 4286 } |
| 4287 |
| 4288 } |
| 4289 |
| 4290 class UsbTransferResultInfo extends ChromeObject { |
| 4291 /* |
| 4292 * Public constructor |
| 4293 */ |
| 4294 UsbTransferResultInfo({int resultCode, String data}) { |
| 4295 if (?resultCode) |
| 4296 this.resultCode = resultCode; |
| 4297 if (?data) |
| 4298 this.data = data; |
| 4299 } |
| 4300 |
| 4301 /* |
| 4302 * Private constructor |
| 4303 */ |
| 4304 UsbTransferResultInfo._proxy(_jsObject) : super._proxy(_jsObject); |
| 4305 |
| 4306 /* |
| 4307 * Public accessors |
| 4308 */ |
| 4309 /// A value of 0 indicates that the transfer was a success. Other values |
| 4310 /// indicate failure. |
| 4311 int get resultCode => JS('int', '#.resultCode', this._jsObject); |
| 4312 |
| 4313 void set resultCode(int resultCode) { |
| 4314 JS('void', '#.resultCode = #', this._jsObject, resultCode); |
| 4315 } |
| 4316 |
| 4317 /// If the transfer was an input transfer then this field will contain all of |
| 4318 /// the input data requested. |
| 4319 String get data => JS('String', '#.data', this._jsObject); |
| 4320 |
| 4321 void set data(String data) { |
| 4322 JS('void', '#.data = #', this._jsObject, data); |
| 4323 } |
| 4324 |
| 4325 } |
| 4326 |
| 4327 class UsbFindDevicesOptions extends ChromeObject { |
| 4328 /* |
| 4329 * Public constructor |
| 4330 */ |
| 4331 UsbFindDevicesOptions({int vendorId, int productId}) { |
| 4332 if (?vendorId) |
| 4333 this.vendorId = vendorId; |
| 4334 if (?productId) |
| 4335 this.productId = productId; |
| 4336 } |
| 4337 |
| 4338 /* |
| 4339 * Private constructor |
| 4340 */ |
| 4341 UsbFindDevicesOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 4342 |
| 4343 /* |
| 4344 * Public accessors |
| 4345 */ |
| 4346 int get vendorId => JS('int', '#.vendorId', this._jsObject); |
| 4347 |
| 4348 void set vendorId(int vendorId) { |
| 4349 JS('void', '#.vendorId = #', this._jsObject, vendorId); |
| 4350 } |
| 4351 |
| 4352 int get productId => JS('int', '#.productId', this._jsObject); |
| 4353 |
| 4354 void set productId(int productId) { |
| 4355 JS('void', '#.productId = #', this._jsObject, productId); |
| 4356 } |
| 4357 |
| 4358 } |
| 4359 |
| 4360 /** |
| 4361 * Functions |
| 4362 */ |
| 4363 |
| 4364 class API_usb { |
| 4365 /* |
| 4366 * API connection |
| 4367 */ |
| 4368 Object _jsObject; |
| 4369 |
| 4370 /* |
| 4371 * Functions |
| 4372 */ |
| 4373 /// Finds the first instance of the USB device specified by the vendorId/ |
| 4374 /// productId pair and, if permissions allow, opens it for use. Upon |
| 4375 /// successfully opening a device the callback is invoked with a populated |
| 4376 /// Device object. On failure, the callback is invoked with null. |
| 4377 void findDevices(UsbFindDevicesOptions options, void callback(List<UsbDevice>
device)) { |
| 4378 void __proxy_callback(device) { |
| 4379 if (?callback) { |
| 4380 List<UsbDevice> __proxy_device = new List<UsbDevice>(); |
| 4381 for (var o in device) { |
| 4382 __proxy_device.add(new UsbDevice._proxy(o)); |
| 4383 } |
| 4384 callback(__proxy_device); |
| 4385 } |
| 4386 } |
| 4387 JS('void', '#.findDevices(#, #)', this._jsObject, convertArgument(options),
convertDartClosureToJS(__proxy_callback, 1)); |
| 4388 } |
| 4389 |
| 4390 /// Closes an open device instance. Invoking operations on a device after it |
| 4391 /// has been closed is a safe operation, but causes no action to be taken. |
| 4392 void closeDevice(UsbDevice device, [void callback()]) => JS('void', '#.closeDe
vice(#, #)', this._jsObject, convertArgument(device), convertDartClosureToJS(cal
lback, 0)); |
| 4393 |
| 4394 /// Claims an interface on the specified USB device. |
| 4395 void claimInterface(UsbDevice device, int interfaceNumber, void callback()) =>
JS('void', '#.claimInterface(#, #, #)', this._jsObject, convertArgument(device)
, interfaceNumber, convertDartClosureToJS(callback, 0)); |
| 4396 |
| 4397 /// Releases a claim to an interface on the provided device. |
| 4398 void releaseInterface(UsbDevice device, int interfaceNumber, void callback())
=> JS('void', '#.releaseInterface(#, #, #)', this._jsObject, convertArgument(dev
ice), interfaceNumber, convertDartClosureToJS(callback, 0)); |
| 4399 |
| 4400 /// Selects an alternate setting on a previously claimed interface on a device
. |
| 4401 void setInterfaceAlternateSetting(UsbDevice device, int interfaceNumber, int a
lternateSetting, void callback()) => JS('void', '#.setInterfaceAlternateSetting(
#, #, #, #)', this._jsObject, convertArgument(device), interfaceNumber, alternat
eSetting, convertDartClosureToJS(callback, 0)); |
| 4402 |
| 4403 /// Performs a control transfer on the specified device. See the |
| 4404 /// ControlTransferInfo structure for the parameters required to make a |
| 4405 /// transfer. |
| 4406 void controlTransfer(UsbDevice device, UsbControlTransferInfo transferInfo, vo
id callback(UsbTransferResultInfo info)) { |
| 4407 void __proxy_callback(info) { |
| 4408 if (?callback) { |
| 4409 callback(new UsbTransferResultInfo._proxy(info)); |
| 4410 } |
| 4411 } |
| 4412 JS('void', '#.controlTransfer(#, #, #)', this._jsObject, convertArgument(dev
ice), convertArgument(transferInfo), convertDartClosureToJS(__proxy_callback, 1)
); |
| 4413 } |
| 4414 |
| 4415 /// Performs a bulk transfer on the specified device. |
| 4416 void bulkTransfer(UsbDevice device, UsbGenericTransferInfo transferInfo, void
callback(UsbTransferResultInfo info)) { |
| 4417 void __proxy_callback(info) { |
| 4418 if (?callback) { |
| 4419 callback(new UsbTransferResultInfo._proxy(info)); |
| 4420 } |
| 4421 } |
| 4422 JS('void', '#.bulkTransfer(#, #, #)', this._jsObject, convertArgument(device
), convertArgument(transferInfo), convertDartClosureToJS(__proxy_callback, 1)); |
| 4423 } |
| 4424 |
| 4425 /// Performs an interrupt transfer on the specified device. |
| 4426 void interruptTransfer(UsbDevice device, UsbGenericTransferInfo transferInfo,
void callback(UsbTransferResultInfo info)) { |
| 4427 void __proxy_callback(info) { |
| 4428 if (?callback) { |
| 4429 callback(new UsbTransferResultInfo._proxy(info)); |
| 4430 } |
| 4431 } |
| 4432 JS('void', '#.interruptTransfer(#, #, #)', this._jsObject, convertArgument(d
evice), convertArgument(transferInfo), convertDartClosureToJS(__proxy_callback,
1)); |
| 4433 } |
| 4434 |
| 4435 /// Performs an isochronous transfer on the specific device. |
| 4436 void isochronousTransfer(UsbDevice device, UsbIsochronousTransferInfo transfer
Info, void callback(UsbTransferResultInfo info)) { |
| 4437 void __proxy_callback(info) { |
| 4438 if (?callback) { |
| 4439 callback(new UsbTransferResultInfo._proxy(info)); |
| 4440 } |
| 4441 } |
| 4442 JS('void', '#.isochronousTransfer(#, #, #)', this._jsObject, convertArgument
(device), convertArgument(transferInfo), convertDartClosureToJS(__proxy_callback
, 1)); |
| 4443 } |
| 4444 |
| 4445 API_usb(this._jsObject) { |
| 4446 } |
| 4447 } |
| OLD | NEW |