| Index: sdk/lib/chrome/dart2js/chrome_dart2js.dart
|
| diff --git a/sdk/lib/chrome/dart2js/chrome_dart2js.dart b/sdk/lib/chrome/dart2js/chrome_dart2js.dart
|
| index 92b66c5af0216e30703fb3c76faeff8410e3b617..314bf4511f1e9f7a6d06c5056ae94dfb392e34f4 100644
|
| --- a/sdk/lib/chrome/dart2js/chrome_dart2js.dart
|
| +++ b/sdk/lib/chrome/dart2js/chrome_dart2js.dart
|
| @@ -9,8 +9,7 @@ import 'dart:html';
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| -// DO NOT EDIT - unless you are editing documentation as per:
|
| -// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
|
| +// DO NOT EDIT
|
| // Auto-generated dart:chrome library.
|
|
|
| /// Native wrappers for the Chrome Packaged App APIs.
|
| @@ -386,6 +385,217 @@ final API_Chrome chrome = new API_Chrome();
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| +// Generated from namespace: alarms
|
| +
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +class AlarmsAlarm extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + AlarmsAlarm({String name, double scheduledTime, double periodInMinutes}) {
|
| + if (?name)
|
| + this.name = name;
|
| + if (?scheduledTime)
|
| + this.scheduledTime = scheduledTime;
|
| + if (?periodInMinutes)
|
| + this.periodInMinutes = periodInMinutes;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + AlarmsAlarm._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// Name of this alarm.
|
| + String get name => JS('String', '#.name', this._jsObject);
|
| +
|
| + void set name(String name) {
|
| + JS('void', '#.name = #', this._jsObject, name);
|
| + }
|
| +
|
| + /// Time at which this alarm was scheduled to fire, in milliseconds past the
|
| + /// epoch (e.g. <code>Date.now() + n</code>). For performance reasons, the
|
| + /// alarm may have been delayed an arbitrary amount beyond this.
|
| + double get scheduledTime => JS('double', '#.scheduledTime', this._jsObject);
|
| +
|
| + void set scheduledTime(double scheduledTime) {
|
| + JS('void', '#.scheduledTime = #', this._jsObject, scheduledTime);
|
| + }
|
| +
|
| + /// If not null, the alarm is a repeating alarm and will fire again in
|
| + /// <var>periodInMinutes</var> minutes.
|
| + double get periodInMinutes => JS('double', '#.periodInMinutes', this._jsObject);
|
| +
|
| + void set periodInMinutes(double periodInMinutes) {
|
| + JS('void', '#.periodInMinutes = #', this._jsObject, periodInMinutes);
|
| + }
|
| +
|
| +}
|
| +
|
| +class AlarmsAlarmCreateInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + AlarmsAlarmCreateInfo({double when, double delayInMinutes, double periodInMinutes}) {
|
| + if (?when)
|
| + this.when = when;
|
| + if (?delayInMinutes)
|
| + this.delayInMinutes = delayInMinutes;
|
| + if (?periodInMinutes)
|
| + this.periodInMinutes = periodInMinutes;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + AlarmsAlarmCreateInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// Time at which the alarm should fire, in milliseconds past the epoch (e.g.
|
| + /// <code>Date.now() + n</code>).
|
| + double get when => JS('double', '#.when', this._jsObject);
|
| +
|
| + void set when(double when) {
|
| + JS('void', '#.when = #', this._jsObject, when);
|
| + }
|
| +
|
| + /// Length of time in minutes after which the <code>onAlarm</code> event should
|
| + /// fire.<br/><br/> <!-- TODO: need minimum=0 -->
|
| + double get delayInMinutes => JS('double', '#.delayInMinutes', this._jsObject);
|
| +
|
| + void set delayInMinutes(double delayInMinutes) {
|
| + JS('void', '#.delayInMinutes = #', this._jsObject, delayInMinutes);
|
| + }
|
| +
|
| + /// If set, the onAlarm event should fire every <var>periodInMinutes</var>
|
| + /// minutes after the initial event specified by <var>when</var> or
|
| + /// <var>delayInMinutes</var>. If not set, the alarm will only fire
|
| + /// once.<br/><br/> <!-- TODO: need minimum=0 -->
|
| + double get periodInMinutes => JS('double', '#.periodInMinutes', this._jsObject);
|
| +
|
| + void set periodInMinutes(double periodInMinutes) {
|
| + JS('void', '#.periodInMinutes = #', this._jsObject, periodInMinutes);
|
| + }
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Events
|
| + */
|
| +
|
| +/// Fired when an alarm has elapsed. Useful for event pages.
|
| +class Event_alarms_onAlarm extends Event {
|
| + void addListener(void callback(AlarmsAlarm alarm)) {
|
| + void __proxy_callback(alarm) {
|
| + if (?callback) {
|
| + callback(new AlarmsAlarm._proxy(alarm));
|
| + }
|
| + }
|
| + super.addListener(callback);
|
| + }
|
| +
|
| + void removeListener(void callback(AlarmsAlarm alarm)) {
|
| + void __proxy_callback(alarm) {
|
| + if (?callback) {
|
| + callback(new AlarmsAlarm._proxy(alarm));
|
| + }
|
| + }
|
| + super.removeListener(callback);
|
| + }
|
| +
|
| + bool hasListener(void callback(AlarmsAlarm alarm)) {
|
| + void __proxy_callback(alarm) {
|
| + if (?callback) {
|
| + callback(new AlarmsAlarm._proxy(alarm));
|
| + }
|
| + }
|
| + super.hasListener(callback);
|
| + }
|
| +
|
| + Event_alarms_onAlarm(jsObject) : super._(jsObject, 1);
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_alarms {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Events
|
| + */
|
| + Event_alarms_onAlarm onAlarm;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + /// Creates an alarm. Near the time(s) specified by <var>alarmInfo</var>, the
|
| + /// <code>onAlarm</code> event is fired. If there is another alarm with the
|
| + /// same name (or no name if none is specified), it will be cancelled and
|
| + /// replaced by this alarm.<br/><br/> In order to reduce the load on the user's
|
| + /// machine, Chrome limits alarms to at most once every 1 minute but may delay
|
| + /// them an arbitrary amount more. That is, setting
|
| + /// <code>$ref:[alarms.AlarmCreateInfo.delayInMinutes delayInMinutes]</code> or
|
| + /// <code>$ref:[alarms.AlarmCreateInfo.periodInMinutes periodInMinutes]</code>
|
| + /// to less than <code>1</code> will not be honored and will cause a warning.
|
| + /// <code>$ref:[alarms.AlarmCreateInfo.when when]</code> can be set to less
|
| + /// than 1 minute after "now" without warning but won't actually cause the
|
| + /// alarm to fire for at least 1 minute.<br/><br/> To help you debug your app
|
| + /// or extension, when you've loaded it unpacked, there's no limit to how often
|
| + /// the alarm can fire.
|
| + void create(AlarmsAlarmCreateInfo alarmInfo, [String name]) => JS('void', '#.create(#, #)', this._jsObject, name, convertArgument(alarmInfo));
|
| +
|
| + /// Retrieves details about the specified alarm.
|
| + void get(void callback(AlarmsAlarm alarm), [String name]) {
|
| + void __proxy_callback(alarm) {
|
| + if (?callback) {
|
| + callback(new AlarmsAlarm._proxy(alarm));
|
| + }
|
| + }
|
| + JS('void', '#.get(#, #)', this._jsObject, name, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Gets an array of all the alarms.
|
| + void getAll(void callback(List<AlarmsAlarm> alarms)) {
|
| + void __proxy_callback(alarms) {
|
| + if (?callback) {
|
| + List<AlarmsAlarm> __proxy_alarms = new List<AlarmsAlarm>();
|
| + for (var o in alarms) {
|
| + __proxy_alarms.add(new AlarmsAlarm._proxy(o));
|
| + }
|
| + callback(__proxy_alarms);
|
| + }
|
| + }
|
| + JS('void', '#.getAll(#)', this._jsObject, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Clears the alarm with the given name.
|
| + void clear([String name]) => JS('void', '#.clear(#)', this._jsObject, name);
|
| +
|
| + /// Clears all alarms.
|
| + void clearAll() => JS('void', '#.clearAll()', this._jsObject);
|
| +
|
| + API_alarms(this._jsObject) {
|
| + onAlarm = new Event_alarms_onAlarm(JS('', '#.onAlarm', this._jsObject));
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| // Generated from namespace: app.window
|
|
|
|
|
| @@ -393,6 +603,55 @@ final API_Chrome chrome = new API_Chrome();
|
| * Types
|
| */
|
|
|
| +class AppWindowBounds extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + AppWindowBounds({int left, int top, int width, int height}) {
|
| + if (?left)
|
| + this.left = left;
|
| + if (?top)
|
| + this.top = top;
|
| + if (?width)
|
| + this.width = width;
|
| + if (?height)
|
| + this.height = height;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + AppWindowBounds._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + int get left => JS('int', '#.left', this._jsObject);
|
| +
|
| + void set left(int left) {
|
| + JS('void', '#.left = #', this._jsObject, left);
|
| + }
|
| +
|
| + int get top => JS('int', '#.top', this._jsObject);
|
| +
|
| + void set top(int top) {
|
| + JS('void', '#.top = #', this._jsObject, top);
|
| + }
|
| +
|
| + int get width => JS('int', '#.width', this._jsObject);
|
| +
|
| + void set width(int width) {
|
| + JS('void', '#.width = #', this._jsObject, width);
|
| + }
|
| +
|
| + int get height => JS('int', '#.height', this._jsObject);
|
| +
|
| + void set height(int height) {
|
| + JS('void', '#.height = #', this._jsObject, height);
|
| + }
|
| +
|
| +}
|
| +
|
| class AppWindowCreateWindowOptions extends ChromeObject {
|
| /*
|
| * Public constructor
|
| @@ -596,55 +855,6 @@ class AppWindowCreateWindowOptions extends ChromeObject {
|
|
|
| }
|
|
|
| -class AppWindowBounds extends ChromeObject {
|
| - /*
|
| - * Public constructor
|
| - */
|
| - AppWindowBounds({int left, int top, int width, int height}) {
|
| - if (?left)
|
| - this.left = left;
|
| - if (?top)
|
| - this.top = top;
|
| - if (?width)
|
| - this.width = width;
|
| - if (?height)
|
| - this.height = height;
|
| - }
|
| -
|
| - /*
|
| - * Private constructor
|
| - */
|
| - AppWindowBounds._proxy(_jsObject) : super._proxy(_jsObject);
|
| -
|
| - /*
|
| - * Public accessors
|
| - */
|
| - int get left => JS('int', '#.left', this._jsObject);
|
| -
|
| - void set left(int left) {
|
| - JS('void', '#.left = #', this._jsObject, left);
|
| - }
|
| -
|
| - int get top => JS('int', '#.top', this._jsObject);
|
| -
|
| - void set top(int top) {
|
| - JS('void', '#.top = #', this._jsObject, top);
|
| - }
|
| -
|
| - int get width => JS('int', '#.width', this._jsObject);
|
| -
|
| - void set width(int width) {
|
| - JS('void', '#.width = #', this._jsObject, width);
|
| - }
|
| -
|
| - int get height => JS('int', '#.height', this._jsObject);
|
| -
|
| - void set height(int height) {
|
| - JS('void', '#.height = #', this._jsObject, height);
|
| - }
|
| -
|
| -}
|
| -
|
| class AppWindowAppWindow extends ChromeObject {
|
| /*
|
| * Private constructor
|
| @@ -674,13 +884,13 @@ class AppWindowAppWindow extends ChromeObject {
|
| void minimize() => JS('void', '#.minimize()', this._jsObject);
|
|
|
| /// Is the window minimized?
|
| - void isMinimized() => JS('void', '#.isMinimized()', this._jsObject);
|
| + bool isMinimized() => JS('bool', '#.isMinimized()', this._jsObject);
|
|
|
| /// Maximize the window.
|
| void maximize() => JS('void', '#.maximize()', this._jsObject);
|
|
|
| /// Is the window maximized?
|
| - void isMaximized() => JS('void', '#.isMaximized()', this._jsObject);
|
| + bool isMaximized() => new bool._proxy(JS('', '#.isMaximized()', this._jsObject));
|
|
|
| /// Restore the window.
|
| void restore() => JS('void', '#.restore()', this._jsObject);
|
| @@ -876,48 +1086,6 @@ class API_app_window {
|
| * Types
|
| */
|
|
|
| -class AppRuntimeIntent extends ChromeObject {
|
| - /*
|
| - * Private constructor
|
| - */
|
| - AppRuntimeIntent._proxy(_jsObject) : super._proxy(_jsObject);
|
| -
|
| - /*
|
| - * Public accessors
|
| - */
|
| - /// The WebIntent being invoked.
|
| - String get action => JS('String', '#.action', this._jsObject);
|
| -
|
| - void set action(String action) {
|
| - JS('void', '#.action = #', this._jsObject, action);
|
| - }
|
| -
|
| - /// The MIME type of the data.
|
| - String get type => JS('String', '#.type', this._jsObject);
|
| -
|
| - void set type(String type) {
|
| - JS('void', '#.type = #', this._jsObject, type);
|
| - }
|
| -
|
| - /// Data associated with the intent.
|
| - Object get data => JS('Object', '#.data', this._jsObject);
|
| -
|
| - void set data(Object data) {
|
| - JS('void', '#.data = #', this._jsObject, convertArgument(data));
|
| - }
|
| -
|
| -
|
| - /*
|
| - * Methods
|
| - */
|
| - /// Callback to be compatible with WebIntents.
|
| - void postResult() => JS('void', '#.postResult()', this._jsObject);
|
| -
|
| - /// Callback to be compatible with WebIntents.
|
| - void postFailure() => JS('void', '#.postFailure()', this._jsObject);
|
| -
|
| -}
|
| -
|
| class AppRuntimeLaunchItem extends ChromeObject {
|
| /*
|
| * Public constructor
|
| @@ -957,9 +1125,7 @@ class AppRuntimeLaunchData extends ChromeObject {
|
| /*
|
| * Public constructor
|
| */
|
| - AppRuntimeLaunchData({AppRuntimeIntent intent, String id, List<AppRuntimeLaunchItem> items}) {
|
| - if (?intent)
|
| - this.intent = intent;
|
| + AppRuntimeLaunchData({String id, List<AppRuntimeLaunchItem> items}) {
|
| if (?id)
|
| this.id = id;
|
| if (?items)
|
| @@ -974,12 +1140,6 @@ class AppRuntimeLaunchData extends ChromeObject {
|
| /*
|
| * Public accessors
|
| */
|
| - AppRuntimeIntent get intent => new AppRuntimeIntent._proxy(JS('', '#.intent', this._jsObject));
|
| -
|
| - void set intent(AppRuntimeIntent intent) {
|
| - JS('void', '#.intent = #', this._jsObject, convertArgument(intent));
|
| - }
|
| -
|
| /// The id of the file handler that the app is being invoked with.
|
| String get id => JS('String', '#.id', this._jsObject);
|
|
|
| @@ -1001,56 +1161,11 @@ class AppRuntimeLaunchData extends ChromeObject {
|
|
|
| }
|
|
|
| -class AppRuntimeIntentResponse extends ChromeObject {
|
| - /*
|
| - * Public constructor
|
| - */
|
| - AppRuntimeIntentResponse({int intentId, bool success, Object data}) {
|
| - if (?intentId)
|
| - this.intentId = intentId;
|
| - if (?success)
|
| - this.success = success;
|
| - if (?data)
|
| - this.data = data;
|
| - }
|
| +/**
|
| + * Events
|
| + */
|
|
|
| - /*
|
| - * Private constructor
|
| - */
|
| - AppRuntimeIntentResponse._proxy(_jsObject) : super._proxy(_jsObject);
|
| -
|
| - /*
|
| - * Public accessors
|
| - */
|
| - /// Identifies the intent.
|
| - int get intentId => JS('int', '#.intentId', this._jsObject);
|
| -
|
| - void set intentId(int intentId) {
|
| - JS('void', '#.intentId = #', this._jsObject, intentId);
|
| - }
|
| -
|
| - /// Was this intent successful? (i.e., postSuccess vs postFailure).
|
| - bool get success => JS('bool', '#.success', this._jsObject);
|
| -
|
| - void set success(bool success) {
|
| - JS('void', '#.success = #', this._jsObject, success);
|
| - }
|
| -
|
| - /// Data associated with the intent response.
|
| - Object get data => JS('Object', '#.data', this._jsObject);
|
| -
|
| - void set data(Object data) {
|
| - JS('void', '#.data = #', this._jsObject, convertArgument(data));
|
| - }
|
| -
|
| -}
|
| -
|
| -/**
|
| - * Events
|
| - */
|
| -
|
| -/// Fired when an app is launched from the launcher or in response to a web
|
| -/// intent.
|
| +/// Fired when an app is launched from the launcher.
|
| class Event_app_runtime_onLaunched extends Event {
|
| void addListener(void callback(AppRuntimeLaunchData launchData)) {
|
| void __proxy_callback(launchData) {
|
| @@ -1109,17 +1224,3224 @@ class API_app_runtime {
|
| */
|
| Event_app_runtime_onLaunched onLaunched;
|
| Event_app_runtime_onRestarted onRestarted;
|
| + API_app_runtime(this._jsObject) {
|
| + onLaunched = new Event_app_runtime_onLaunched(JS('', '#.onLaunched', this._jsObject));
|
| + onRestarted = new Event_app_runtime_onRestarted(JS('', '#.onRestarted', this._jsObject));
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Generated from namespace: bluetooth
|
|
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +class BluetoothAdapterState extends ChromeObject {
|
| /*
|
| - * Functions
|
| + * Public constructor
|
| + */
|
| + BluetoothAdapterState({String address, String name, bool powered, bool available, bool discovering}) {
|
| + if (?address)
|
| + this.address = address;
|
| + if (?name)
|
| + this.name = name;
|
| + if (?powered)
|
| + this.powered = powered;
|
| + if (?available)
|
| + this.available = available;
|
| + if (?discovering)
|
| + this.discovering = discovering;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| */
|
| - /// postIntentResponse is an internal method to responds to an intent
|
| - /// previously sent to a packaged app. This is identified by intentId, and
|
| - /// should only be invoked at most once per intentId.
|
| - void postIntentResponse(AppRuntimeIntentResponse intentResponse) => JS('void', '#.postIntentResponse(#)', this._jsObject, convertArgument(intentResponse));
|
| + BluetoothAdapterState._proxy(_jsObject) : super._proxy(_jsObject);
|
|
|
| - API_app_runtime(this._jsObject) {
|
| - onLaunched = new Event_app_runtime_onLaunched(JS('', '#.onLaunched', this._jsObject));
|
| - onRestarted = new Event_app_runtime_onRestarted(JS('', '#.onRestarted', this._jsObject));
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The address of the adapter, in the format 'XX:XX:XX:XX:XX:XX'.
|
| + String get address => JS('String', '#.address', this._jsObject);
|
| +
|
| + void set address(String address) {
|
| + JS('void', '#.address = #', this._jsObject, address);
|
| + }
|
| +
|
| + /// The human-readable name of the adapter.
|
| + String get name => JS('String', '#.name', this._jsObject);
|
| +
|
| + void set name(String name) {
|
| + JS('void', '#.name = #', this._jsObject, name);
|
| + }
|
| +
|
| + /// Indicates whether or not the adapter has power.
|
| + bool get powered => JS('bool', '#.powered', this._jsObject);
|
| +
|
| + void set powered(bool powered) {
|
| + JS('void', '#.powered = #', this._jsObject, powered);
|
| + }
|
| +
|
| + /// Indicates whether or not the adapter is available (i.e. enabled).
|
| + bool get available => JS('bool', '#.available', this._jsObject);
|
| +
|
| + void set available(bool available) {
|
| + JS('void', '#.available = #', this._jsObject, available);
|
| + }
|
| +
|
| + /// Indicates whether or not the adapter is currently discovering.
|
| + bool get discovering => JS('bool', '#.discovering', this._jsObject);
|
| +
|
| + void set discovering(bool discovering) {
|
| + JS('void', '#.discovering = #', this._jsObject, discovering);
|
| + }
|
| +
|
| +}
|
| +
|
| +class BluetoothDevice extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + BluetoothDevice({String address, String name, bool paired, bool bonded, bool connected}) {
|
| + if (?address)
|
| + this.address = address;
|
| + if (?name)
|
| + this.name = name;
|
| + if (?paired)
|
| + this.paired = paired;
|
| + if (?bonded)
|
| + this.bonded = bonded;
|
| + if (?connected)
|
| + this.connected = connected;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + BluetoothDevice._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The address of the device, in the format 'XX:XX:XX:XX:XX:XX'.
|
| + String get address => JS('String', '#.address', this._jsObject);
|
| +
|
| + void set address(String address) {
|
| + JS('void', '#.address = #', this._jsObject, address);
|
| + }
|
| +
|
| + /// The human-readable name of the device.
|
| + String get name => JS('String', '#.name', this._jsObject);
|
| +
|
| + void set name(String name) {
|
| + JS('void', '#.name = #', this._jsObject, name);
|
| + }
|
| +
|
| + /// Indicates whether or not the device is paired with the system.
|
| + bool get paired => JS('bool', '#.paired', this._jsObject);
|
| +
|
| + void set paired(bool paired) {
|
| + JS('void', '#.paired = #', this._jsObject, paired);
|
| + }
|
| +
|
| + /// Indicates whether or not the device is bonded with the system. A device is
|
| + /// bonded if it is paired and high-security link keys have been exchanged so
|
| + /// that connections may be encrypted.
|
| + bool get bonded => JS('bool', '#.bonded', this._jsObject);
|
| +
|
| + void set bonded(bool bonded) {
|
| + JS('void', '#.bonded = #', this._jsObject, bonded);
|
| + }
|
| +
|
| + /// Indicates whether the device is currently connected to the system.
|
| + bool get connected => JS('bool', '#.connected', this._jsObject);
|
| +
|
| + void set connected(bool connected) {
|
| + JS('void', '#.connected = #', this._jsObject, connected);
|
| + }
|
| +
|
| +}
|
| +
|
| +class BluetoothServiceRecord extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + BluetoothServiceRecord({String name, String uuid}) {
|
| + if (?name)
|
| + this.name = name;
|
| + if (?uuid)
|
| + this.uuid = uuid;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + BluetoothServiceRecord._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The name of the service.
|
| + String get name => JS('String', '#.name', this._jsObject);
|
| +
|
| + void set name(String name) {
|
| + JS('void', '#.name = #', this._jsObject, name);
|
| + }
|
| +
|
| + /// The UUID of the service.
|
| + String get uuid => JS('String', '#.uuid', this._jsObject);
|
| +
|
| + void set uuid(String uuid) {
|
| + JS('void', '#.uuid = #', this._jsObject, uuid);
|
| + }
|
| +
|
| +}
|
| +
|
| +class BluetoothSocket extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + BluetoothSocket({BluetoothDevice device, String serviceUuid, int id}) {
|
| + if (?device)
|
| + this.device = device;
|
| + if (?serviceUuid)
|
| + this.serviceUuid = serviceUuid;
|
| + if (?id)
|
| + this.id = id;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + BluetoothSocket._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The remote Bluetooth device associated with this socket.
|
| + BluetoothDevice get device => new BluetoothDevice._proxy(JS('', '#.device', this._jsObject));
|
| +
|
| + void set device(BluetoothDevice device) {
|
| + JS('void', '#.device = #', this._jsObject, convertArgument(device));
|
| + }
|
| +
|
| + /// The remote Bluetooth service associated with this socket.
|
| + String get serviceUuid => JS('String', '#.serviceUuid', this._jsObject);
|
| +
|
| + void set serviceUuid(String serviceUuid) {
|
| + JS('void', '#.serviceUuid = #', this._jsObject, serviceUuid);
|
| + }
|
| +
|
| + /// An identifier for this socket that should be used with the
|
| + /// read/write/disconnect methods.
|
| + int get id => JS('int', '#.id', this._jsObject);
|
| +
|
| + void set id(int id) {
|
| + JS('void', '#.id = #', this._jsObject, id);
|
| + }
|
| +
|
| +}
|
| +
|
| +class BluetoothOutOfBandPairingData extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + BluetoothOutOfBandPairingData({String hash, String randomizer}) {
|
| + if (?hash)
|
| + this.hash = hash;
|
| + if (?randomizer)
|
| + this.randomizer = randomizer;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + BluetoothOutOfBandPairingData._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// Simple Pairing Hash C. Always 16 octets long.
|
| + String get hash => JS('String', '#.hash', this._jsObject);
|
| +
|
| + void set hash(String hash) {
|
| + JS('void', '#.hash = #', this._jsObject, hash);
|
| + }
|
| +
|
| + /// Simple Pairing Randomizer R. Always 16 octets long.
|
| + String get randomizer => JS('String', '#.randomizer', this._jsObject);
|
| +
|
| + void set randomizer(String randomizer) {
|
| + JS('void', '#.randomizer = #', this._jsObject, randomizer);
|
| + }
|
| +
|
| +}
|
| +
|
| +class BluetoothGetDevicesOptions extends ChromeObject {
|
| + /*
|
| + * Private constructor
|
| + */
|
| + BluetoothGetDevicesOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// Only devices providing a service with a UUID that matches |uuid| will be
|
| + /// returned.
|
| + String get uuid => JS('String', '#.uuid', this._jsObject);
|
| +
|
| + void set uuid(String uuid) {
|
| + JS('void', '#.uuid = #', this._jsObject, uuid);
|
| + }
|
| +
|
| + /// Only devices providing a service with a name that matches |name| will be
|
| + /// returned.
|
| + String get name => JS('String', '#.name', this._jsObject);
|
| +
|
| + void set name(String name) {
|
| + JS('void', '#.name = #', this._jsObject, name);
|
| + }
|
| +
|
| +
|
| + /*
|
| + * Methods
|
| + */
|
| + /// Called for each matching device. Note that a service discovery request
|
| + /// must be made to each non-matching device before it can be definitively
|
| + /// excluded. This can take some time.
|
| + void deviceCallback(BluetoothDevice device) => JS('void', '#.deviceCallback(#)', this._jsObject, convertArgument(device));
|
| +
|
| +}
|
| +
|
| +class BluetoothGetServicesOptions extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + BluetoothGetServicesOptions({String deviceAddress}) {
|
| + if (?deviceAddress)
|
| + this.deviceAddress = deviceAddress;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + BluetoothGetServicesOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The address of the device to inquire about. |deviceAddress| should be in
|
| + /// the format 'XX:XX:XX:XX:XX:XX'.
|
| + String get deviceAddress => JS('String', '#.deviceAddress', this._jsObject);
|
| +
|
| + void set deviceAddress(String deviceAddress) {
|
| + JS('void', '#.deviceAddress = #', this._jsObject, deviceAddress);
|
| + }
|
| +
|
| +}
|
| +
|
| +class BluetoothConnectOptions extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + BluetoothConnectOptions({String deviceAddress, String serviceUuid}) {
|
| + if (?deviceAddress)
|
| + this.deviceAddress = deviceAddress;
|
| + if (?serviceUuid)
|
| + this.serviceUuid = serviceUuid;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + BluetoothConnectOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The connection is made to the device at |deviceAddress|. |deviceAddress|
|
| + /// should be in the format 'XX:XX:XX:XX:XX:XX'.
|
| + String get deviceAddress => JS('String', '#.deviceAddress', this._jsObject);
|
| +
|
| + void set deviceAddress(String deviceAddress) {
|
| + JS('void', '#.deviceAddress = #', this._jsObject, deviceAddress);
|
| + }
|
| +
|
| + /// The connection is made to the service with UUID |serviceUuid|.
|
| + String get serviceUuid => JS('String', '#.serviceUuid', this._jsObject);
|
| +
|
| + void set serviceUuid(String serviceUuid) {
|
| + JS('void', '#.serviceUuid = #', this._jsObject, serviceUuid);
|
| + }
|
| +
|
| +}
|
| +
|
| +class BluetoothDisconnectOptions extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + BluetoothDisconnectOptions({int socketId}) {
|
| + if (?socketId)
|
| + this.socketId = socketId;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + BluetoothDisconnectOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The socket to disconnect.
|
| + int get socketId => JS('int', '#.socketId', this._jsObject);
|
| +
|
| + void set socketId(int socketId) {
|
| + JS('void', '#.socketId = #', this._jsObject, socketId);
|
| + }
|
| +
|
| +}
|
| +
|
| +class BluetoothReadOptions extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + BluetoothReadOptions({int socketId}) {
|
| + if (?socketId)
|
| + this.socketId = socketId;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + BluetoothReadOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The socket to read from.
|
| + int get socketId => JS('int', '#.socketId', this._jsObject);
|
| +
|
| + void set socketId(int socketId) {
|
| + JS('void', '#.socketId = #', this._jsObject, socketId);
|
| + }
|
| +
|
| +}
|
| +
|
| +class BluetoothWriteOptions extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + BluetoothWriteOptions({int socketId, String data}) {
|
| + if (?socketId)
|
| + this.socketId = socketId;
|
| + if (?data)
|
| + this.data = data;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + BluetoothWriteOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The socket to write to.
|
| + int get socketId => JS('int', '#.socketId', this._jsObject);
|
| +
|
| + void set socketId(int socketId) {
|
| + JS('void', '#.socketId = #', this._jsObject, socketId);
|
| + }
|
| +
|
| + /// The data to write.
|
| + String get data => JS('String', '#.data', this._jsObject);
|
| +
|
| + void set data(String data) {
|
| + JS('void', '#.data = #', this._jsObject, data);
|
| + }
|
| +
|
| +}
|
| +
|
| +class BluetoothSetOutOfBandPairingDataOptions extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + BluetoothSetOutOfBandPairingDataOptions({String address, BluetoothOutOfBandPairingData data}) {
|
| + if (?address)
|
| + this.address = address;
|
| + if (?data)
|
| + this.data = data;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + BluetoothSetOutOfBandPairingDataOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The address of the remote device that the data should be associated with.
|
| + /// |deviceAddress| should be in the format 'XX:XX:XX:XX:XX:XX'.
|
| + String get address => JS('String', '#.address', this._jsObject);
|
| +
|
| + void set address(String address) {
|
| + JS('void', '#.address = #', this._jsObject, address);
|
| + }
|
| +
|
| + /// The Out Of Band Pairing Data. If this is omitted, the data for the device
|
| + /// is cleared instead.
|
| + BluetoothOutOfBandPairingData get data => new BluetoothOutOfBandPairingData._proxy(JS('', '#.data', this._jsObject));
|
| +
|
| + void set data(BluetoothOutOfBandPairingData data) {
|
| + JS('void', '#.data = #', this._jsObject, convertArgument(data));
|
| + }
|
| +
|
| +}
|
| +
|
| +class BluetoothStartDiscoveryOptions extends ChromeObject {
|
| + /*
|
| + * Private constructor
|
| + */
|
| + BluetoothStartDiscoveryOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Methods
|
| + */
|
| + /// Called for each device that is discovered.
|
| + void deviceCallback(BluetoothDevice device) => JS('void', '#.deviceCallback(#)', this._jsObject, convertArgument(device));
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Events
|
| + */
|
| +
|
| +/// Fired when the state of the Bluetooth adapter changes.
|
| +class Event_bluetooth_onAdapterStateChanged extends Event {
|
| + void addListener(void callback(BluetoothAdapterState state)) {
|
| + void __proxy_callback(state) {
|
| + if (?callback) {
|
| + callback(new BluetoothAdapterState._proxy(state));
|
| + }
|
| + }
|
| + super.addListener(callback);
|
| + }
|
| +
|
| + void removeListener(void callback(BluetoothAdapterState state)) {
|
| + void __proxy_callback(state) {
|
| + if (?callback) {
|
| + callback(new BluetoothAdapterState._proxy(state));
|
| + }
|
| + }
|
| + super.removeListener(callback);
|
| + }
|
| +
|
| + bool hasListener(void callback(BluetoothAdapterState state)) {
|
| + void __proxy_callback(state) {
|
| + if (?callback) {
|
| + callback(new BluetoothAdapterState._proxy(state));
|
| + }
|
| + }
|
| + super.hasListener(callback);
|
| + }
|
| +
|
| + Event_bluetooth_onAdapterStateChanged(jsObject) : super._(jsObject, 1);
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_bluetooth {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Events
|
| + */
|
| + Event_bluetooth_onAdapterStateChanged onAdapterStateChanged;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + /// Get information about the Bluetooth adapter.
|
| + void getAdapterState(void callback(BluetoothAdapterState result)) {
|
| + void __proxy_callback(result) {
|
| + if (?callback) {
|
| + callback(new BluetoothAdapterState._proxy(result));
|
| + }
|
| + }
|
| + JS('void', '#.getAdapterState(#)', this._jsObject, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Get a bluetooth devices known to the system. Known devices are either
|
| + /// currently bonded, or have been bonded in the past.
|
| + void getDevices(BluetoothGetDevicesOptions options, void callback()) => JS('void', '#.getDevices(#, #)', this._jsObject, convertArgument(options), convertDartClosureToJS(callback, 0));
|
| +
|
| + /// Get a list of services provided by a device.
|
| + void getServices(BluetoothGetServicesOptions options, void callback(List<BluetoothServiceRecord> result)) {
|
| + void __proxy_callback(result) {
|
| + if (?callback) {
|
| + List<BluetoothServiceRecord> __proxy_result = new List<BluetoothServiceRecord>();
|
| + for (var o in result) {
|
| + __proxy_result.add(new BluetoothServiceRecord._proxy(o));
|
| + }
|
| + callback(__proxy_result);
|
| + }
|
| + }
|
| + JS('void', '#.getServices(#, #)', this._jsObject, convertArgument(options), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Connect to a service on a device.
|
| + void connect(BluetoothConnectOptions options, void callback(BluetoothSocket result)) {
|
| + void __proxy_callback(result) {
|
| + if (?callback) {
|
| + callback(new BluetoothSocket._proxy(result));
|
| + }
|
| + }
|
| + JS('void', '#.connect(#, #)', this._jsObject, convertArgument(options), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Close a Bluetooth connection.
|
| + void disconnect(BluetoothDisconnectOptions options, [void callback()]) => JS('void', '#.disconnect(#, #)', this._jsObject, convertArgument(options), convertDartClosureToJS(callback, 0));
|
| +
|
| + /// Read data from a Bluetooth connection.
|
| + void read(BluetoothReadOptions options, void callback(String result)) => JS('void', '#.read(#, #)', this._jsObject, convertArgument(options), convertDartClosureToJS(callback, 1));
|
| +
|
| + /// Write data to a Bluetooth connection.
|
| + void write(BluetoothWriteOptions options, [void callback(int result)]) => JS('void', '#.write(#, #)', this._jsObject, convertArgument(options), convertDartClosureToJS(callback, 1));
|
| +
|
| + /// Get the local Out of Band Pairing data.
|
| + void getLocalOutOfBandPairingData(void callback(BluetoothOutOfBandPairingData data)) {
|
| + void __proxy_callback(data) {
|
| + if (?callback) {
|
| + callback(new BluetoothOutOfBandPairingData._proxy(data));
|
| + }
|
| + }
|
| + JS('void', '#.getLocalOutOfBandPairingData(#)', this._jsObject, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Set the Out of Band Pairing data for a remote device. Any previous Out Of
|
| + /// Band Pairing Data for this device is overwritten.
|
| + void setOutOfBandPairingData(BluetoothSetOutOfBandPairingDataOptions options, [void callback()]) => JS('void', '#.setOutOfBandPairingData(#, #)', this._jsObject, convertArgument(options), convertDartClosureToJS(callback, 0));
|
| +
|
| + /// Start discovery. Discovered devices will be returned via the
|
| + /// |onDeviceDiscovered| callback. Discovery will fail to start if it is
|
| + /// already in progress. Discovery can be resource intensive: stopDiscovery
|
| + /// should be called as soon as possible.
|
| + void startDiscovery(BluetoothStartDiscoveryOptions options, [void callback()]) => JS('void', '#.startDiscovery(#, #)', this._jsObject, convertArgument(options), convertDartClosureToJS(callback, 0));
|
| +
|
| + /// Stop discovery.
|
| + void stopDiscovery([void callback()]) => JS('void', '#.stopDiscovery(#)', this._jsObject, convertDartClosureToJS(callback, 0));
|
| +
|
| + API_bluetooth(this._jsObject) {
|
| + onAdapterStateChanged = new Event_bluetooth_onAdapterStateChanged(JS('', '#.onAdapterStateChanged', this._jsObject));
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Generated from namespace: contextMenus
|
| +
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +/// Information sent when a context menu item is clicked.
|
| +class ContextmenusOnClickData extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + ContextmenusOnClickData({Object menuItemId, Object parentMenuItemId, String mediaType, String linkUrl, String srcUrl, String pageUrl, String frameUrl, String selectionText, bool editable, bool wasChecked, bool checked}) {
|
| + if (?menuItemId)
|
| + this.menuItemId = menuItemId;
|
| + if (?parentMenuItemId)
|
| + this.parentMenuItemId = parentMenuItemId;
|
| + if (?mediaType)
|
| + this.mediaType = mediaType;
|
| + if (?linkUrl)
|
| + this.linkUrl = linkUrl;
|
| + if (?srcUrl)
|
| + this.srcUrl = srcUrl;
|
| + if (?pageUrl)
|
| + this.pageUrl = pageUrl;
|
| + if (?frameUrl)
|
| + this.frameUrl = frameUrl;
|
| + if (?selectionText)
|
| + this.selectionText = selectionText;
|
| + if (?editable)
|
| + this.editable = editable;
|
| + if (?wasChecked)
|
| + this.wasChecked = wasChecked;
|
| + if (?checked)
|
| + this.checked = checked;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + ContextmenusOnClickData._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The ID of the menu item that was clicked.
|
| + Object get menuItemId => JS('Object', '#.menuItemId', this._jsObject);
|
| +
|
| + void set menuItemId(Object menuItemId) {
|
| + JS('void', '#.menuItemId = #', this._jsObject, menuItemId);
|
| + }
|
| +
|
| + /// The parent ID, if any, for the item clicked.
|
| + Object get parentMenuItemId => JS('Object', '#.parentMenuItemId', this._jsObject);
|
| +
|
| + void set parentMenuItemId(Object parentMenuItemId) {
|
| + JS('void', '#.parentMenuItemId = #', this._jsObject, parentMenuItemId);
|
| + }
|
| +
|
| + /// One of 'image', 'video', or 'audio' if the context menu was activated on
|
| + /// one of these types of elements.
|
| + String get mediaType => JS('String', '#.mediaType', this._jsObject);
|
| +
|
| + void set mediaType(String mediaType) {
|
| + JS('void', '#.mediaType = #', this._jsObject, mediaType);
|
| + }
|
| +
|
| + /// If the element is a link, the URL it points to.
|
| + String get linkUrl => JS('String', '#.linkUrl', this._jsObject);
|
| +
|
| + void set linkUrl(String linkUrl) {
|
| + JS('void', '#.linkUrl = #', this._jsObject, linkUrl);
|
| + }
|
| +
|
| + /// Will be present for elements with a 'src' URL.
|
| + String get srcUrl => JS('String', '#.srcUrl', this._jsObject);
|
| +
|
| + void set srcUrl(String srcUrl) {
|
| + JS('void', '#.srcUrl = #', this._jsObject, srcUrl);
|
| + }
|
| +
|
| + /// The URL of the page where the menu item was clicked. This property is not
|
| + /// set if the click occured in a context where there is no current page, such
|
| + /// as in a launcher context menu.
|
| + String get pageUrl => JS('String', '#.pageUrl', this._jsObject);
|
| +
|
| + void set pageUrl(String pageUrl) {
|
| + JS('void', '#.pageUrl = #', this._jsObject, pageUrl);
|
| + }
|
| +
|
| + /// The URL of the frame of the element where the context menu was clicked, if
|
| + /// it was in a frame.
|
| + String get frameUrl => JS('String', '#.frameUrl', this._jsObject);
|
| +
|
| + void set frameUrl(String frameUrl) {
|
| + JS('void', '#.frameUrl = #', this._jsObject, frameUrl);
|
| + }
|
| +
|
| + /// The text for the context selection, if any.
|
| + String get selectionText => JS('String', '#.selectionText', this._jsObject);
|
| +
|
| + void set selectionText(String selectionText) {
|
| + JS('void', '#.selectionText = #', this._jsObject, selectionText);
|
| + }
|
| +
|
| + /// A flag indicating whether the element is editable (text input, textarea,
|
| + /// etc.).
|
| + bool get editable => JS('bool', '#.editable', this._jsObject);
|
| +
|
| + void set editable(bool editable) {
|
| + JS('void', '#.editable = #', this._jsObject, editable);
|
| + }
|
| +
|
| + /// A flag indicating the state of a checkbox or radio item before it was
|
| + /// clicked.
|
| + bool get wasChecked => JS('bool', '#.wasChecked', this._jsObject);
|
| +
|
| + void set wasChecked(bool wasChecked) {
|
| + JS('void', '#.wasChecked = #', this._jsObject, wasChecked);
|
| + }
|
| +
|
| + /// A flag indicating the state of a checkbox or radio item after it is
|
| + /// clicked.
|
| + bool get checked => JS('bool', '#.checked', this._jsObject);
|
| +
|
| + void set checked(bool checked) {
|
| + JS('void', '#.checked = #', this._jsObject, checked);
|
| + }
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Events
|
| + */
|
| +
|
| +/// Fired when a context menu item is clicked.
|
| +class Event_context_menus_onClicked extends Event {
|
| + void addListener(void callback(ContextmenusOnClickData info, Tab tab)) {
|
| + void __proxy_callback(info, tab) {
|
| + if (?callback) {
|
| + callback(new ContextmenusOnClickData._proxy(info), new Tab._proxy(tab));
|
| + }
|
| + }
|
| + super.addListener(callback);
|
| + }
|
| +
|
| + void removeListener(void callback(ContextmenusOnClickData info, Tab tab)) {
|
| + void __proxy_callback(info, tab) {
|
| + if (?callback) {
|
| + callback(new ContextmenusOnClickData._proxy(info), new Tab._proxy(tab));
|
| + }
|
| + }
|
| + super.removeListener(callback);
|
| + }
|
| +
|
| + bool hasListener(void callback(ContextmenusOnClickData info, Tab tab)) {
|
| + void __proxy_callback(info, tab) {
|
| + if (?callback) {
|
| + callback(new ContextmenusOnClickData._proxy(info), new Tab._proxy(tab));
|
| + }
|
| + }
|
| + super.hasListener(callback);
|
| + }
|
| +
|
| + Event_context_menus_onClicked(jsObject) : super._(jsObject, 2);
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_context_menus {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Events
|
| + */
|
| + Event_context_menus_onClicked onClicked;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + /// Creates a new context menu item. Note that if an error occurs during
|
| + /// creation, you may not find out until the creation callback fires (the
|
| + /// details will be in chrome.runtime.lastError).
|
| + Object create(Object createProperties, [void callback()]) => JS('Object', '#.create(#, #)', this._jsObject, convertArgument(createProperties), convertDartClosureToJS(callback, 0));
|
| +
|
| + /// Updates a previously created context menu item.
|
| + void update(Object id, Object updateProperties, [void callback()]) => JS('void', '#.update(#, #, #)', this._jsObject, id, convertArgument(updateProperties), convertDartClosureToJS(callback, 0));
|
| +
|
| + /// Removes a context menu item.
|
| + void remove(Object menuItemId, [void callback()]) => JS('void', '#.remove(#, #)', this._jsObject, menuItemId, convertDartClosureToJS(callback, 0));
|
| +
|
| + /// Removes all context menu items added by this extension.
|
| + void removeAll([void callback()]) => JS('void', '#.removeAll(#)', this._jsObject, convertDartClosureToJS(callback, 0));
|
| +
|
| + API_context_menus(this._jsObject) {
|
| + onClicked = new Event_context_menus_onClicked(JS('', '#.onClicked', this._jsObject));
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Generated from namespace: fileSystem
|
| +
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +class FilesystemAcceptOption extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + FilesystemAcceptOption({String description, List<String> mimeTypes, List<String> extensions}) {
|
| + if (?description)
|
| + this.description = description;
|
| + if (?mimeTypes)
|
| + this.mimeTypes = mimeTypes;
|
| + if (?extensions)
|
| + this.extensions = extensions;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + FilesystemAcceptOption._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// This is the optional text description for this option. If not present, a
|
| + /// description will be automatically generated; typically containing an
|
| + /// expanded list of valid extensions (e.g. "text/html" may expand to "*.html,
|
| + /// *.htm").
|
| + String get description => JS('String', '#.description', this._jsObject);
|
| +
|
| + void set description(String description) {
|
| + JS('void', '#.description = #', this._jsObject, description);
|
| + }
|
| +
|
| + /// Mime-types to accept, e.g. "image/jpeg" or "audio/*". One of mimeTypes or
|
| + /// extensions must contain at least one valid element.
|
| + List<String> get mimeTypes => JS('List<String>', '#.mimeTypes', this._jsObject);
|
| +
|
| + void set mimeTypes(List<String> mimeTypes) {
|
| + JS('void', '#.mimeTypes = #', this._jsObject, mimeTypes);
|
| + }
|
| +
|
| + /// Extensions to accept, e.g. "jpg", "gif", "crx".
|
| + List<String> get extensions => JS('List<String>', '#.extensions', this._jsObject);
|
| +
|
| + void set extensions(List<String> extensions) {
|
| + JS('void', '#.extensions = #', this._jsObject, extensions);
|
| + }
|
| +
|
| +}
|
| +
|
| +class FilesystemChooseEntryOptions extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + FilesystemChooseEntryOptions({String type, String suggestedName, List<FilesystemAcceptOption> accepts, bool acceptsAllTypes}) {
|
| + if (?type)
|
| + this.type = type;
|
| + if (?suggestedName)
|
| + this.suggestedName = suggestedName;
|
| + if (?accepts)
|
| + this.accepts = accepts;
|
| + if (?acceptsAllTypes)
|
| + this.acceptsAllTypes = acceptsAllTypes;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + FilesystemChooseEntryOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// Type of the prompt to show. Valid types are 'openFile', 'openWritableFile'
|
| + /// or 'saveFile'.<br/><br/> Both 'openFile' and 'openWritableFile' will prompt
|
| + /// the user to open an existing file, with 'openFile' returning a read-only
|
| + /// FileEntry on success. 'saveFile' will prompt the user to choose an existing
|
| + /// file or a new file, and will return a writable FileEntry. Calls to
|
| + /// chooseFile with either 'openWritableFile' or 'saveFile' will fail unless
|
| + /// the application has the 'write' permission under 'fileSystem'.<br/><br/>
|
| + /// The default is 'openFile'.
|
| + String get type => JS('String', '#.type', this._jsObject);
|
| +
|
| + void set type(String type) {
|
| + JS('void', '#.type = #', this._jsObject, type);
|
| + }
|
| +
|
| + /// The suggested file name that will be presented to the user as the default
|
| + /// name to read or write. This is optional.
|
| + String get suggestedName => JS('String', '#.suggestedName', this._jsObject);
|
| +
|
| + void set suggestedName(String suggestedName) {
|
| + JS('void', '#.suggestedName = #', this._jsObject, suggestedName);
|
| + }
|
| +
|
| + /// The optional list of accept options for this file opener. Each option will
|
| + /// be presented as a unique group to the end-user.
|
| + List<FilesystemAcceptOption> get accepts {
|
| + List<FilesystemAcceptOption> __proxy_accepts = new List<FilesystemAcceptOption>();
|
| + for (var o in JS('List', '#.accepts', this._jsObject)) {
|
| + __proxy_accepts.add(new FilesystemAcceptOption._proxy(o));
|
| + }
|
| + return __proxy_accepts;
|
| + }
|
| +
|
| + void set accepts(List<FilesystemAcceptOption> accepts) {
|
| + JS('void', '#.accepts = #', this._jsObject, convertArgument(accepts));
|
| + }
|
| +
|
| + /// Whether to accept all file types, in addition to the options specified in
|
| + /// the accepts argument. The default is true. If the accepts field is unset or
|
| + /// contains no valid entries, this will always be reset to true.
|
| + bool get acceptsAllTypes => JS('bool', '#.acceptsAllTypes', this._jsObject);
|
| +
|
| + void set acceptsAllTypes(bool acceptsAllTypes) {
|
| + JS('void', '#.acceptsAllTypes = #', this._jsObject, acceptsAllTypes);
|
| + }
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_file_system {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + /// Get the display path of a FileEntry object. The display path is based on
|
| + /// the full path of the file on the local file system, but may be made more
|
| + /// readable for display purposes.
|
| + void getDisplayPath(FileEntry fileEntry, void callback(String displayPath)) => JS('void', '#.getDisplayPath(#, #)', this._jsObject, convertArgument(fileEntry), convertDartClosureToJS(callback, 1));
|
| +
|
| + /// Get a writable FileEntry from another FileEntry. This call will fail if the
|
| + /// application does not have the 'write' permission under 'fileSystem'.
|
| + void getWritableEntry(FileEntry fileEntry, void callback(FileEntry fileEntry)) {
|
| + void __proxy_callback(fileEntry) {
|
| + if (?callback) {
|
| + callback(fileEntry);
|
| + }
|
| + }
|
| + JS('void', '#.getWritableEntry(#, #)', this._jsObject, convertArgument(fileEntry), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Gets whether this FileEntry is writable or not.
|
| + void isWritableEntry(FileEntry fileEntry, void callback(bool isWritable)) => JS('void', '#.isWritableEntry(#, #)', this._jsObject, convertArgument(fileEntry), convertDartClosureToJS(callback, 1));
|
| +
|
| + /// Ask the user to choose a file.
|
| + void chooseEntry(void callback(FileEntry fileEntry), [FilesystemChooseEntryOptions options]) {
|
| + void __proxy_callback(fileEntry) {
|
| + if (?callback) {
|
| + callback(fileEntry);
|
| + }
|
| + }
|
| + JS('void', '#.chooseEntry(#, #)', this._jsObject, convertArgument(options), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Returns the file entry with the given id.
|
| + FileEntry getEntryById(String id) => new FileEntry._proxy(JS('', '#.getEntryById(#)', this._jsObject, id));
|
| +
|
| + /// Returns the id of the given file entry.
|
| + String getEntryId(FileEntry fileEntry) => JS('String', '#.getEntryId(#)', this._jsObject, convertArgument(fileEntry));
|
| +
|
| + API_file_system(this._jsObject) {
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Generated from namespace: mediaGalleries
|
| +
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +class MediagalleriesMediaFileSystemsDetails extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + MediagalleriesMediaFileSystemsDetails({String interactive}) {
|
| + if (?interactive)
|
| + this.interactive = interactive;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + MediagalleriesMediaFileSystemsDetails._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// Whether to prompt the user for permission to additional media galleries
|
| + /// before returning the permitted set. Default is silent. If the value 'yes'
|
| + /// is passed, or if the application has not been granted access to any media
|
| + /// galleries and the value 'if_needed' is passed, then the media gallery
|
| + /// configuration dialog will be displayed.
|
| + String get interactive => JS('String', '#.interactive', this._jsObject);
|
| +
|
| + void set interactive(String interactive) {
|
| + JS('void', '#.interactive = #', this._jsObject, interactive);
|
| + }
|
| +
|
| +}
|
| +
|
| +class MediagalleriesMediaFileSystemMetadata extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + MediagalleriesMediaFileSystemMetadata({String name, int galleryId, int deviceId, bool isRemovable, bool isMediaDevice}) {
|
| + if (?name)
|
| + this.name = name;
|
| + if (?galleryId)
|
| + this.galleryId = galleryId;
|
| + if (?deviceId)
|
| + this.deviceId = deviceId;
|
| + if (?isRemovable)
|
| + this.isRemovable = isRemovable;
|
| + if (?isMediaDevice)
|
| + this.isMediaDevice = isMediaDevice;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + MediagalleriesMediaFileSystemMetadata._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The name of the file system.
|
| + String get name => JS('String', '#.name', this._jsObject);
|
| +
|
| + void set name(String name) {
|
| + JS('void', '#.name = #', this._jsObject, name);
|
| + }
|
| +
|
| + /// A unique and persistent id for the media gallery.
|
| + int get galleryId => JS('int', '#.galleryId', this._jsObject);
|
| +
|
| + void set galleryId(int galleryId) {
|
| + JS('void', '#.galleryId = #', this._jsObject, galleryId);
|
| + }
|
| +
|
| + /// If the media gallery is on a removable device, a unique id for the device.
|
| + int get deviceId => JS('int', '#.deviceId', this._jsObject);
|
| +
|
| + void set deviceId(int deviceId) {
|
| + JS('void', '#.deviceId = #', this._jsObject, deviceId);
|
| + }
|
| +
|
| + /// True if the media gallery is on a removable device.
|
| + bool get isRemovable => JS('bool', '#.isRemovable', this._jsObject);
|
| +
|
| + void set isRemovable(bool isRemovable) {
|
| + JS('void', '#.isRemovable = #', this._jsObject, isRemovable);
|
| + }
|
| +
|
| + /// True if the device the media gallery is on was detected as a media device.
|
| + /// i.e. a PTP or MTP device, or a DCIM directory is present.
|
| + bool get isMediaDevice => JS('bool', '#.isMediaDevice', this._jsObject);
|
| +
|
| + void set isMediaDevice(bool isMediaDevice) {
|
| + JS('void', '#.isMediaDevice = #', this._jsObject, isMediaDevice);
|
| + }
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_media_galleries {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + /// Get the media galleries configured in this user agent. If none are
|
| + /// configured or available, the callback will receive an empty array.
|
| + void getMediaFileSystems(void callback(List<DOMFileSystem> mediaFileSystems), [MediagalleriesMediaFileSystemsDetails details]) {
|
| + void __proxy_callback(mediaFileSystems) {
|
| + if (?callback) {
|
| + callback(mediaFileSystems);
|
| + }
|
| + }
|
| + JS('void', '#.getMediaFileSystems(#, #)', this._jsObject, convertArgument(details), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Get metadata about a specific media file system.
|
| + MediagalleriesMediaFileSystemMetadata getMediaFileSystemMetadata(DOMFileSystem mediaFileSystem) => new MediagalleriesMediaFileSystemMetadata._proxy(JS('', '#.getMediaFileSystemMetadata(#)', this._jsObject, convertArgument(mediaFileSystem)));
|
| +
|
| + API_media_galleries(this._jsObject) {
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Generated from namespace: mediaGalleriesPrivate
|
| +
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +class MediagalleriesprivateDeviceAttachmentDetails extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + MediagalleriesprivateDeviceAttachmentDetails({String deviceName, String deviceId}) {
|
| + if (?deviceName)
|
| + this.deviceName = deviceName;
|
| + if (?deviceId)
|
| + this.deviceId = deviceId;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + MediagalleriesprivateDeviceAttachmentDetails._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The name of the device.
|
| + String get deviceName => JS('String', '#.deviceName', this._jsObject);
|
| +
|
| + void set deviceName(String deviceName) {
|
| + JS('void', '#.deviceName = #', this._jsObject, deviceName);
|
| + }
|
| +
|
| + /// A transient id that unique identifies the device.
|
| + String get deviceId => JS('String', '#.deviceId', this._jsObject);
|
| +
|
| + void set deviceId(String deviceId) {
|
| + JS('void', '#.deviceId = #', this._jsObject, deviceId);
|
| + }
|
| +
|
| +}
|
| +
|
| +class MediagalleriesprivateDeviceDetachmentDetails extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + MediagalleriesprivateDeviceDetachmentDetails({String deviceId}) {
|
| + if (?deviceId)
|
| + this.deviceId = deviceId;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + MediagalleriesprivateDeviceDetachmentDetails._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// A transient id that unique identifies the device.
|
| + String get deviceId => JS('String', '#.deviceId', this._jsObject);
|
| +
|
| + void set deviceId(String deviceId) {
|
| + JS('void', '#.deviceId = #', this._jsObject, deviceId);
|
| + }
|
| +
|
| +}
|
| +
|
| +class MediagalleriesprivateGalleryChangeDetails extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + MediagalleriesprivateGalleryChangeDetails({int galleryId}) {
|
| + if (?galleryId)
|
| + this.galleryId = galleryId;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + MediagalleriesprivateGalleryChangeDetails._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// Gallery identifier.
|
| + int get galleryId => JS('int', '#.galleryId', this._jsObject);
|
| +
|
| + void set galleryId(int galleryId) {
|
| + JS('void', '#.galleryId = #', this._jsObject, galleryId);
|
| + }
|
| +
|
| +}
|
| +
|
| +class MediagalleriesprivateAddGalleryWatchResult extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + MediagalleriesprivateAddGalleryWatchResult({int galleryId, bool success}) {
|
| + if (?galleryId)
|
| + this.galleryId = galleryId;
|
| + if (?success)
|
| + this.success = success;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + MediagalleriesprivateAddGalleryWatchResult._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + int get galleryId => JS('int', '#.galleryId', this._jsObject);
|
| +
|
| + void set galleryId(int galleryId) {
|
| + JS('void', '#.galleryId = #', this._jsObject, galleryId);
|
| + }
|
| +
|
| + bool get success => JS('bool', '#.success', this._jsObject);
|
| +
|
| + void set success(bool success) {
|
| + JS('void', '#.success = #', this._jsObject, success);
|
| + }
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Events
|
| + */
|
| +
|
| +/// Fired when a media device gets attached.
|
| +class Event_media_galleries_private_onDeviceAttached extends Event {
|
| + void addListener(void callback(MediagalleriesprivateDeviceAttachmentDetails details)) {
|
| + void __proxy_callback(details) {
|
| + if (?callback) {
|
| + callback(new MediagalleriesprivateDeviceAttachmentDetails._proxy(details));
|
| + }
|
| + }
|
| + super.addListener(callback);
|
| + }
|
| +
|
| + void removeListener(void callback(MediagalleriesprivateDeviceAttachmentDetails details)) {
|
| + void __proxy_callback(details) {
|
| + if (?callback) {
|
| + callback(new MediagalleriesprivateDeviceAttachmentDetails._proxy(details));
|
| + }
|
| + }
|
| + super.removeListener(callback);
|
| + }
|
| +
|
| + bool hasListener(void callback(MediagalleriesprivateDeviceAttachmentDetails details)) {
|
| + void __proxy_callback(details) {
|
| + if (?callback) {
|
| + callback(new MediagalleriesprivateDeviceAttachmentDetails._proxy(details));
|
| + }
|
| + }
|
| + super.hasListener(callback);
|
| + }
|
| +
|
| + Event_media_galleries_private_onDeviceAttached(jsObject) : super._(jsObject, 1);
|
| +}
|
| +
|
| +/// Fired when a media device gets detached.
|
| +class Event_media_galleries_private_onDeviceDetached extends Event {
|
| + void addListener(void callback(MediagalleriesprivateDeviceDetachmentDetails details)) {
|
| + void __proxy_callback(details) {
|
| + if (?callback) {
|
| + callback(new MediagalleriesprivateDeviceDetachmentDetails._proxy(details));
|
| + }
|
| + }
|
| + super.addListener(callback);
|
| + }
|
| +
|
| + void removeListener(void callback(MediagalleriesprivateDeviceDetachmentDetails details)) {
|
| + void __proxy_callback(details) {
|
| + if (?callback) {
|
| + callback(new MediagalleriesprivateDeviceDetachmentDetails._proxy(details));
|
| + }
|
| + }
|
| + super.removeListener(callback);
|
| + }
|
| +
|
| + bool hasListener(void callback(MediagalleriesprivateDeviceDetachmentDetails details)) {
|
| + void __proxy_callback(details) {
|
| + if (?callback) {
|
| + callback(new MediagalleriesprivateDeviceDetachmentDetails._proxy(details));
|
| + }
|
| + }
|
| + super.hasListener(callback);
|
| + }
|
| +
|
| + Event_media_galleries_private_onDeviceDetached(jsObject) : super._(jsObject, 1);
|
| +}
|
| +
|
| +/// Fired when a media gallery is changed.
|
| +class Event_media_galleries_private_onGalleryChanged extends Event {
|
| + void addListener(void callback(MediagalleriesprivateGalleryChangeDetails details)) {
|
| + void __proxy_callback(details) {
|
| + if (?callback) {
|
| + callback(new MediagalleriesprivateGalleryChangeDetails._proxy(details));
|
| + }
|
| + }
|
| + super.addListener(callback);
|
| + }
|
| +
|
| + void removeListener(void callback(MediagalleriesprivateGalleryChangeDetails details)) {
|
| + void __proxy_callback(details) {
|
| + if (?callback) {
|
| + callback(new MediagalleriesprivateGalleryChangeDetails._proxy(details));
|
| + }
|
| + }
|
| + super.removeListener(callback);
|
| + }
|
| +
|
| + bool hasListener(void callback(MediagalleriesprivateGalleryChangeDetails details)) {
|
| + void __proxy_callback(details) {
|
| + if (?callback) {
|
| + callback(new MediagalleriesprivateGalleryChangeDetails._proxy(details));
|
| + }
|
| + }
|
| + super.hasListener(callback);
|
| + }
|
| +
|
| + Event_media_galleries_private_onGalleryChanged(jsObject) : super._(jsObject, 1);
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_media_galleries_private {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Events
|
| + */
|
| + Event_media_galleries_private_onDeviceAttached onDeviceAttached;
|
| + Event_media_galleries_private_onDeviceDetached onDeviceDetached;
|
| + Event_media_galleries_private_onGalleryChanged onGalleryChanged;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + void addGalleryWatch(int galleryId, void callback(MediagalleriesprivateAddGalleryWatchResult result)) {
|
| + void __proxy_callback(result) {
|
| + if (?callback) {
|
| + callback(new MediagalleriesprivateAddGalleryWatchResult._proxy(result));
|
| + }
|
| + }
|
| + JS('void', '#.addGalleryWatch(#, #)', this._jsObject, galleryId, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + void removeGalleryWatch(int galleryId) => JS('void', '#.removeGalleryWatch(#)', this._jsObject, galleryId);
|
| +
|
| + void getAllGalleryWatch(void callback(List<int> galleryIds)) => JS('void', '#.getAllGalleryWatch(#)', this._jsObject, convertDartClosureToJS(callback, 1));
|
| +
|
| + void removeAllGalleryWatch() => JS('void', '#.removeAllGalleryWatch()', this._jsObject);
|
| +
|
| + API_media_galleries_private(this._jsObject) {
|
| + onDeviceAttached = new Event_media_galleries_private_onDeviceAttached(JS('', '#.onDeviceAttached', this._jsObject));
|
| + onDeviceDetached = new Event_media_galleries_private_onDeviceDetached(JS('', '#.onDeviceDetached', this._jsObject));
|
| + onGalleryChanged = new Event_media_galleries_private_onGalleryChanged(JS('', '#.onGalleryChanged', this._jsObject));
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Generated from namespace: pushMessaging
|
| +
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +class PushmessagingMessage extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + PushmessagingMessage({int subchannelId, String payload}) {
|
| + if (?subchannelId)
|
| + this.subchannelId = subchannelId;
|
| + if (?payload)
|
| + this.payload = payload;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + PushmessagingMessage._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The subchannel the message was sent on; only values 0-3 are valid.
|
| + int get subchannelId => JS('int', '#.subchannelId', this._jsObject);
|
| +
|
| + void set subchannelId(int subchannelId) {
|
| + JS('void', '#.subchannelId = #', this._jsObject, subchannelId);
|
| + }
|
| +
|
| + /// The payload associated with the message, if any.
|
| + String get payload => JS('String', '#.payload', this._jsObject);
|
| +
|
| + void set payload(String payload) {
|
| + JS('void', '#.payload = #', this._jsObject, payload);
|
| + }
|
| +
|
| +}
|
| +
|
| +class PushmessagingChannelIdResult extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + PushmessagingChannelIdResult({String channelId}) {
|
| + if (?channelId)
|
| + this.channelId = channelId;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + PushmessagingChannelIdResult._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The channel ID for this app to use for push messaging.
|
| + String get channelId => JS('String', '#.channelId', this._jsObject);
|
| +
|
| + void set channelId(String channelId) {
|
| + JS('void', '#.channelId = #', this._jsObject, channelId);
|
| + }
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Events
|
| + */
|
| +
|
| +/// Fired when a push message has been received.
|
| +class Event_push_messaging_onMessage extends Event {
|
| + void addListener(void callback(PushmessagingMessage message)) {
|
| + void __proxy_callback(message) {
|
| + if (?callback) {
|
| + callback(new PushmessagingMessage._proxy(message));
|
| + }
|
| + }
|
| + super.addListener(callback);
|
| + }
|
| +
|
| + void removeListener(void callback(PushmessagingMessage message)) {
|
| + void __proxy_callback(message) {
|
| + if (?callback) {
|
| + callback(new PushmessagingMessage._proxy(message));
|
| + }
|
| + }
|
| + super.removeListener(callback);
|
| + }
|
| +
|
| + bool hasListener(void callback(PushmessagingMessage message)) {
|
| + void __proxy_callback(message) {
|
| + if (?callback) {
|
| + callback(new PushmessagingMessage._proxy(message));
|
| + }
|
| + }
|
| + super.hasListener(callback);
|
| + }
|
| +
|
| + Event_push_messaging_onMessage(jsObject) : super._(jsObject, 1);
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_push_messaging {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Events
|
| + */
|
| + Event_push_messaging_onMessage onMessage;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + /// Retrieves the channel ID associated with this app or extension. Typically
|
| + /// an app or extension will want to send this value to its application server
|
| + /// so the server can use it to trigger push messages back to the app or
|
| + /// extension. If the interactive flag is set, we will ask the user to log in
|
| + /// when they are not already logged in.
|
| + void getChannelId(void callback(PushmessagingChannelIdResult channelId), [bool interactive]) {
|
| + void __proxy_callback(channelId) {
|
| + if (?callback) {
|
| + callback(new PushmessagingChannelIdResult._proxy(channelId));
|
| + }
|
| + }
|
| + JS('void', '#.getChannelId(#, #)', this._jsObject, interactive, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + API_push_messaging(this._jsObject) {
|
| + onMessage = new Event_push_messaging_onMessage(JS('', '#.onMessage', this._jsObject));
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Generated from namespace: serial
|
| +
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +class SerialOpenOptions extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SerialOpenOptions({int bitrate}) {
|
| + if (?bitrate)
|
| + this.bitrate = bitrate;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SerialOpenOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The requested bitrate of the connection to be opened. For compatibility
|
| + /// with the widest range of hardware, this number should match one of
|
| + /// commonly-available bitrates, such as 110, 300, 1200, 2400, 4800, 9600,
|
| + /// 14400, 19200, 38400, 57600, 115200. There is no guarantee, of course, that
|
| + /// the device connected to the serial port will support the requested bitrate,
|
| + /// even if the port itself supports that bitrate.
|
| + int get bitrate => JS('int', '#.bitrate', this._jsObject);
|
| +
|
| + void set bitrate(int bitrate) {
|
| + JS('void', '#.bitrate = #', this._jsObject, bitrate);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SerialOpenInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SerialOpenInfo({int connectionId}) {
|
| + if (?connectionId)
|
| + this.connectionId = connectionId;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SerialOpenInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The id of the opened connection.
|
| + int get connectionId => JS('int', '#.connectionId', this._jsObject);
|
| +
|
| + void set connectionId(int connectionId) {
|
| + JS('void', '#.connectionId = #', this._jsObject, connectionId);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SerialReadInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SerialReadInfo({int bytesRead, String data}) {
|
| + if (?bytesRead)
|
| + this.bytesRead = bytesRead;
|
| + if (?data)
|
| + this.data = data;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SerialReadInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The number of bytes received, or a negative number if an error occurred.
|
| + /// This number will be smaller than the number of bytes requested in the
|
| + /// original read call if the call would need to block to read that number of
|
| + /// bytes.
|
| + int get bytesRead => JS('int', '#.bytesRead', this._jsObject);
|
| +
|
| + void set bytesRead(int bytesRead) {
|
| + JS('void', '#.bytesRead = #', this._jsObject, bytesRead);
|
| + }
|
| +
|
| + /// The data received.
|
| + String get data => JS('String', '#.data', this._jsObject);
|
| +
|
| + void set data(String data) {
|
| + JS('void', '#.data = #', this._jsObject, data);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SerialWriteInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SerialWriteInfo({int bytesWritten}) {
|
| + if (?bytesWritten)
|
| + this.bytesWritten = bytesWritten;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SerialWriteInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The number of bytes written.
|
| + int get bytesWritten => JS('int', '#.bytesWritten', this._jsObject);
|
| +
|
| + void set bytesWritten(int bytesWritten) {
|
| + JS('void', '#.bytesWritten = #', this._jsObject, bytesWritten);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SerialControlSignalOptions extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SerialControlSignalOptions({bool dtr, bool rts, bool dcd, bool cts}) {
|
| + if (?dtr)
|
| + this.dtr = dtr;
|
| + if (?rts)
|
| + this.rts = rts;
|
| + if (?dcd)
|
| + this.dcd = dcd;
|
| + if (?cts)
|
| + this.cts = cts;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SerialControlSignalOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// Serial control signals that your machine can send. Missing fields will be
|
| + /// set to false.
|
| + bool get dtr => JS('bool', '#.dtr', this._jsObject);
|
| +
|
| + void set dtr(bool dtr) {
|
| + JS('void', '#.dtr = #', this._jsObject, dtr);
|
| + }
|
| +
|
| + bool get rts => JS('bool', '#.rts', this._jsObject);
|
| +
|
| + void set rts(bool rts) {
|
| + JS('void', '#.rts = #', this._jsObject, rts);
|
| + }
|
| +
|
| + /// Serial control signals that your machine can receive. If a get operation
|
| + /// fails, success will be false, and these fields will be absent.<br/><br/>
|
| + /// DCD (Data Carrier Detect) is equivalent to RLSD (Receive Line Signal
|
| + /// Detect) on some platforms.
|
| + bool get dcd => JS('bool', '#.dcd', this._jsObject);
|
| +
|
| + void set dcd(bool dcd) {
|
| + JS('void', '#.dcd = #', this._jsObject, dcd);
|
| + }
|
| +
|
| + bool get cts => JS('bool', '#.cts', this._jsObject);
|
| +
|
| + void set cts(bool cts) {
|
| + JS('void', '#.cts = #', this._jsObject, cts);
|
| + }
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_serial {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + /// Returns names of valid ports on this machine, each of which is likely to be
|
| + /// valid to pass as the port argument to open(). The list is regenerated each
|
| + /// time this method is called, as port validity is dynamic.
|
| + void getPorts(void callback(List<String> ports)) => JS('void', '#.getPorts(#)', this._jsObject, convertDartClosureToJS(callback, 1));
|
| +
|
| + /// Opens a connection to the given serial port.
|
| + void open(String port, void callback(SerialOpenInfo openInfo), [SerialOpenOptions options]) {
|
| + void __proxy_callback(openInfo) {
|
| + if (?callback) {
|
| + callback(new SerialOpenInfo._proxy(openInfo));
|
| + }
|
| + }
|
| + JS('void', '#.open(#, #, #)', this._jsObject, port, convertArgument(options), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Closes an open connection.
|
| + void close(int connectionId, void callback(bool result)) => JS('void', '#.close(#, #)', this._jsObject, connectionId, convertDartClosureToJS(callback, 1));
|
| +
|
| + /// Reads a byte from the given connection.
|
| + void read(int connectionId, int bytesToRead, void callback(SerialReadInfo readInfo)) {
|
| + void __proxy_callback(readInfo) {
|
| + if (?callback) {
|
| + callback(new SerialReadInfo._proxy(readInfo));
|
| + }
|
| + }
|
| + JS('void', '#.read(#, #, #)', this._jsObject, connectionId, bytesToRead, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Writes a string to the given connection.
|
| + void write(int connectionId, String data, void callback(SerialWriteInfo writeInfo)) {
|
| + void __proxy_callback(writeInfo) {
|
| + if (?callback) {
|
| + callback(new SerialWriteInfo._proxy(writeInfo));
|
| + }
|
| + }
|
| + JS('void', '#.write(#, #, #)', this._jsObject, connectionId, data, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Flushes all bytes in the given connection's input and output buffers.
|
| + void flush(int connectionId, void callback(bool result)) => JS('void', '#.flush(#, #)', this._jsObject, connectionId, convertDartClosureToJS(callback, 1));
|
| +
|
| + void getControlSignals(int connectionId, void callback(SerialControlSignalOptions options)) {
|
| + void __proxy_callback(options) {
|
| + if (?callback) {
|
| + callback(new SerialControlSignalOptions._proxy(options));
|
| + }
|
| + }
|
| + JS('void', '#.getControlSignals(#, #)', this._jsObject, connectionId, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + void setControlSignals(int connectionId, SerialControlSignalOptions options, void callback(bool result)) => JS('void', '#.setControlSignals(#, #, #)', this._jsObject, connectionId, convertArgument(options), convertDartClosureToJS(callback, 1));
|
| +
|
| + API_serial(this._jsObject) {
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Generated from namespace: socket
|
| +
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +class SocketCreateOptions extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SocketCreateOptions({}) {
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SocketCreateOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +}
|
| +
|
| +class SocketCreateInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SocketCreateInfo({int socketId}) {
|
| + if (?socketId)
|
| + this.socketId = socketId;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SocketCreateInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The id of the newly created socket.
|
| + int get socketId => JS('int', '#.socketId', this._jsObject);
|
| +
|
| + void set socketId(int socketId) {
|
| + JS('void', '#.socketId = #', this._jsObject, socketId);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SocketAcceptInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SocketAcceptInfo({int resultCode, int socketId}) {
|
| + if (?resultCode)
|
| + this.resultCode = resultCode;
|
| + if (?socketId)
|
| + this.socketId = socketId;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SocketAcceptInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + int get resultCode => JS('int', '#.resultCode', this._jsObject);
|
| +
|
| + void set resultCode(int resultCode) {
|
| + JS('void', '#.resultCode = #', this._jsObject, resultCode);
|
| + }
|
| +
|
| + /// The id of the accepted socket.
|
| + int get socketId => JS('int', '#.socketId', this._jsObject);
|
| +
|
| + void set socketId(int socketId) {
|
| + JS('void', '#.socketId = #', this._jsObject, socketId);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SocketReadInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SocketReadInfo({int resultCode, String data}) {
|
| + if (?resultCode)
|
| + this.resultCode = resultCode;
|
| + if (?data)
|
| + this.data = data;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SocketReadInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The resultCode returned from the underlying read() call.
|
| + int get resultCode => JS('int', '#.resultCode', this._jsObject);
|
| +
|
| + void set resultCode(int resultCode) {
|
| + JS('void', '#.resultCode = #', this._jsObject, resultCode);
|
| + }
|
| +
|
| + String get data => JS('String', '#.data', this._jsObject);
|
| +
|
| + void set data(String data) {
|
| + JS('void', '#.data = #', this._jsObject, data);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SocketWriteInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SocketWriteInfo({int bytesWritten}) {
|
| + if (?bytesWritten)
|
| + this.bytesWritten = bytesWritten;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SocketWriteInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The number of bytes sent, or a negative error code.
|
| + int get bytesWritten => JS('int', '#.bytesWritten', this._jsObject);
|
| +
|
| + void set bytesWritten(int bytesWritten) {
|
| + JS('void', '#.bytesWritten = #', this._jsObject, bytesWritten);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SocketRecvFromInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SocketRecvFromInfo({int resultCode, String data, String address, int port}) {
|
| + if (?resultCode)
|
| + this.resultCode = resultCode;
|
| + if (?data)
|
| + this.data = data;
|
| + if (?address)
|
| + this.address = address;
|
| + if (?port)
|
| + this.port = port;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SocketRecvFromInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The resultCode returned from the underlying recvfrom() call.
|
| + int get resultCode => JS('int', '#.resultCode', this._jsObject);
|
| +
|
| + void set resultCode(int resultCode) {
|
| + JS('void', '#.resultCode = #', this._jsObject, resultCode);
|
| + }
|
| +
|
| + String get data => JS('String', '#.data', this._jsObject);
|
| +
|
| + void set data(String data) {
|
| + JS('void', '#.data = #', this._jsObject, data);
|
| + }
|
| +
|
| + /// The address of the remote machine.
|
| + String get address => JS('String', '#.address', this._jsObject);
|
| +
|
| + void set address(String address) {
|
| + JS('void', '#.address = #', this._jsObject, address);
|
| + }
|
| +
|
| + int get port => JS('int', '#.port', this._jsObject);
|
| +
|
| + void set port(int port) {
|
| + JS('void', '#.port = #', this._jsObject, port);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SocketSocketInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SocketSocketInfo({String socketType, bool connected, String peerAddress, int peerPort, String localAddress, int localPort}) {
|
| + if (?socketType)
|
| + this.socketType = socketType;
|
| + if (?connected)
|
| + this.connected = connected;
|
| + if (?peerAddress)
|
| + this.peerAddress = peerAddress;
|
| + if (?peerPort)
|
| + this.peerPort = peerPort;
|
| + if (?localAddress)
|
| + this.localAddress = localAddress;
|
| + if (?localPort)
|
| + this.localPort = localPort;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SocketSocketInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The type of the passed socket. This will be <code>tcp</code> or
|
| + /// <code>udp</code>.
|
| + String get socketType => JS('String', '#.socketType', this._jsObject);
|
| +
|
| + void set socketType(String socketType) {
|
| + JS('void', '#.socketType = #', this._jsObject, socketType);
|
| + }
|
| +
|
| + /// Whether or not the underlying socket is connected.<br/><br/> For
|
| + /// <code>tcp</code> sockets, this will remain true even if the remote peer has
|
| + /// disconnected. Reading or writing to the socket may then result in an error,
|
| + /// hinting that this socket should be disconnected via
|
| + /// <code>disconnect()</code>.<br/><br/> For <code>udp</code> sockets, this
|
| + /// just represents whether a default remote address has been specified for
|
| + /// reading and writing packets.
|
| + bool get connected => JS('bool', '#.connected', this._jsObject);
|
| +
|
| + void set connected(bool connected) {
|
| + JS('void', '#.connected = #', this._jsObject, connected);
|
| + }
|
| +
|
| + /// If the underlying socket is connected, contains the IPv4/6 address of the
|
| + /// peer.
|
| + String get peerAddress => JS('String', '#.peerAddress', this._jsObject);
|
| +
|
| + void set peerAddress(String peerAddress) {
|
| + JS('void', '#.peerAddress = #', this._jsObject, peerAddress);
|
| + }
|
| +
|
| + /// If the underlying socket is connected, contains the port of the connected
|
| + /// peer.
|
| + int get peerPort => JS('int', '#.peerPort', this._jsObject);
|
| +
|
| + void set peerPort(int peerPort) {
|
| + JS('void', '#.peerPort = #', this._jsObject, peerPort);
|
| + }
|
| +
|
| + /// If the underlying socket is bound or connected, contains its local IPv4/6
|
| + /// address.
|
| + String get localAddress => JS('String', '#.localAddress', this._jsObject);
|
| +
|
| + void set localAddress(String localAddress) {
|
| + JS('void', '#.localAddress = #', this._jsObject, localAddress);
|
| + }
|
| +
|
| + /// If the underlying socket is bound or connected, contains its local port.
|
| + int get localPort => JS('int', '#.localPort', this._jsObject);
|
| +
|
| + void set localPort(int localPort) {
|
| + JS('void', '#.localPort = #', this._jsObject, localPort);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SocketNetworkInterface extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SocketNetworkInterface({String name, String address}) {
|
| + if (?name)
|
| + this.name = name;
|
| + if (?address)
|
| + this.address = address;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SocketNetworkInterface._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The underlying name of the adapter. On *nix, this will typically be "eth0",
|
| + /// "lo", etc.
|
| + String get name => JS('String', '#.name', this._jsObject);
|
| +
|
| + void set name(String name) {
|
| + JS('void', '#.name = #', this._jsObject, name);
|
| + }
|
| +
|
| + /// The available IPv4/6 address.
|
| + String get address => JS('String', '#.address', this._jsObject);
|
| +
|
| + void set address(String address) {
|
| + JS('void', '#.address = #', this._jsObject, address);
|
| + }
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_socket {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + /// Creates a socket of the specified type that will connect to the specified
|
| + /// remote machine.
|
| + void create(String type, void callback(SocketCreateInfo createInfo), [SocketCreateOptions options]) {
|
| + void __proxy_callback(createInfo) {
|
| + if (?callback) {
|
| + callback(new SocketCreateInfo._proxy(createInfo));
|
| + }
|
| + }
|
| + JS('void', '#.create(#, #, #)', this._jsObject, type, convertArgument(options), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Destroys the socket. Each socket created should be destroyed after use.
|
| + void destroy(int socketId) => JS('void', '#.destroy(#)', this._jsObject, socketId);
|
| +
|
| + /// Connects the socket to the remote machine (for a <code>tcp</code> socket).
|
| + /// For a <code>udp</code> socket, this sets the default address which packets
|
| + /// are sent to and read from for <code>read()</code> and <code>write()</code>
|
| + /// calls.
|
| + void connect(int socketId, String hostname, int port, void callback(int result)) => JS('void', '#.connect(#, #, #, #)', this._jsObject, socketId, hostname, port, convertDartClosureToJS(callback, 1));
|
| +
|
| + /// Binds the local address for socket. Currently, it does not support TCP
|
| + /// socket.
|
| + void bind(int socketId, String address, int port, void callback(int result)) => JS('void', '#.bind(#, #, #, #)', this._jsObject, socketId, address, port, convertDartClosureToJS(callback, 1));
|
| +
|
| + /// Disconnects the socket. For UDP sockets, <code>disconnect</code> is a
|
| + /// non-operation but is safe to call.
|
| + void disconnect(int socketId) => JS('void', '#.disconnect(#)', this._jsObject, socketId);
|
| +
|
| + /// Reads data from the given connected socket.
|
| + void read(int socketId, void callback(SocketReadInfo readInfo), [int bufferSize]) {
|
| + void __proxy_callback(readInfo) {
|
| + if (?callback) {
|
| + callback(new SocketReadInfo._proxy(readInfo));
|
| + }
|
| + }
|
| + JS('void', '#.read(#, #, #)', this._jsObject, socketId, bufferSize, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Writes data on the given connected socket.
|
| + void write(int socketId, String data, void callback(SocketWriteInfo writeInfo)) {
|
| + void __proxy_callback(writeInfo) {
|
| + if (?callback) {
|
| + callback(new SocketWriteInfo._proxy(writeInfo));
|
| + }
|
| + }
|
| + JS('void', '#.write(#, #, #)', this._jsObject, socketId, data, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Receives data from the given UDP socket.
|
| + void recvFrom(int socketId, void callback(SocketRecvFromInfo recvFromInfo), [int bufferSize]) {
|
| + void __proxy_callback(recvFromInfo) {
|
| + if (?callback) {
|
| + callback(new SocketRecvFromInfo._proxy(recvFromInfo));
|
| + }
|
| + }
|
| + JS('void', '#.recvFrom(#, #, #)', this._jsObject, socketId, bufferSize, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Sends data on the given UDP socket to the given address and port.
|
| + void sendTo(int socketId, String data, String address, int port, void callback(SocketWriteInfo writeInfo)) {
|
| + void __proxy_callback(writeInfo) {
|
| + if (?callback) {
|
| + callback(new SocketWriteInfo._proxy(writeInfo));
|
| + }
|
| + }
|
| + JS('void', '#.sendTo(#, #, #, #, #)', this._jsObject, socketId, data, address, port, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// This method applies to TCP sockets only. Listens for connections on the
|
| + /// specified port and address. This effectively makes this a server socket,
|
| + /// and client socket functions (connect, read, write) can no longer be used on
|
| + /// this socket.
|
| + void listen(int socketId, String address, int port, void callback(int result), [int backlog]) => JS('void', '#.listen(#, #, #, #, #)', this._jsObject, socketId, address, port, backlog, convertDartClosureToJS(callback, 1));
|
| +
|
| + /// This method applies to TCP sockets only. Registers a callback function to
|
| + /// be called when a connection is accepted on this listening server socket.
|
| + /// Listen must be called first. If there is already an active accept callback,
|
| + /// this callback will be invoked immediately with an error as the resultCode.
|
| + void accept(int socketId, void callback(SocketAcceptInfo acceptInfo)) {
|
| + void __proxy_callback(acceptInfo) {
|
| + if (?callback) {
|
| + callback(new SocketAcceptInfo._proxy(acceptInfo));
|
| + }
|
| + }
|
| + JS('void', '#.accept(#, #)', this._jsObject, socketId, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Enables or disables the keep-alive functionality for a TCP connection.
|
| + void setKeepAlive(int socketId, bool enable, void callback(bool result), [int delay]) => JS('void', '#.setKeepAlive(#, #, #, #)', this._jsObject, socketId, enable, delay, convertDartClosureToJS(callback, 1));
|
| +
|
| + /// Sets or clears <code>TCP_NODELAY</code> for a TCP connection. Nagle's
|
| + /// algorithm will be disabled when <code>TCP_NODELAY</code> is set.
|
| + void setNoDelay(int socketId, bool noDelay, void callback(bool result)) => JS('void', '#.setNoDelay(#, #, #)', this._jsObject, socketId, noDelay, convertDartClosureToJS(callback, 1));
|
| +
|
| + /// Retrieves the state of the given socket.
|
| + void getInfo(int socketId, void callback(SocketSocketInfo result)) {
|
| + void __proxy_callback(result) {
|
| + if (?callback) {
|
| + callback(new SocketSocketInfo._proxy(result));
|
| + }
|
| + }
|
| + JS('void', '#.getInfo(#, #)', this._jsObject, socketId, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Retrieves information about local adapters on this system.
|
| + void getNetworkList(void callback(List<SocketNetworkInterface> result)) {
|
| + void __proxy_callback(result) {
|
| + if (?callback) {
|
| + List<SocketNetworkInterface> __proxy_result = new List<SocketNetworkInterface>();
|
| + for (var o in result) {
|
| + __proxy_result.add(new SocketNetworkInterface._proxy(o));
|
| + }
|
| + callback(__proxy_result);
|
| + }
|
| + }
|
| + JS('void', '#.getNetworkList(#)', this._jsObject, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + API_socket(this._jsObject) {
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Generated from namespace: syncFileSystem
|
| +
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +class SyncfilesystemFileInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SyncfilesystemFileInfo({FileEntry fileEntry, String status, String action, String direction}) {
|
| + if (?fileEntry)
|
| + this.fileEntry = fileEntry;
|
| + if (?status)
|
| + this.status = status;
|
| + if (?action)
|
| + this.action = action;
|
| + if (?direction)
|
| + this.direction = direction;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SyncfilesystemFileInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// |fileEntry| will contain name and path information of synchronized file. On
|
| + /// file deletion, fileEntry information will still be available but file will
|
| + /// no longer exist.
|
| + FileEntry get fileEntry => JS('FileEntry', '#.fileEntry', this._jsObject);
|
| +
|
| + void set fileEntry(FileEntry fileEntry) {
|
| + JS('void', '#.fileEntry = #', this._jsObject, convertArgument(fileEntry));
|
| + }
|
| +
|
| + String get status => JS('String', '#.status', this._jsObject);
|
| +
|
| + void set status(String status) {
|
| + JS('void', '#.status = #', this._jsObject, status);
|
| + }
|
| +
|
| + /// Only applies if status is synced.
|
| + String get action => JS('String', '#.action', this._jsObject);
|
| +
|
| + void set action(String action) {
|
| + JS('void', '#.action = #', this._jsObject, action);
|
| + }
|
| +
|
| + /// Only applies if status is synced.
|
| + String get direction => JS('String', '#.direction', this._jsObject);
|
| +
|
| + void set direction(String direction) {
|
| + JS('void', '#.direction = #', this._jsObject, direction);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SyncfilesystemStorageInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SyncfilesystemStorageInfo({int usageBytes, int quotaBytes}) {
|
| + if (?usageBytes)
|
| + this.usageBytes = usageBytes;
|
| + if (?quotaBytes)
|
| + this.quotaBytes = quotaBytes;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SyncfilesystemStorageInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + int get usageBytes => JS('int', '#.usageBytes', this._jsObject);
|
| +
|
| + void set usageBytes(int usageBytes) {
|
| + JS('void', '#.usageBytes = #', this._jsObject, usageBytes);
|
| + }
|
| +
|
| + int get quotaBytes => JS('int', '#.quotaBytes', this._jsObject);
|
| +
|
| + void set quotaBytes(int quotaBytes) {
|
| + JS('void', '#.quotaBytes = #', this._jsObject, quotaBytes);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SyncfilesystemServiceInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SyncfilesystemServiceInfo({String state, String description}) {
|
| + if (?state)
|
| + this.state = state;
|
| + if (?description)
|
| + this.description = description;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SyncfilesystemServiceInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + String get state => JS('String', '#.state', this._jsObject);
|
| +
|
| + void set state(String state) {
|
| + JS('void', '#.state = #', this._jsObject, state);
|
| + }
|
| +
|
| + String get description => JS('String', '#.description', this._jsObject);
|
| +
|
| + void set description(String description) {
|
| + JS('void', '#.description = #', this._jsObject, description);
|
| + }
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Events
|
| + */
|
| +
|
| +/// Fired when an error or other status change has happened in the sync
|
| +/// backend. (e.g. the sync is temporarily disabled due to network or
|
| +/// authentication error etc).
|
| +class Event_sync_file_system_onServiceStatusChanged extends Event {
|
| + void addListener(void callback(SyncfilesystemServiceInfo detail)) {
|
| + void __proxy_callback(detail) {
|
| + if (?callback) {
|
| + callback(new SyncfilesystemServiceInfo._proxy(detail));
|
| + }
|
| + }
|
| + super.addListener(callback);
|
| + }
|
| +
|
| + void removeListener(void callback(SyncfilesystemServiceInfo detail)) {
|
| + void __proxy_callback(detail) {
|
| + if (?callback) {
|
| + callback(new SyncfilesystemServiceInfo._proxy(detail));
|
| + }
|
| + }
|
| + super.removeListener(callback);
|
| + }
|
| +
|
| + bool hasListener(void callback(SyncfilesystemServiceInfo detail)) {
|
| + void __proxy_callback(detail) {
|
| + if (?callback) {
|
| + callback(new SyncfilesystemServiceInfo._proxy(detail));
|
| + }
|
| + }
|
| + super.hasListener(callback);
|
| + }
|
| +
|
| + Event_sync_file_system_onServiceStatusChanged(jsObject) : super._(jsObject, 1);
|
| +}
|
| +
|
| +/// Fired when a file has been updated by the background sync service.
|
| +class Event_sync_file_system_onFileStatusChanged extends Event {
|
| + void addListener(void callback(SyncfilesystemFileInfo detail)) {
|
| + void __proxy_callback(detail) {
|
| + if (?callback) {
|
| + callback(new SyncfilesystemFileInfo._proxy(detail));
|
| + }
|
| + }
|
| + super.addListener(callback);
|
| + }
|
| +
|
| + void removeListener(void callback(SyncfilesystemFileInfo detail)) {
|
| + void __proxy_callback(detail) {
|
| + if (?callback) {
|
| + callback(new SyncfilesystemFileInfo._proxy(detail));
|
| + }
|
| + }
|
| + super.removeListener(callback);
|
| + }
|
| +
|
| + bool hasListener(void callback(SyncfilesystemFileInfo detail)) {
|
| + void __proxy_callback(detail) {
|
| + if (?callback) {
|
| + callback(new SyncfilesystemFileInfo._proxy(detail));
|
| + }
|
| + }
|
| + super.hasListener(callback);
|
| + }
|
| +
|
| + Event_sync_file_system_onFileStatusChanged(jsObject) : super._(jsObject, 1);
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_sync_file_system {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Events
|
| + */
|
| + Event_sync_file_system_onServiceStatusChanged onServiceStatusChanged;
|
| + Event_sync_file_system_onFileStatusChanged onFileStatusChanged;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + /// Returns a syncable filesystem backed by Google Drive. The returned
|
| + /// DOMFileSystem instance can be operated on in the same way as the Temporary
|
| + /// and Persistant file systems. (http://www.w3.org/TR/file-system-api/).
|
| + /// Calling this multiple times from the same app will return the same handle
|
| + /// to the same file system.
|
| + void requestFileSystem(void callback(DOMFileSystem fileSystem)) {
|
| + void __proxy_callback(fileSystem) {
|
| + if (?callback) {
|
| + callback(fileSystem);
|
| + }
|
| + }
|
| + JS('void', '#.requestFileSystem(#)', this._jsObject, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Get usage and quota in bytes for sync file system with |serviceName|.
|
| + void getUsageAndQuota(DOMFileSystem fileSystem, void callback(SyncfilesystemStorageInfo info)) {
|
| + void __proxy_callback(info) {
|
| + if (?callback) {
|
| + callback(new SyncfilesystemStorageInfo._proxy(info));
|
| + }
|
| + }
|
| + JS('void', '#.getUsageAndQuota(#, #)', this._jsObject, convertArgument(fileSystem), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Deletes everything in the syncable filesystem.
|
| + void deleteFileSystem(DOMFileSystem fileSystem, void callback(bool result)) => JS('void', '#.deleteFileSystem(#, #)', this._jsObject, convertArgument(fileSystem), convertDartClosureToJS(callback, 1));
|
| +
|
| + /// Get the FileStatus for the given |fileEntry|.
|
| + void getFileStatus(FileEntry fileEntry, void callback(String status)) => JS('void', '#.getFileStatus(#, #)', this._jsObject, convertArgument(fileEntry), convertDartClosureToJS(callback, 1));
|
| +
|
| + API_sync_file_system(this._jsObject) {
|
| + onServiceStatusChanged = new Event_sync_file_system_onServiceStatusChanged(JS('', '#.onServiceStatusChanged', this._jsObject));
|
| + onFileStatusChanged = new Event_sync_file_system_onFileStatusChanged(JS('', '#.onFileStatusChanged', this._jsObject));
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Generated from namespace: systemIndicator
|
| +
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +class SystemindicatorSetIconDetails extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SystemindicatorSetIconDetails({Object path, Object imageData}) {
|
| + if (?path)
|
| + this.path = path;
|
| + if (?imageData)
|
| + this.imageData = imageData;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SystemindicatorSetIconDetails._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + Object get path => JS('Object', '#.path', this._jsObject);
|
| +
|
| + void set path(Object path) {
|
| + JS('void', '#.path = #', this._jsObject, convertArgument(path));
|
| + }
|
| +
|
| + Object get imageData => JS('Object', '#.imageData', this._jsObject);
|
| +
|
| + void set imageData(Object imageData) {
|
| + JS('void', '#.imageData = #', this._jsObject, convertArgument(imageData));
|
| + }
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Events
|
| + */
|
| +
|
| +/// Fired only when a click on the icon does not result in a menu being shown.
|
| +class Event_system_indicator_onClicked extends Event {
|
| + void addListener(void callback()) => super.addListener(callback);
|
| +
|
| + void removeListener(void callback()) => super.removeListener(callback);
|
| +
|
| + bool hasListener(void callback()) => super.hasListener(callback);
|
| +
|
| + Event_system_indicator_onClicked(jsObject) : super._(jsObject, 0);
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_system_indicator {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Events
|
| + */
|
| + Event_system_indicator_onClicked onClicked;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + /// Set the image to be used as an indicator icon, using a set of ImageData
|
| + /// objects. These objects should have multiple resolutions so that an
|
| + /// appropriate size can be selected for the given icon size and DPI scaling
|
| + /// settings. Only square ImageData objects are accepted.
|
| + void setIcon(SystemindicatorSetIconDetails details, [void callback()]) => JS('void', '#.setIcon(#, #)', this._jsObject, convertArgument(details), convertDartClosureToJS(callback, 0));
|
| +
|
| + /// Show the icon in the status tray.
|
| + void enable() => JS('void', '#.enable()', this._jsObject);
|
| +
|
| + /// Hide the icon from the status tray.
|
| + void disable() => JS('void', '#.disable()', this._jsObject);
|
| +
|
| + API_system_indicator(this._jsObject) {
|
| + onClicked = new Event_system_indicator_onClicked(JS('', '#.onClicked', this._jsObject));
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Generated from namespace: systemInfo.display
|
| +
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +class SysteminfoDisplayBounds extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SysteminfoDisplayBounds({int left, int top, int width, int height}) {
|
| + if (?left)
|
| + this.left = left;
|
| + if (?top)
|
| + this.top = top;
|
| + if (?width)
|
| + this.width = width;
|
| + if (?height)
|
| + this.height = height;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SysteminfoDisplayBounds._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The x-coordinate of the upper-left corner.
|
| + int get left => JS('int', '#.left', this._jsObject);
|
| +
|
| + void set left(int left) {
|
| + JS('void', '#.left = #', this._jsObject, left);
|
| + }
|
| +
|
| + /// The y-coordinate of the upper-left corner.
|
| + int get top => JS('int', '#.top', this._jsObject);
|
| +
|
| + void set top(int top) {
|
| + JS('void', '#.top = #', this._jsObject, top);
|
| + }
|
| +
|
| + /// The width of the display in pixels.
|
| + int get width => JS('int', '#.width', this._jsObject);
|
| +
|
| + void set width(int width) {
|
| + JS('void', '#.width = #', this._jsObject, width);
|
| + }
|
| +
|
| + /// The height of the display in pixels.
|
| + int get height => JS('int', '#.height', this._jsObject);
|
| +
|
| + void set height(int height) {
|
| + JS('void', '#.height = #', this._jsObject, height);
|
| + }
|
| +
|
| +}
|
| +
|
| +class SysteminfoDisplayDisplayUnitInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + SysteminfoDisplayDisplayUnitInfo({String id, String name, bool isPrimary, bool isInternal, bool isEnabled, double dpiX, double dpiY, SysteminfoDisplayBounds bounds, SysteminfoDisplayBounds workArea}) {
|
| + if (?id)
|
| + this.id = id;
|
| + if (?name)
|
| + this.name = name;
|
| + if (?isPrimary)
|
| + this.isPrimary = isPrimary;
|
| + if (?isInternal)
|
| + this.isInternal = isInternal;
|
| + if (?isEnabled)
|
| + this.isEnabled = isEnabled;
|
| + if (?dpiX)
|
| + this.dpiX = dpiX;
|
| + if (?dpiY)
|
| + this.dpiY = dpiY;
|
| + if (?bounds)
|
| + this.bounds = bounds;
|
| + if (?workArea)
|
| + this.workArea = workArea;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + SysteminfoDisplayDisplayUnitInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The unique identifier of the display.
|
| + String get id => JS('String', '#.id', this._jsObject);
|
| +
|
| + void set id(String id) {
|
| + JS('void', '#.id = #', this._jsObject, id);
|
| + }
|
| +
|
| + /// The user-friendly name (e.g. "HP LCD monitor").
|
| + String get name => JS('String', '#.name', this._jsObject);
|
| +
|
| + void set name(String name) {
|
| + JS('void', '#.name = #', this._jsObject, name);
|
| + }
|
| +
|
| + /// True if this is the primary display.
|
| + bool get isPrimary => JS('bool', '#.isPrimary', this._jsObject);
|
| +
|
| + void set isPrimary(bool isPrimary) {
|
| + JS('void', '#.isPrimary = #', this._jsObject, isPrimary);
|
| + }
|
| +
|
| + /// True if this is an internal display.
|
| + bool get isInternal => JS('bool', '#.isInternal', this._jsObject);
|
| +
|
| + void set isInternal(bool isInternal) {
|
| + JS('void', '#.isInternal = #', this._jsObject, isInternal);
|
| + }
|
| +
|
| + /// True if this display is enabled.
|
| + bool get isEnabled => JS('bool', '#.isEnabled', this._jsObject);
|
| +
|
| + void set isEnabled(bool isEnabled) {
|
| + JS('void', '#.isEnabled = #', this._jsObject, isEnabled);
|
| + }
|
| +
|
| + /// The number of pixels per inch along the x-axis.
|
| + double get dpiX => JS('double', '#.dpiX', this._jsObject);
|
| +
|
| + void set dpiX(double dpiX) {
|
| + JS('void', '#.dpiX = #', this._jsObject, dpiX);
|
| + }
|
| +
|
| + /// The number of pixels per inch along the y-axis.
|
| + double get dpiY => JS('double', '#.dpiY', this._jsObject);
|
| +
|
| + void set dpiY(double dpiY) {
|
| + JS('void', '#.dpiY = #', this._jsObject, dpiY);
|
| + }
|
| +
|
| + /// The bounds of the display.
|
| + SysteminfoDisplayBounds get bounds => new SysteminfoDisplayBounds._proxy(JS('', '#.bounds', this._jsObject));
|
| +
|
| + void set bounds(SysteminfoDisplayBounds bounds) {
|
| + JS('void', '#.bounds = #', this._jsObject, convertArgument(bounds));
|
| + }
|
| +
|
| + /// The usable work area of the display.
|
| + SysteminfoDisplayBounds get workArea => new SysteminfoDisplayBounds._proxy(JS('', '#.workArea', this._jsObject));
|
| +
|
| + void set workArea(SysteminfoDisplayBounds workArea) {
|
| + JS('void', '#.workArea = #', this._jsObject, convertArgument(workArea));
|
| + }
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Events
|
| + */
|
| +
|
| +/// Fired when anything changes to the display configuration.
|
| +class Event_system_info_display_onDisplayChanged extends Event {
|
| + void addListener(void callback()) => super.addListener(callback);
|
| +
|
| + void removeListener(void callback()) => super.removeListener(callback);
|
| +
|
| + bool hasListener(void callback()) => super.hasListener(callback);
|
| +
|
| + Event_system_info_display_onDisplayChanged(jsObject) : super._(jsObject, 0);
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_system_info_display {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Events
|
| + */
|
| + Event_system_info_display_onDisplayChanged onDisplayChanged;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + /// Get the information of all attached display devices.
|
| + void getDisplayInfo(void callback(List<SysteminfoDisplayDisplayUnitInfo> displayInfo)) {
|
| + void __proxy_callback(displayInfo) {
|
| + if (?callback) {
|
| + List<SysteminfoDisplayDisplayUnitInfo> __proxy_displayInfo = new List<SysteminfoDisplayDisplayUnitInfo>();
|
| + for (var o in displayInfo) {
|
| + __proxy_displayInfo.add(new SysteminfoDisplayDisplayUnitInfo._proxy(o));
|
| + }
|
| + callback(__proxy_displayInfo);
|
| + }
|
| + }
|
| + JS('void', '#.getDisplayInfo(#)', this._jsObject, convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + API_system_info_display(this._jsObject) {
|
| + onDisplayChanged = new Event_system_info_display_onDisplayChanged(JS('', '#.onDisplayChanged', this._jsObject));
|
| + }
|
| +}
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// Generated from namespace: usb
|
| +
|
| +
|
| +/**
|
| + * Types
|
| + */
|
| +
|
| +class UsbDevice extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + UsbDevice({int handle, int vendorId, int productId}) {
|
| + if (?handle)
|
| + this.handle = handle;
|
| + if (?vendorId)
|
| + this.vendorId = vendorId;
|
| + if (?productId)
|
| + this.productId = productId;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + UsbDevice._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + int get handle => JS('int', '#.handle', this._jsObject);
|
| +
|
| + void set handle(int handle) {
|
| + JS('void', '#.handle = #', this._jsObject, handle);
|
| + }
|
| +
|
| + int get vendorId => JS('int', '#.vendorId', this._jsObject);
|
| +
|
| + void set vendorId(int vendorId) {
|
| + JS('void', '#.vendorId = #', this._jsObject, vendorId);
|
| + }
|
| +
|
| + int get productId => JS('int', '#.productId', this._jsObject);
|
| +
|
| + void set productId(int productId) {
|
| + JS('void', '#.productId = #', this._jsObject, productId);
|
| + }
|
| +
|
| +}
|
| +
|
| +class UsbControlTransferInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + UsbControlTransferInfo({String direction, String recipient, String requestType, int request, int value, int index, int length, String data}) {
|
| + if (?direction)
|
| + this.direction = direction;
|
| + if (?recipient)
|
| + this.recipient = recipient;
|
| + if (?requestType)
|
| + this.requestType = requestType;
|
| + if (?request)
|
| + this.request = request;
|
| + if (?value)
|
| + this.value = value;
|
| + if (?index)
|
| + this.index = index;
|
| + if (?length)
|
| + this.length = length;
|
| + if (?data)
|
| + this.data = data;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + UsbControlTransferInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The direction of this transfer.
|
| + String get direction => JS('String', '#.direction', this._jsObject);
|
| +
|
| + void set direction(String direction) {
|
| + JS('void', '#.direction = #', this._jsObject, direction);
|
| + }
|
| +
|
| + /// The intended recipient for this transfer.
|
| + String get recipient => JS('String', '#.recipient', this._jsObject);
|
| +
|
| + void set recipient(String recipient) {
|
| + JS('void', '#.recipient = #', this._jsObject, recipient);
|
| + }
|
| +
|
| + /// The type of this request.
|
| + String get requestType => JS('String', '#.requestType', this._jsObject);
|
| +
|
| + void set requestType(String requestType) {
|
| + JS('void', '#.requestType = #', this._jsObject, requestType);
|
| + }
|
| +
|
| + int get request => JS('int', '#.request', this._jsObject);
|
| +
|
| + void set request(int request) {
|
| + JS('void', '#.request = #', this._jsObject, request);
|
| + }
|
| +
|
| + int get value => JS('int', '#.value', this._jsObject);
|
| +
|
| + void set value(int value) {
|
| + JS('void', '#.value = #', this._jsObject, value);
|
| + }
|
| +
|
| + int get index => JS('int', '#.index', this._jsObject);
|
| +
|
| + void set index(int index) {
|
| + JS('void', '#.index = #', this._jsObject, index);
|
| + }
|
| +
|
| + /// If this transfer is an input transfer, then this field must be set to
|
| + /// indicate the expected data length. If this is an output transfer, then this
|
| + /// field is ignored.
|
| + int get length => JS('int', '#.length', this._jsObject);
|
| +
|
| + void set length(int length) {
|
| + JS('void', '#.length = #', this._jsObject, length);
|
| + }
|
| +
|
| + /// The data payload carried by this transfer. If this is an output tranfer
|
| + /// then this field must be set.
|
| + String get data => JS('String', '#.data', this._jsObject);
|
| +
|
| + void set data(String data) {
|
| + JS('void', '#.data = #', this._jsObject, data);
|
| + }
|
| +
|
| +}
|
| +
|
| +class UsbGenericTransferInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + UsbGenericTransferInfo({String direction, int endpoint, int length, String data}) {
|
| + if (?direction)
|
| + this.direction = direction;
|
| + if (?endpoint)
|
| + this.endpoint = endpoint;
|
| + if (?length)
|
| + this.length = length;
|
| + if (?data)
|
| + this.data = data;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + UsbGenericTransferInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// The direction of this transfer.
|
| + String get direction => JS('String', '#.direction', this._jsObject);
|
| +
|
| + void set direction(String direction) {
|
| + JS('void', '#.direction = #', this._jsObject, direction);
|
| + }
|
| +
|
| + int get endpoint => JS('int', '#.endpoint', this._jsObject);
|
| +
|
| + void set endpoint(int endpoint) {
|
| + JS('void', '#.endpoint = #', this._jsObject, endpoint);
|
| + }
|
| +
|
| + /// If this is an input transfer then this field indicates the size of the
|
| + /// input buffer. If this is an output transfer then this field is ignored.
|
| + int get length => JS('int', '#.length', this._jsObject);
|
| +
|
| + void set length(int length) {
|
| + JS('void', '#.length = #', this._jsObject, length);
|
| + }
|
| +
|
| + /// If this is an output transfer then this field must be populated. Otherwise,
|
| + /// it will be ignored.
|
| + String get data => JS('String', '#.data', this._jsObject);
|
| +
|
| + void set data(String data) {
|
| + JS('void', '#.data = #', this._jsObject, data);
|
| + }
|
| +
|
| +}
|
| +
|
| +class UsbIsochronousTransferInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + UsbIsochronousTransferInfo({UsbGenericTransferInfo transferInfo, int packets, int packetLength}) {
|
| + if (?transferInfo)
|
| + this.transferInfo = transferInfo;
|
| + if (?packets)
|
| + this.packets = packets;
|
| + if (?packetLength)
|
| + this.packetLength = packetLength;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + UsbIsochronousTransferInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// All of the normal transfer parameters are encapsulated in the transferInfo
|
| + /// parameters. Note that the data specified in this parameter block is split
|
| + /// along packetLength boundaries to form the individual packets of the
|
| + /// transfer.
|
| + UsbGenericTransferInfo get transferInfo => new UsbGenericTransferInfo._proxy(JS('', '#.transferInfo', this._jsObject));
|
| +
|
| + void set transferInfo(UsbGenericTransferInfo transferInfo) {
|
| + JS('void', '#.transferInfo = #', this._jsObject, convertArgument(transferInfo));
|
| + }
|
| +
|
| + /// The total number of packets in this transfer.
|
| + int get packets => JS('int', '#.packets', this._jsObject);
|
| +
|
| + void set packets(int packets) {
|
| + JS('void', '#.packets = #', this._jsObject, packets);
|
| + }
|
| +
|
| + /// The length of each of the packets in this transfer.
|
| + int get packetLength => JS('int', '#.packetLength', this._jsObject);
|
| +
|
| + void set packetLength(int packetLength) {
|
| + JS('void', '#.packetLength = #', this._jsObject, packetLength);
|
| + }
|
| +
|
| +}
|
| +
|
| +class UsbTransferResultInfo extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + UsbTransferResultInfo({int resultCode, String data}) {
|
| + if (?resultCode)
|
| + this.resultCode = resultCode;
|
| + if (?data)
|
| + this.data = data;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + UsbTransferResultInfo._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + /// A value of 0 indicates that the transfer was a success. Other values
|
| + /// indicate failure.
|
| + int get resultCode => JS('int', '#.resultCode', this._jsObject);
|
| +
|
| + void set resultCode(int resultCode) {
|
| + JS('void', '#.resultCode = #', this._jsObject, resultCode);
|
| + }
|
| +
|
| + /// If the transfer was an input transfer then this field will contain all of
|
| + /// the input data requested.
|
| + String get data => JS('String', '#.data', this._jsObject);
|
| +
|
| + void set data(String data) {
|
| + JS('void', '#.data = #', this._jsObject, data);
|
| + }
|
| +
|
| +}
|
| +
|
| +class UsbFindDevicesOptions extends ChromeObject {
|
| + /*
|
| + * Public constructor
|
| + */
|
| + UsbFindDevicesOptions({int vendorId, int productId}) {
|
| + if (?vendorId)
|
| + this.vendorId = vendorId;
|
| + if (?productId)
|
| + this.productId = productId;
|
| + }
|
| +
|
| + /*
|
| + * Private constructor
|
| + */
|
| + UsbFindDevicesOptions._proxy(_jsObject) : super._proxy(_jsObject);
|
| +
|
| + /*
|
| + * Public accessors
|
| + */
|
| + int get vendorId => JS('int', '#.vendorId', this._jsObject);
|
| +
|
| + void set vendorId(int vendorId) {
|
| + JS('void', '#.vendorId = #', this._jsObject, vendorId);
|
| + }
|
| +
|
| + int get productId => JS('int', '#.productId', this._jsObject);
|
| +
|
| + void set productId(int productId) {
|
| + JS('void', '#.productId = #', this._jsObject, productId);
|
| + }
|
| +
|
| +}
|
| +
|
| +/**
|
| + * Functions
|
| + */
|
| +
|
| +class API_usb {
|
| + /*
|
| + * API connection
|
| + */
|
| + Object _jsObject;
|
| +
|
| + /*
|
| + * Functions
|
| + */
|
| + /// Finds the first instance of the USB device specified by the vendorId/
|
| + /// productId pair and, if permissions allow, opens it for use. Upon
|
| + /// successfully opening a device the callback is invoked with a populated
|
| + /// Device object. On failure, the callback is invoked with null.
|
| + void findDevices(UsbFindDevicesOptions options, void callback(List<UsbDevice> device)) {
|
| + void __proxy_callback(device) {
|
| + if (?callback) {
|
| + List<UsbDevice> __proxy_device = new List<UsbDevice>();
|
| + for (var o in device) {
|
| + __proxy_device.add(new UsbDevice._proxy(o));
|
| + }
|
| + callback(__proxy_device);
|
| + }
|
| + }
|
| + JS('void', '#.findDevices(#, #)', this._jsObject, convertArgument(options), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Closes an open device instance. Invoking operations on a device after it
|
| + /// has been closed is a safe operation, but causes no action to be taken.
|
| + void closeDevice(UsbDevice device, [void callback()]) => JS('void', '#.closeDevice(#, #)', this._jsObject, convertArgument(device), convertDartClosureToJS(callback, 0));
|
| +
|
| + /// Claims an interface on the specified USB device.
|
| + void claimInterface(UsbDevice device, int interfaceNumber, void callback()) => JS('void', '#.claimInterface(#, #, #)', this._jsObject, convertArgument(device), interfaceNumber, convertDartClosureToJS(callback, 0));
|
| +
|
| + /// Releases a claim to an interface on the provided device.
|
| + void releaseInterface(UsbDevice device, int interfaceNumber, void callback()) => JS('void', '#.releaseInterface(#, #, #)', this._jsObject, convertArgument(device), interfaceNumber, convertDartClosureToJS(callback, 0));
|
| +
|
| + /// Selects an alternate setting on a previously claimed interface on a device.
|
| + void setInterfaceAlternateSetting(UsbDevice device, int interfaceNumber, int alternateSetting, void callback()) => JS('void', '#.setInterfaceAlternateSetting(#, #, #, #)', this._jsObject, convertArgument(device), interfaceNumber, alternateSetting, convertDartClosureToJS(callback, 0));
|
| +
|
| + /// Performs a control transfer on the specified device. See the
|
| + /// ControlTransferInfo structure for the parameters required to make a
|
| + /// transfer.
|
| + void controlTransfer(UsbDevice device, UsbControlTransferInfo transferInfo, void callback(UsbTransferResultInfo info)) {
|
| + void __proxy_callback(info) {
|
| + if (?callback) {
|
| + callback(new UsbTransferResultInfo._proxy(info));
|
| + }
|
| + }
|
| + JS('void', '#.controlTransfer(#, #, #)', this._jsObject, convertArgument(device), convertArgument(transferInfo), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Performs a bulk transfer on the specified device.
|
| + void bulkTransfer(UsbDevice device, UsbGenericTransferInfo transferInfo, void callback(UsbTransferResultInfo info)) {
|
| + void __proxy_callback(info) {
|
| + if (?callback) {
|
| + callback(new UsbTransferResultInfo._proxy(info));
|
| + }
|
| + }
|
| + JS('void', '#.bulkTransfer(#, #, #)', this._jsObject, convertArgument(device), convertArgument(transferInfo), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Performs an interrupt transfer on the specified device.
|
| + void interruptTransfer(UsbDevice device, UsbGenericTransferInfo transferInfo, void callback(UsbTransferResultInfo info)) {
|
| + void __proxy_callback(info) {
|
| + if (?callback) {
|
| + callback(new UsbTransferResultInfo._proxy(info));
|
| + }
|
| + }
|
| + JS('void', '#.interruptTransfer(#, #, #)', this._jsObject, convertArgument(device), convertArgument(transferInfo), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + /// Performs an isochronous transfer on the specific device.
|
| + void isochronousTransfer(UsbDevice device, UsbIsochronousTransferInfo transferInfo, void callback(UsbTransferResultInfo info)) {
|
| + void __proxy_callback(info) {
|
| + if (?callback) {
|
| + callback(new UsbTransferResultInfo._proxy(info));
|
| + }
|
| + }
|
| + JS('void', '#.isochronousTransfer(#, #, #)', this._jsObject, convertArgument(device), convertArgument(transferInfo), convertDartClosureToJS(__proxy_callback, 1));
|
| + }
|
| +
|
| + API_usb(this._jsObject) {
|
| }
|
| }
|
|
|