| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // Generated from namespace: mediaGalleriesPrivate |
| 6 |
| 7 part of chrome; |
| 8 |
| 9 /** |
| 10 * Types |
| 11 */ |
| 12 |
| 13 class MediagalleriesprivateDeviceAttachmentDetails extends ChromeObject { |
| 14 /* |
| 15 * Public constructor |
| 16 */ |
| 17 MediagalleriesprivateDeviceAttachmentDetails({String deviceName, String device
Id}) { |
| 18 if (?deviceName) |
| 19 this.deviceName = deviceName; |
| 20 if (?deviceId) |
| 21 this.deviceId = deviceId; |
| 22 } |
| 23 |
| 24 /* |
| 25 * Private constructor |
| 26 */ |
| 27 MediagalleriesprivateDeviceAttachmentDetails._proxy(_jsObject) : super._proxy(
_jsObject); |
| 28 |
| 29 /* |
| 30 * Public accessors |
| 31 */ |
| 32 /// The name of the device. |
| 33 String get deviceName => JS('String', '#.deviceName', this._jsObject); |
| 34 |
| 35 void set deviceName(String deviceName) { |
| 36 JS('void', '#.deviceName = #', this._jsObject, deviceName); |
| 37 } |
| 38 |
| 39 /// A transient id that unique identifies the device. |
| 40 String get deviceId => JS('String', '#.deviceId', this._jsObject); |
| 41 |
| 42 void set deviceId(String deviceId) { |
| 43 JS('void', '#.deviceId = #', this._jsObject, deviceId); |
| 44 } |
| 45 |
| 46 } |
| 47 |
| 48 class MediagalleriesprivateDeviceDetachmentDetails extends ChromeObject { |
| 49 /* |
| 50 * Public constructor |
| 51 */ |
| 52 MediagalleriesprivateDeviceDetachmentDetails({String deviceId}) { |
| 53 if (?deviceId) |
| 54 this.deviceId = deviceId; |
| 55 } |
| 56 |
| 57 /* |
| 58 * Private constructor |
| 59 */ |
| 60 MediagalleriesprivateDeviceDetachmentDetails._proxy(_jsObject) : super._proxy(
_jsObject); |
| 61 |
| 62 /* |
| 63 * Public accessors |
| 64 */ |
| 65 /// A transient id that unique identifies the device. |
| 66 String get deviceId => JS('String', '#.deviceId', this._jsObject); |
| 67 |
| 68 void set deviceId(String deviceId) { |
| 69 JS('void', '#.deviceId = #', this._jsObject, deviceId); |
| 70 } |
| 71 |
| 72 } |
| 73 |
| 74 class MediagalleriesprivateGalleryChangeDetails extends ChromeObject { |
| 75 /* |
| 76 * Public constructor |
| 77 */ |
| 78 MediagalleriesprivateGalleryChangeDetails({int galleryId}) { |
| 79 if (?galleryId) |
| 80 this.galleryId = galleryId; |
| 81 } |
| 82 |
| 83 /* |
| 84 * Private constructor |
| 85 */ |
| 86 MediagalleriesprivateGalleryChangeDetails._proxy(_jsObject) : super._proxy(_js
Object); |
| 87 |
| 88 /* |
| 89 * Public accessors |
| 90 */ |
| 91 /// Gallery identifier. |
| 92 int get galleryId => JS('int', '#.galleryId', this._jsObject); |
| 93 |
| 94 void set galleryId(int galleryId) { |
| 95 JS('void', '#.galleryId = #', this._jsObject, galleryId); |
| 96 } |
| 97 |
| 98 } |
| 99 |
| 100 class MediagalleriesprivateAddGalleryWatchResult extends ChromeObject { |
| 101 /* |
| 102 * Public constructor |
| 103 */ |
| 104 MediagalleriesprivateAddGalleryWatchResult({int galleryId, bool success}) { |
| 105 if (?galleryId) |
| 106 this.galleryId = galleryId; |
| 107 if (?success) |
| 108 this.success = success; |
| 109 } |
| 110 |
| 111 /* |
| 112 * Private constructor |
| 113 */ |
| 114 MediagalleriesprivateAddGalleryWatchResult._proxy(_jsObject) : super._proxy(_j
sObject); |
| 115 |
| 116 /* |
| 117 * Public accessors |
| 118 */ |
| 119 int get galleryId => JS('int', '#.galleryId', this._jsObject); |
| 120 |
| 121 void set galleryId(int galleryId) { |
| 122 JS('void', '#.galleryId = #', this._jsObject, galleryId); |
| 123 } |
| 124 |
| 125 bool get success => JS('bool', '#.success', this._jsObject); |
| 126 |
| 127 void set success(bool success) { |
| 128 JS('void', '#.success = #', this._jsObject, success); |
| 129 } |
| 130 |
| 131 } |
| 132 |
| 133 /** |
| 134 * Events |
| 135 */ |
| 136 |
| 137 /// Fired when a media device gets attached. |
| 138 class Event_media_galleries_private_onDeviceAttached extends Event { |
| 139 void addListener(void callback(MediagalleriesprivateDeviceAttachmentDetails de
tails)) { |
| 140 void __proxy_callback(details) { |
| 141 if (?callback) { |
| 142 callback(new MediagalleriesprivateDeviceAttachmentDetails._proxy(details
)); |
| 143 } |
| 144 } |
| 145 super.addListener(callback); |
| 146 } |
| 147 |
| 148 void removeListener(void callback(MediagalleriesprivateDeviceAttachmentDetails
details)) { |
| 149 void __proxy_callback(details) { |
| 150 if (?callback) { |
| 151 callback(new MediagalleriesprivateDeviceAttachmentDetails._proxy(details
)); |
| 152 } |
| 153 } |
| 154 super.removeListener(callback); |
| 155 } |
| 156 |
| 157 bool hasListener(void callback(MediagalleriesprivateDeviceAttachmentDetails de
tails)) { |
| 158 void __proxy_callback(details) { |
| 159 if (?callback) { |
| 160 callback(new MediagalleriesprivateDeviceAttachmentDetails._proxy(details
)); |
| 161 } |
| 162 } |
| 163 super.hasListener(callback); |
| 164 } |
| 165 |
| 166 Event_media_galleries_private_onDeviceAttached(jsObject) : super._(jsObject, 1
); |
| 167 } |
| 168 |
| 169 /// Fired when a media device gets detached. |
| 170 class Event_media_galleries_private_onDeviceDetached extends Event { |
| 171 void addListener(void callback(MediagalleriesprivateDeviceDetachmentDetails de
tails)) { |
| 172 void __proxy_callback(details) { |
| 173 if (?callback) { |
| 174 callback(new MediagalleriesprivateDeviceDetachmentDetails._proxy(details
)); |
| 175 } |
| 176 } |
| 177 super.addListener(callback); |
| 178 } |
| 179 |
| 180 void removeListener(void callback(MediagalleriesprivateDeviceDetachmentDetails
details)) { |
| 181 void __proxy_callback(details) { |
| 182 if (?callback) { |
| 183 callback(new MediagalleriesprivateDeviceDetachmentDetails._proxy(details
)); |
| 184 } |
| 185 } |
| 186 super.removeListener(callback); |
| 187 } |
| 188 |
| 189 bool hasListener(void callback(MediagalleriesprivateDeviceDetachmentDetails de
tails)) { |
| 190 void __proxy_callback(details) { |
| 191 if (?callback) { |
| 192 callback(new MediagalleriesprivateDeviceDetachmentDetails._proxy(details
)); |
| 193 } |
| 194 } |
| 195 super.hasListener(callback); |
| 196 } |
| 197 |
| 198 Event_media_galleries_private_onDeviceDetached(jsObject) : super._(jsObject, 1
); |
| 199 } |
| 200 |
| 201 /// Fired when a media gallery is changed. |
| 202 class Event_media_galleries_private_onGalleryChanged extends Event { |
| 203 void addListener(void callback(MediagalleriesprivateGalleryChangeDetails detai
ls)) { |
| 204 void __proxy_callback(details) { |
| 205 if (?callback) { |
| 206 callback(new MediagalleriesprivateGalleryChangeDetails._proxy(details)); |
| 207 } |
| 208 } |
| 209 super.addListener(callback); |
| 210 } |
| 211 |
| 212 void removeListener(void callback(MediagalleriesprivateGalleryChangeDetails de
tails)) { |
| 213 void __proxy_callback(details) { |
| 214 if (?callback) { |
| 215 callback(new MediagalleriesprivateGalleryChangeDetails._proxy(details)); |
| 216 } |
| 217 } |
| 218 super.removeListener(callback); |
| 219 } |
| 220 |
| 221 bool hasListener(void callback(MediagalleriesprivateGalleryChangeDetails detai
ls)) { |
| 222 void __proxy_callback(details) { |
| 223 if (?callback) { |
| 224 callback(new MediagalleriesprivateGalleryChangeDetails._proxy(details)); |
| 225 } |
| 226 } |
| 227 super.hasListener(callback); |
| 228 } |
| 229 |
| 230 Event_media_galleries_private_onGalleryChanged(jsObject) : super._(jsObject, 1
); |
| 231 } |
| 232 |
| 233 /** |
| 234 * Functions |
| 235 */ |
| 236 |
| 237 class API_media_galleries_private { |
| 238 /* |
| 239 * API connection |
| 240 */ |
| 241 Object _jsObject; |
| 242 |
| 243 /* |
| 244 * Events |
| 245 */ |
| 246 Event_media_galleries_private_onDeviceAttached onDeviceAttached; |
| 247 Event_media_galleries_private_onDeviceDetached onDeviceDetached; |
| 248 Event_media_galleries_private_onGalleryChanged onGalleryChanged; |
| 249 |
| 250 /* |
| 251 * Functions |
| 252 */ |
| 253 void addGalleryWatch(int galleryId, void callback(MediagalleriesprivateAddGall
eryWatchResult result)) { |
| 254 void __proxy_callback(result) { |
| 255 if (?callback) { |
| 256 callback(new MediagalleriesprivateAddGalleryWatchResult._proxy(result)); |
| 257 } |
| 258 } |
| 259 JS('void', '#.addGalleryWatch(#, #)', this._jsObject, galleryId, convertDart
ClosureToJS(__proxy_callback, 1)); |
| 260 } |
| 261 |
| 262 void removeGalleryWatch(int galleryId) => JS('void', '#.removeGalleryWatch(#)'
, this._jsObject, galleryId); |
| 263 |
| 264 void getAllGalleryWatch(void callback(List<int> galleryIds)) => JS('void', '#.
getAllGalleryWatch(#)', this._jsObject, convertDartClosureToJS(callback, 1)); |
| 265 |
| 266 void removeAllGalleryWatch() => JS('void', '#.removeAllGalleryWatch()', this._
jsObject); |
| 267 |
| 268 API_media_galleries_private(this._jsObject) { |
| 269 onDeviceAttached = new Event_media_galleries_private_onDeviceAttached(JS('',
'#.onDeviceAttached', this._jsObject)); |
| 270 onDeviceDetached = new Event_media_galleries_private_onDeviceDetached(JS('',
'#.onDeviceDetached', this._jsObject)); |
| 271 onGalleryChanged = new Event_media_galleries_private_onGalleryChanged(JS('',
'#.onGalleryChanged', this._jsObject)); |
| 272 } |
| 273 } |
| OLD | NEW |