OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 library nfc_mojom; | 5 library nfc_mojom; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; |
8 | 9 |
9 import 'package:mojo/bindings.dart' as bindings; | 10 import 'package:mojo/bindings.dart' as bindings; |
10 import 'package:mojo/core.dart' as core; | 11 import 'package:mojo/core.dart' as core; |
| 12 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 13 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
11 | 14 |
12 | 15 |
13 | 16 |
14 class NfcData extends bindings.Struct { | 17 class NfcData extends bindings.Struct { |
15 static const List<bindings.StructDataHeader> kVersions = const [ | 18 static const List<bindings.StructDataHeader> kVersions = const [ |
16 const bindings.StructDataHeader(16, 0) | 19 const bindings.StructDataHeader(16, 0) |
17 ]; | 20 ]; |
18 List<int> data = null; | 21 List<int> data = null; |
19 | 22 |
20 NfcData() : super(kVersions.last.size); | 23 NfcData() : super(kVersions.last.size); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 return "NfcData(" | 72 return "NfcData(" |
70 "data: $data" ")"; | 73 "data: $data" ")"; |
71 } | 74 } |
72 | 75 |
73 Map toJson() { | 76 Map toJson() { |
74 Map map = new Map(); | 77 Map map = new Map(); |
75 map["data"] = data; | 78 map["data"] = data; |
76 return map; | 79 return map; |
77 } | 80 } |
78 } | 81 } |
| 82 mojom_types.MojomStruct _nfc_NfcData__() { |
| 83 return new mojom_types.MojomStruct() |
| 84 ..declData = (new mojom_types.DeclarationData() |
| 85 ..shortName = 'NfcData' |
| 86 ..fullIdentifier = 'nfc.NfcData') |
| 87 ..fields = <mojom_types.StructField>[ |
| 88 new mojom_types.StructField() |
| 89 ..declData = (new mojom_types.DeclarationData()..shortName = 'Data') |
| 90 ..type = (new mojom_types.Type()..arrayType = (new mojom_types.ArrayType
() |
| 91 ..nullable = true |
| 92 |
| 93 ..elementType = (new mojom_types.Type()..simpleType = mojom_types.SimpleType
.uint8))), |
| 94 ]; |
| 95 } |
79 | 96 |
80 | 97 |
81 class _NfcTransmissionCancelParams extends bindings.Struct { | 98 class _NfcTransmissionCancelParams extends bindings.Struct { |
82 static const List<bindings.StructDataHeader> kVersions = const [ | 99 static const List<bindings.StructDataHeader> kVersions = const [ |
83 const bindings.StructDataHeader(8, 0) | 100 const bindings.StructDataHeader(8, 0) |
84 ]; | 101 ]; |
85 | 102 |
86 _NfcTransmissionCancelParams() : super(kVersions.last.size); | 103 _NfcTransmissionCancelParams() : super(kVersions.last.size); |
87 | 104 |
88 static _NfcTransmissionCancelParams deserialize(bindings.Message message) { | 105 static _NfcTransmissionCancelParams deserialize(bindings.Message message) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 144 |
128 String toString() { | 145 String toString() { |
129 return "_NfcTransmissionCancelParams("")"; | 146 return "_NfcTransmissionCancelParams("")"; |
130 } | 147 } |
131 | 148 |
132 Map toJson() { | 149 Map toJson() { |
133 Map map = new Map(); | 150 Map map = new Map(); |
134 return map; | 151 return map; |
135 } | 152 } |
136 } | 153 } |
| 154 mojom_types.MojomStruct _nfc_NfcTransmission_Cancel_Params__() { |
| 155 return new mojom_types.MojomStruct() |
| 156 ..declData = (new mojom_types.DeclarationData() |
| 157 ..shortName = '_NfcTransmissionCancelParams' |
| 158 ..fullIdentifier = 'nfc._NfcTransmissionCancelParams') |
| 159 ..fields = <mojom_types.StructField>[]; |
| 160 } |
137 | 161 |
138 | 162 |
139 class _NfcReceiverOnReceivedNfcDataParams extends bindings.Struct { | 163 class _NfcReceiverOnReceivedNfcDataParams extends bindings.Struct { |
140 static const List<bindings.StructDataHeader> kVersions = const [ | 164 static const List<bindings.StructDataHeader> kVersions = const [ |
141 const bindings.StructDataHeader(16, 0) | 165 const bindings.StructDataHeader(16, 0) |
142 ]; | 166 ]; |
143 NfcData nfcData = null; | 167 NfcData nfcData = null; |
144 | 168 |
145 _NfcReceiverOnReceivedNfcDataParams() : super(kVersions.last.size); | 169 _NfcReceiverOnReceivedNfcDataParams() : super(kVersions.last.size); |
146 | 170 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 return "_NfcReceiverOnReceivedNfcDataParams(" | 219 return "_NfcReceiverOnReceivedNfcDataParams(" |
196 "nfcData: $nfcData" ")"; | 220 "nfcData: $nfcData" ")"; |
197 } | 221 } |
198 | 222 |
199 Map toJson() { | 223 Map toJson() { |
200 Map map = new Map(); | 224 Map map = new Map(); |
201 map["nfcData"] = nfcData; | 225 map["nfcData"] = nfcData; |
202 return map; | 226 return map; |
203 } | 227 } |
204 } | 228 } |
| 229 mojom_types.MojomStruct _nfc_NfcReceiver_OnReceivedNfcData_Params__() { |
| 230 return new mojom_types.MojomStruct() |
| 231 ..declData = (new mojom_types.DeclarationData() |
| 232 ..shortName = '_NfcReceiverOnReceivedNfcDataParams' |
| 233 ..fullIdentifier = 'nfc._NfcReceiverOnReceivedNfcDataParams') |
| 234 ..fields = <mojom_types.StructField>[ |
| 235 new mojom_types.StructField() |
| 236 ..declData = (new mojom_types.DeclarationData()..shortName = 'NfcData') |
| 237 ..type = (new mojom_types.Type() |
| 238 ..typeReference = (new mojom_types.TypeReference() |
| 239 |
| 240 ..identifier = '_nfc_NfcData__' |
| 241 ..typeKey = '_nfc_NfcData__' |
| 242 )), |
| 243 ]; |
| 244 } |
205 | 245 |
206 | 246 |
207 class _NfcTransmitOnNextConnectionParams extends bindings.Struct { | 247 class _NfcTransmitOnNextConnectionParams extends bindings.Struct { |
208 static const List<bindings.StructDataHeader> kVersions = const [ | 248 static const List<bindings.StructDataHeader> kVersions = const [ |
209 const bindings.StructDataHeader(24, 0) | 249 const bindings.StructDataHeader(24, 0) |
210 ]; | 250 ]; |
211 NfcData nfcData = null; | 251 NfcData nfcData = null; |
212 Object transmission = null; | 252 Object transmission = null; |
213 | 253 |
214 _NfcTransmitOnNextConnectionParams() : super(kVersions.last.size); | 254 _NfcTransmitOnNextConnectionParams() : super(kVersions.last.size); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 return "_NfcTransmitOnNextConnectionParams(" | 310 return "_NfcTransmitOnNextConnectionParams(" |
271 "nfcData: $nfcData" ", " | 311 "nfcData: $nfcData" ", " |
272 "transmission: $transmission" ")"; | 312 "transmission: $transmission" ")"; |
273 } | 313 } |
274 | 314 |
275 Map toJson() { | 315 Map toJson() { |
276 throw new bindings.MojoCodecError( | 316 throw new bindings.MojoCodecError( |
277 'Object containing handles cannot be encoded to JSON.'); | 317 'Object containing handles cannot be encoded to JSON.'); |
278 } | 318 } |
279 } | 319 } |
| 320 mojom_types.MojomStruct _nfc_Nfc_TransmitOnNextConnection_Params__() { |
| 321 return new mojom_types.MojomStruct() |
| 322 ..declData = (new mojom_types.DeclarationData() |
| 323 ..shortName = '_NfcTransmitOnNextConnectionParams' |
| 324 ..fullIdentifier = 'nfc._NfcTransmitOnNextConnectionParams') |
| 325 ..fields = <mojom_types.StructField>[ |
| 326 new mojom_types.StructField() |
| 327 ..declData = (new mojom_types.DeclarationData()..shortName = 'NfcData') |
| 328 ..type = (new mojom_types.Type() |
| 329 ..typeReference = (new mojom_types.TypeReference() |
| 330 |
| 331 ..identifier = '_nfc_NfcData__' |
| 332 ..typeKey = '_nfc_NfcData__' |
| 333 )), |
| 334 |
| 335 new mojom_types.StructField() |
| 336 ..declData = (new mojom_types.DeclarationData()..shortName = 'Transmissi
on') |
| 337 ..type = (new mojom_types.Type() |
| 338 ..typeReference = (new mojom_types.TypeReference() |
| 339 ..nullable = true |
| 340 |
| 341 |
| 342 ..isInterfaceRequest = true |
| 343 ..identifier = '_nfc_NfcTransmission__' |
| 344 ..typeKey = '_nfc_NfcTransmission__' |
| 345 )), |
| 346 ]; |
| 347 } |
280 | 348 |
281 | 349 |
282 class NfcTransmitOnNextConnectionResponseParams extends bindings.Struct { | 350 class NfcTransmitOnNextConnectionResponseParams extends bindings.Struct { |
283 static const List<bindings.StructDataHeader> kVersions = const [ | 351 static const List<bindings.StructDataHeader> kVersions = const [ |
284 const bindings.StructDataHeader(16, 0) | 352 const bindings.StructDataHeader(16, 0) |
285 ]; | 353 ]; |
286 bool success = false; | 354 bool success = false; |
287 | 355 |
288 NfcTransmitOnNextConnectionResponseParams() : super(kVersions.last.size); | 356 NfcTransmitOnNextConnectionResponseParams() : super(kVersions.last.size); |
289 | 357 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 return "NfcTransmitOnNextConnectionResponseParams(" | 405 return "NfcTransmitOnNextConnectionResponseParams(" |
338 "success: $success" ")"; | 406 "success: $success" ")"; |
339 } | 407 } |
340 | 408 |
341 Map toJson() { | 409 Map toJson() { |
342 Map map = new Map(); | 410 Map map = new Map(); |
343 map["success"] = success; | 411 map["success"] = success; |
344 return map; | 412 return map; |
345 } | 413 } |
346 } | 414 } |
| 415 mojom_types.MojomStruct _nfc_Nfc_TransmitOnNextConnection_ResponseParams__() { |
| 416 return new mojom_types.MojomStruct() |
| 417 ..declData = (new mojom_types.DeclarationData() |
| 418 ..shortName = 'NfcTransmitOnNextConnectionResponseParams' |
| 419 ..fullIdentifier = 'nfc.NfcTransmitOnNextConnectionResponseParams') |
| 420 ..fields = <mojom_types.StructField>[ |
| 421 new mojom_types.StructField() |
| 422 ..declData = (new mojom_types.DeclarationData()..shortName = 'Success') |
| 423 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.bo
ol), |
| 424 ]; |
| 425 } |
347 | 426 |
348 | 427 |
349 class _NfcRegisterParams extends bindings.Struct { | 428 class _NfcRegisterParams extends bindings.Struct { |
350 static const List<bindings.StructDataHeader> kVersions = const [ | 429 static const List<bindings.StructDataHeader> kVersions = const [ |
351 const bindings.StructDataHeader(8, 0) | 430 const bindings.StructDataHeader(8, 0) |
352 ]; | 431 ]; |
353 | 432 |
354 _NfcRegisterParams() : super(kVersions.last.size); | 433 _NfcRegisterParams() : super(kVersions.last.size); |
355 | 434 |
356 static _NfcRegisterParams deserialize(bindings.Message message) { | 435 static _NfcRegisterParams deserialize(bindings.Message message) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 474 |
396 String toString() { | 475 String toString() { |
397 return "_NfcRegisterParams("")"; | 476 return "_NfcRegisterParams("")"; |
398 } | 477 } |
399 | 478 |
400 Map toJson() { | 479 Map toJson() { |
401 Map map = new Map(); | 480 Map map = new Map(); |
402 return map; | 481 return map; |
403 } | 482 } |
404 } | 483 } |
| 484 mojom_types.MojomStruct _nfc_Nfc_Register_Params__() { |
| 485 return new mojom_types.MojomStruct() |
| 486 ..declData = (new mojom_types.DeclarationData() |
| 487 ..shortName = '_NfcRegisterParams' |
| 488 ..fullIdentifier = 'nfc._NfcRegisterParams') |
| 489 ..fields = <mojom_types.StructField>[]; |
| 490 } |
405 | 491 |
406 | 492 |
407 class _NfcUnregisterParams extends bindings.Struct { | 493 class _NfcUnregisterParams extends bindings.Struct { |
408 static const List<bindings.StructDataHeader> kVersions = const [ | 494 static const List<bindings.StructDataHeader> kVersions = const [ |
409 const bindings.StructDataHeader(8, 0) | 495 const bindings.StructDataHeader(8, 0) |
410 ]; | 496 ]; |
411 | 497 |
412 _NfcUnregisterParams() : super(kVersions.last.size); | 498 _NfcUnregisterParams() : super(kVersions.last.size); |
413 | 499 |
414 static _NfcUnregisterParams deserialize(bindings.Message message) { | 500 static _NfcUnregisterParams deserialize(bindings.Message message) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 | 539 |
454 String toString() { | 540 String toString() { |
455 return "_NfcUnregisterParams("")"; | 541 return "_NfcUnregisterParams("")"; |
456 } | 542 } |
457 | 543 |
458 Map toJson() { | 544 Map toJson() { |
459 Map map = new Map(); | 545 Map map = new Map(); |
460 return map; | 546 return map; |
461 } | 547 } |
462 } | 548 } |
| 549 mojom_types.MojomStruct _nfc_Nfc_Unregister_Params__() { |
| 550 return new mojom_types.MojomStruct() |
| 551 ..declData = (new mojom_types.DeclarationData() |
| 552 ..shortName = '_NfcUnregisterParams' |
| 553 ..fullIdentifier = 'nfc._NfcUnregisterParams') |
| 554 ..fields = <mojom_types.StructField>[]; |
| 555 } |
| 556 |
463 | 557 |
464 const int _NfcTransmission_cancelName = 0; | 558 const int _NfcTransmission_cancelName = 0; |
465 | 559 |
| 560 mojom_types.MojomInterface _nfc_NfcTransmission__() { |
| 561 return new mojom_types.MojomInterface() |
| 562 ..declData = (new mojom_types.DeclarationData() |
| 563 ..shortName = 'NfcTransmission' |
| 564 ..fullIdentifier = 'nfc.NfcTransmission') |
| 565 ..interfaceName = 'NfcTransmission' |
| 566 ..methods = <int, mojom_types.MojomMethod>{ |
| 567 _NfcTransmission_cancelName: new mojom_types.MojomMethod() |
| 568 ..declData = (new mojom_types.DeclarationData()..shortName = 'Cancel') |
| 569 ..ordinal = _NfcTransmission_cancelName..parameters = _nfc_NfcTransmissi
on_Cancel_Params__(), |
| 570 }; |
| 571 } |
| 572 |
| 573 class _NfcTransmissionServiceDescription implements service_describer.ServiceDes
cription { |
| 574 dynamic getTopLevelInterface([Function responseFactory = null]) { |
| 575 return _nfc_NfcTransmission__(); |
| 576 } |
| 577 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { |
| 578 return getAllMojomTypeDefinitions()[typeKey]; |
| 579 } |
| 580 dynamic getAllTypeDefinitions([Function responseFactory = null]) { |
| 581 return getAllMojomTypeDefinitions(); |
| 582 } |
| 583 } |
| 584 |
466 abstract class NfcTransmission { | 585 abstract class NfcTransmission { |
467 static const String serviceName = null; | 586 static const String serviceName = null; |
468 void cancel(); | 587 void cancel(); |
469 } | 588 } |
470 | 589 |
471 | 590 |
472 class _NfcTransmissionProxyImpl extends bindings.Proxy { | 591 class _NfcTransmissionProxyImpl extends bindings.Proxy { |
473 _NfcTransmissionProxyImpl.fromEndpoint( | 592 _NfcTransmissionProxyImpl.fromEndpoint( |
474 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 593 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
475 | 594 |
476 _NfcTransmissionProxyImpl.fromHandle(core.MojoHandle handle) : | 595 _NfcTransmissionProxyImpl.fromHandle(core.MojoHandle handle) : |
477 super.fromHandle(handle); | 596 super.fromHandle(handle); |
478 | 597 |
479 _NfcTransmissionProxyImpl.unbound() : super.unbound(); | 598 _NfcTransmissionProxyImpl.unbound() : super.unbound(); |
480 | 599 |
481 static _NfcTransmissionProxyImpl newFromEndpoint( | 600 static _NfcTransmissionProxyImpl newFromEndpoint( |
482 core.MojoMessagePipeEndpoint endpoint) { | 601 core.MojoMessagePipeEndpoint endpoint) { |
483 assert(endpoint.setDescription("For _NfcTransmissionProxyImpl")); | 602 assert(endpoint.setDescription("For _NfcTransmissionProxyImpl")); |
484 return new _NfcTransmissionProxyImpl.fromEndpoint(endpoint); | 603 return new _NfcTransmissionProxyImpl.fromEndpoint(endpoint); |
485 } | 604 } |
486 | 605 |
| 606 service_describer.ServiceDescription get serviceDescription => |
| 607 new _NfcTransmissionServiceDescription(); |
| 608 |
487 void handleResponse(bindings.ServiceMessage message) { | 609 void handleResponse(bindings.ServiceMessage message) { |
488 switch (message.header.type) { | 610 switch (message.header.type) { |
489 default: | 611 default: |
490 proxyError("Unexpected message type: ${message.header.type}"); | 612 proxyError("Unexpected message type: ${message.header.type}"); |
491 close(immediate: true); | 613 close(immediate: true); |
492 break; | 614 break; |
493 } | 615 } |
494 } | 616 } |
495 | 617 |
496 String toString() { | 618 String toString() { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 assert(_impl == null); | 741 assert(_impl == null); |
620 _impl = d; | 742 _impl = d; |
621 } | 743 } |
622 | 744 |
623 String toString() { | 745 String toString() { |
624 var superString = super.toString(); | 746 var superString = super.toString(); |
625 return "NfcTransmissionStub($superString)"; | 747 return "NfcTransmissionStub($superString)"; |
626 } | 748 } |
627 | 749 |
628 int get version => 0; | 750 int get version => 0; |
| 751 |
| 752 |
| 753 service_describer.ServiceDescription get serviceDescription => |
| 754 new _NfcTransmissionServiceDescription(); |
629 } | 755 } |
630 | 756 |
631 const int _NfcReceiver_onReceivedNfcDataName = 0; | 757 const int _NfcReceiver_onReceivedNfcDataName = 0; |
632 | 758 |
| 759 mojom_types.MojomInterface _nfc_NfcReceiver__() { |
| 760 return new mojom_types.MojomInterface() |
| 761 ..declData = (new mojom_types.DeclarationData() |
| 762 ..shortName = 'NfcReceiver' |
| 763 ..fullIdentifier = 'nfc.NfcReceiver') |
| 764 ..interfaceName = 'NfcReceiver' |
| 765 ..methods = <int, mojom_types.MojomMethod>{ |
| 766 _NfcReceiver_onReceivedNfcDataName: new mojom_types.MojomMethod() |
| 767 ..declData = (new mojom_types.DeclarationData()..shortName = 'OnReceived
NfcData') |
| 768 ..ordinal = _NfcReceiver_onReceivedNfcDataName..parameters = _nfc_NfcRec
eiver_OnReceivedNfcData_Params__(), |
| 769 }; |
| 770 } |
| 771 |
| 772 class _NfcReceiverServiceDescription implements service_describer.ServiceDescrip
tion { |
| 773 dynamic getTopLevelInterface([Function responseFactory = null]) { |
| 774 return _nfc_NfcReceiver__(); |
| 775 } |
| 776 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { |
| 777 return getAllMojomTypeDefinitions()[typeKey]; |
| 778 } |
| 779 dynamic getAllTypeDefinitions([Function responseFactory = null]) { |
| 780 return getAllMojomTypeDefinitions(); |
| 781 } |
| 782 } |
| 783 |
633 abstract class NfcReceiver { | 784 abstract class NfcReceiver { |
634 static const String serviceName = "nfc::NfcReceiver"; | 785 static const String serviceName = "nfc::NfcReceiver"; |
635 void onReceivedNfcData(NfcData nfcData); | 786 void onReceivedNfcData(NfcData nfcData); |
636 } | 787 } |
637 | 788 |
638 | 789 |
639 class _NfcReceiverProxyImpl extends bindings.Proxy { | 790 class _NfcReceiverProxyImpl extends bindings.Proxy { |
640 _NfcReceiverProxyImpl.fromEndpoint( | 791 _NfcReceiverProxyImpl.fromEndpoint( |
641 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 792 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
642 | 793 |
643 _NfcReceiverProxyImpl.fromHandle(core.MojoHandle handle) : | 794 _NfcReceiverProxyImpl.fromHandle(core.MojoHandle handle) : |
644 super.fromHandle(handle); | 795 super.fromHandle(handle); |
645 | 796 |
646 _NfcReceiverProxyImpl.unbound() : super.unbound(); | 797 _NfcReceiverProxyImpl.unbound() : super.unbound(); |
647 | 798 |
648 static _NfcReceiverProxyImpl newFromEndpoint( | 799 static _NfcReceiverProxyImpl newFromEndpoint( |
649 core.MojoMessagePipeEndpoint endpoint) { | 800 core.MojoMessagePipeEndpoint endpoint) { |
650 assert(endpoint.setDescription("For _NfcReceiverProxyImpl")); | 801 assert(endpoint.setDescription("For _NfcReceiverProxyImpl")); |
651 return new _NfcReceiverProxyImpl.fromEndpoint(endpoint); | 802 return new _NfcReceiverProxyImpl.fromEndpoint(endpoint); |
652 } | 803 } |
653 | 804 |
| 805 service_describer.ServiceDescription get serviceDescription => |
| 806 new _NfcReceiverServiceDescription(); |
| 807 |
654 void handleResponse(bindings.ServiceMessage message) { | 808 void handleResponse(bindings.ServiceMessage message) { |
655 switch (message.header.type) { | 809 switch (message.header.type) { |
656 default: | 810 default: |
657 proxyError("Unexpected message type: ${message.header.type}"); | 811 proxyError("Unexpected message type: ${message.header.type}"); |
658 close(immediate: true); | 812 close(immediate: true); |
659 break; | 813 break; |
660 } | 814 } |
661 } | 815 } |
662 | 816 |
663 String toString() { | 817 String toString() { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 assert(_impl == null); | 941 assert(_impl == null); |
788 _impl = d; | 942 _impl = d; |
789 } | 943 } |
790 | 944 |
791 String toString() { | 945 String toString() { |
792 var superString = super.toString(); | 946 var superString = super.toString(); |
793 return "NfcReceiverStub($superString)"; | 947 return "NfcReceiverStub($superString)"; |
794 } | 948 } |
795 | 949 |
796 int get version => 0; | 950 int get version => 0; |
| 951 |
| 952 |
| 953 service_describer.ServiceDescription get serviceDescription => |
| 954 new _NfcReceiverServiceDescription(); |
797 } | 955 } |
798 | 956 |
799 const int _Nfc_transmitOnNextConnectionName = 0; | 957 const int _Nfc_transmitOnNextConnectionName = 0; |
800 const int _Nfc_registerName = 1; | 958 const int _Nfc_registerName = 1; |
801 const int _Nfc_unregisterName = 2; | 959 const int _Nfc_unregisterName = 2; |
802 | 960 |
| 961 mojom_types.MojomInterface _nfc_Nfc__() { |
| 962 return new mojom_types.MojomInterface() |
| 963 ..declData = (new mojom_types.DeclarationData() |
| 964 ..shortName = 'Nfc' |
| 965 ..fullIdentifier = 'nfc.Nfc') |
| 966 ..interfaceName = 'Nfc' |
| 967 ..methods = <int, mojom_types.MojomMethod>{ |
| 968 _Nfc_transmitOnNextConnectionName: new mojom_types.MojomMethod() |
| 969 ..declData = (new mojom_types.DeclarationData()..shortName = 'TransmitOn
NextConnection') |
| 970 ..ordinal = _Nfc_transmitOnNextConnectionName |
| 971 ..responseParams = _nfc_Nfc_TransmitOnNextConnection_ResponseParams__().
.parameters = _nfc_Nfc_TransmitOnNextConnection_Params__(),_Nfc_registerName: ne
w mojom_types.MojomMethod() |
| 972 ..declData = (new mojom_types.DeclarationData()..shortName = 'Register') |
| 973 ..ordinal = _Nfc_registerName..parameters = _nfc_Nfc_Register_Params__()
,_Nfc_unregisterName: new mojom_types.MojomMethod() |
| 974 ..declData = (new mojom_types.DeclarationData()..shortName = 'Unregister
') |
| 975 ..ordinal = _Nfc_unregisterName..parameters = _nfc_Nfc_Unregister_Params
__(), |
| 976 }; |
| 977 } |
| 978 |
| 979 class _NfcServiceDescription implements service_describer.ServiceDescription { |
| 980 dynamic getTopLevelInterface([Function responseFactory = null]) { |
| 981 return _nfc_Nfc__(); |
| 982 } |
| 983 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { |
| 984 return getAllMojomTypeDefinitions()[typeKey]; |
| 985 } |
| 986 dynamic getAllTypeDefinitions([Function responseFactory = null]) { |
| 987 return getAllMojomTypeDefinitions(); |
| 988 } |
| 989 } |
| 990 |
803 abstract class Nfc { | 991 abstract class Nfc { |
804 static const String serviceName = "nfc::Nfc"; | 992 static const String serviceName = "nfc::Nfc"; |
805 dynamic transmitOnNextConnection(NfcData nfcData,Object transmission,[Function
responseFactory = null]); | 993 dynamic transmitOnNextConnection(NfcData nfcData,Object transmission,[Function
responseFactory = null]); |
806 void register(); | 994 void register(); |
807 void unregister(); | 995 void unregister(); |
808 } | 996 } |
809 | 997 |
810 | 998 |
811 class _NfcProxyImpl extends bindings.Proxy { | 999 class _NfcProxyImpl extends bindings.Proxy { |
812 _NfcProxyImpl.fromEndpoint( | 1000 _NfcProxyImpl.fromEndpoint( |
813 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1001 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
814 | 1002 |
815 _NfcProxyImpl.fromHandle(core.MojoHandle handle) : | 1003 _NfcProxyImpl.fromHandle(core.MojoHandle handle) : |
816 super.fromHandle(handle); | 1004 super.fromHandle(handle); |
817 | 1005 |
818 _NfcProxyImpl.unbound() : super.unbound(); | 1006 _NfcProxyImpl.unbound() : super.unbound(); |
819 | 1007 |
820 static _NfcProxyImpl newFromEndpoint( | 1008 static _NfcProxyImpl newFromEndpoint( |
821 core.MojoMessagePipeEndpoint endpoint) { | 1009 core.MojoMessagePipeEndpoint endpoint) { |
822 assert(endpoint.setDescription("For _NfcProxyImpl")); | 1010 assert(endpoint.setDescription("For _NfcProxyImpl")); |
823 return new _NfcProxyImpl.fromEndpoint(endpoint); | 1011 return new _NfcProxyImpl.fromEndpoint(endpoint); |
824 } | 1012 } |
825 | 1013 |
| 1014 service_describer.ServiceDescription get serviceDescription => |
| 1015 new _NfcServiceDescription(); |
| 1016 |
826 void handleResponse(bindings.ServiceMessage message) { | 1017 void handleResponse(bindings.ServiceMessage message) { |
827 switch (message.header.type) { | 1018 switch (message.header.type) { |
828 case _Nfc_transmitOnNextConnectionName: | 1019 case _Nfc_transmitOnNextConnectionName: |
829 var r = NfcTransmitOnNextConnectionResponseParams.deserialize( | 1020 var r = NfcTransmitOnNextConnectionResponseParams.deserialize( |
830 message.payload); | 1021 message.payload); |
831 if (!message.header.hasRequestId) { | 1022 if (!message.header.hasRequestId) { |
832 proxyError("Expected a message with a valid request Id."); | 1023 proxyError("Expected a message with a valid request Id."); |
833 return; | 1024 return; |
834 } | 1025 } |
835 Completer c = completerMap[message.header.requestId]; | 1026 Completer c = completerMap[message.header.requestId]; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 assert(_impl == null); | 1219 assert(_impl == null); |
1029 _impl = d; | 1220 _impl = d; |
1030 } | 1221 } |
1031 | 1222 |
1032 String toString() { | 1223 String toString() { |
1033 var superString = super.toString(); | 1224 var superString = super.toString(); |
1034 return "NfcStub($superString)"; | 1225 return "NfcStub($superString)"; |
1035 } | 1226 } |
1036 | 1227 |
1037 int get version => 0; | 1228 int get version => 0; |
| 1229 |
| 1230 |
| 1231 service_describer.ServiceDescription get serviceDescription => |
| 1232 new _NfcServiceDescription(); |
1038 } | 1233 } |
1039 | 1234 |
1040 | 1235 |
| 1236 |
| 1237 |
| 1238 |
| 1239 |
| 1240 |
| 1241 Map<String, mojom_types.UserDefinedType> _initDescriptions() { |
| 1242 var map = new HashMap<String, mojom_types.UserDefinedType>(); |
| 1243 map["_nfc_NfcData__"] = |
| 1244 new mojom_types.UserDefinedType() |
| 1245 ..structType = _nfc_NfcData__(); |
| 1246 map["_nfc_NfcTransmission_Cancel_Params__"] = |
| 1247 new mojom_types.UserDefinedType() |
| 1248 ..structType = _nfc_NfcTransmission_Cancel_Params__(); |
| 1249 map["_nfc_NfcReceiver_OnReceivedNfcData_Params__"] = |
| 1250 new mojom_types.UserDefinedType() |
| 1251 ..structType = _nfc_NfcReceiver_OnReceivedNfcData_Params__(); |
| 1252 map["_nfc_Nfc_TransmitOnNextConnection_Params__"] = |
| 1253 new mojom_types.UserDefinedType() |
| 1254 ..structType = _nfc_Nfc_TransmitOnNextConnection_Params__(); |
| 1255 map["_nfc_Nfc_TransmitOnNextConnection_ResponseParams__"] = |
| 1256 new mojom_types.UserDefinedType() |
| 1257 ..structType = _nfc_Nfc_TransmitOnNextConnection_ResponseParams__(); |
| 1258 map["_nfc_Nfc_Register_Params__"] = |
| 1259 new mojom_types.UserDefinedType() |
| 1260 ..structType = _nfc_Nfc_Register_Params__(); |
| 1261 map["_nfc_Nfc_Unregister_Params__"] = |
| 1262 new mojom_types.UserDefinedType() |
| 1263 ..structType = _nfc_Nfc_Unregister_Params__(); |
| 1264 map["_nfc_NfcTransmission__"] = |
| 1265 new mojom_types.UserDefinedType() |
| 1266 ..interfaceType = _nfc_NfcTransmission__(); |
| 1267 map["_nfc_NfcReceiver__"] = |
| 1268 new mojom_types.UserDefinedType() |
| 1269 ..interfaceType = _nfc_NfcReceiver__(); |
| 1270 map["_nfc_Nfc__"] = |
| 1271 new mojom_types.UserDefinedType() |
| 1272 ..interfaceType = _nfc_Nfc__(); |
| 1273 |
| 1274 return map; |
| 1275 } |
| 1276 |
| 1277 var _MojomDesc; |
| 1278 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
| 1279 if (_MojomDesc == null) { |
| 1280 _MojomDesc = _initDescriptions(); |
| 1281 } |
| 1282 return _MojomDesc; |
| 1283 } |
| 1284 |
OLD | NEW |