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 notifications_mojom; | 5 library notifications_mojom; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:mojo/bindings.dart' as bindings; | 9 import 'package:mojo/bindings.dart' as bindings; |
10 import 'package:mojo/core.dart' as core; | 10 import 'package:mojo/core.dart' as core; |
| 11 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 12 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
11 | 13 |
12 | 14 |
13 | 15 |
14 class NotificationData extends bindings.Struct { | 16 class NotificationData extends bindings.Struct { |
15 static const List<bindings.StructDataHeader> kVersions = const [ | 17 static const List<bindings.StructDataHeader> kVersions = const [ |
16 const bindings.StructDataHeader(32, 0) | 18 const bindings.StructDataHeader(32, 0) |
17 ]; | 19 ]; |
18 String title = null; | 20 String title = null; |
19 String text = null; | 21 String text = null; |
20 bool playSound = false; | 22 bool playSound = false; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 map["title"] = title; | 109 map["title"] = title; |
108 map["text"] = text; | 110 map["text"] = text; |
109 map["playSound"] = playSound; | 111 map["playSound"] = playSound; |
110 map["vibrate"] = vibrate; | 112 map["vibrate"] = vibrate; |
111 map["setLights"] = setLights; | 113 map["setLights"] = setLights; |
112 return map; | 114 return map; |
113 } | 115 } |
114 } | 116 } |
115 | 117 |
116 | 118 |
| 119 |
| 120 |
117 class _NotificationClientOnSelectedParams extends bindings.Struct { | 121 class _NotificationClientOnSelectedParams extends bindings.Struct { |
118 static const List<bindings.StructDataHeader> kVersions = const [ | 122 static const List<bindings.StructDataHeader> kVersions = const [ |
119 const bindings.StructDataHeader(8, 0) | 123 const bindings.StructDataHeader(8, 0) |
120 ]; | 124 ]; |
121 | 125 |
122 _NotificationClientOnSelectedParams() : super(kVersions.last.size); | 126 _NotificationClientOnSelectedParams() : super(kVersions.last.size); |
123 | 127 |
124 static _NotificationClientOnSelectedParams deserialize(bindings.Message messag
e) { | 128 static _NotificationClientOnSelectedParams deserialize(bindings.Message messag
e) { |
125 var decoder = new bindings.Decoder(message); | 129 var decoder = new bindings.Decoder(message); |
126 var result = decode(decoder); | 130 var result = decode(decoder); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 return "_NotificationClientOnSelectedParams("")"; | 169 return "_NotificationClientOnSelectedParams("")"; |
166 } | 170 } |
167 | 171 |
168 Map toJson() { | 172 Map toJson() { |
169 Map map = new Map(); | 173 Map map = new Map(); |
170 return map; | 174 return map; |
171 } | 175 } |
172 } | 176 } |
173 | 177 |
174 | 178 |
| 179 |
| 180 |
175 class _NotificationClientOnDismissedParams extends bindings.Struct { | 181 class _NotificationClientOnDismissedParams extends bindings.Struct { |
176 static const List<bindings.StructDataHeader> kVersions = const [ | 182 static const List<bindings.StructDataHeader> kVersions = const [ |
177 const bindings.StructDataHeader(8, 0) | 183 const bindings.StructDataHeader(8, 0) |
178 ]; | 184 ]; |
179 | 185 |
180 _NotificationClientOnDismissedParams() : super(kVersions.last.size); | 186 _NotificationClientOnDismissedParams() : super(kVersions.last.size); |
181 | 187 |
182 static _NotificationClientOnDismissedParams deserialize(bindings.Message messa
ge) { | 188 static _NotificationClientOnDismissedParams deserialize(bindings.Message messa
ge) { |
183 var decoder = new bindings.Decoder(message); | 189 var decoder = new bindings.Decoder(message); |
184 var result = decode(decoder); | 190 var result = decode(decoder); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 return "_NotificationClientOnDismissedParams("")"; | 229 return "_NotificationClientOnDismissedParams("")"; |
224 } | 230 } |
225 | 231 |
226 Map toJson() { | 232 Map toJson() { |
227 Map map = new Map(); | 233 Map map = new Map(); |
228 return map; | 234 return map; |
229 } | 235 } |
230 } | 236 } |
231 | 237 |
232 | 238 |
| 239 |
| 240 |
233 class _NotificationUpdateParams extends bindings.Struct { | 241 class _NotificationUpdateParams extends bindings.Struct { |
234 static const List<bindings.StructDataHeader> kVersions = const [ | 242 static const List<bindings.StructDataHeader> kVersions = const [ |
235 const bindings.StructDataHeader(16, 0) | 243 const bindings.StructDataHeader(16, 0) |
236 ]; | 244 ]; |
237 NotificationData notificationData = null; | 245 NotificationData notificationData = null; |
238 | 246 |
239 _NotificationUpdateParams() : super(kVersions.last.size); | 247 _NotificationUpdateParams() : super(kVersions.last.size); |
240 | 248 |
241 static _NotificationUpdateParams deserialize(bindings.Message message) { | 249 static _NotificationUpdateParams deserialize(bindings.Message message) { |
242 var decoder = new bindings.Decoder(message); | 250 var decoder = new bindings.Decoder(message); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 } | 299 } |
292 | 300 |
293 Map toJson() { | 301 Map toJson() { |
294 Map map = new Map(); | 302 Map map = new Map(); |
295 map["notificationData"] = notificationData; | 303 map["notificationData"] = notificationData; |
296 return map; | 304 return map; |
297 } | 305 } |
298 } | 306 } |
299 | 307 |
300 | 308 |
| 309 |
| 310 |
301 class _NotificationCancelParams extends bindings.Struct { | 311 class _NotificationCancelParams extends bindings.Struct { |
302 static const List<bindings.StructDataHeader> kVersions = const [ | 312 static const List<bindings.StructDataHeader> kVersions = const [ |
303 const bindings.StructDataHeader(8, 0) | 313 const bindings.StructDataHeader(8, 0) |
304 ]; | 314 ]; |
305 | 315 |
306 _NotificationCancelParams() : super(kVersions.last.size); | 316 _NotificationCancelParams() : super(kVersions.last.size); |
307 | 317 |
308 static _NotificationCancelParams deserialize(bindings.Message message) { | 318 static _NotificationCancelParams deserialize(bindings.Message message) { |
309 var decoder = new bindings.Decoder(message); | 319 var decoder = new bindings.Decoder(message); |
310 var result = decode(decoder); | 320 var result = decode(decoder); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 return "_NotificationCancelParams("")"; | 359 return "_NotificationCancelParams("")"; |
350 } | 360 } |
351 | 361 |
352 Map toJson() { | 362 Map toJson() { |
353 Map map = new Map(); | 363 Map map = new Map(); |
354 return map; | 364 return map; |
355 } | 365 } |
356 } | 366 } |
357 | 367 |
358 | 368 |
| 369 |
| 370 |
359 class _NotificationServicePostParams extends bindings.Struct { | 371 class _NotificationServicePostParams extends bindings.Struct { |
360 static const List<bindings.StructDataHeader> kVersions = const [ | 372 static const List<bindings.StructDataHeader> kVersions = const [ |
361 const bindings.StructDataHeader(32, 0) | 373 const bindings.StructDataHeader(32, 0) |
362 ]; | 374 ]; |
363 NotificationData notificationData = null; | 375 NotificationData notificationData = null; |
364 Object client = null; | 376 Object client = null; |
365 Object notification = null; | 377 Object notification = null; |
366 | 378 |
367 _NotificationServicePostParams() : super(kVersions.last.size); | 379 _NotificationServicePostParams() : super(kVersions.last.size); |
368 | 380 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 "client: $client" ", " | 443 "client: $client" ", " |
432 "notification: $notification" ")"; | 444 "notification: $notification" ")"; |
433 } | 445 } |
434 | 446 |
435 Map toJson() { | 447 Map toJson() { |
436 throw new bindings.MojoCodecError( | 448 throw new bindings.MojoCodecError( |
437 'Object containing handles cannot be encoded to JSON.'); | 449 'Object containing handles cannot be encoded to JSON.'); |
438 } | 450 } |
439 } | 451 } |
440 | 452 |
| 453 |
| 454 |
| 455 |
441 const int _NotificationClient_onSelectedName = 0; | 456 const int _NotificationClient_onSelectedName = 0; |
442 const int _NotificationClient_onDismissedName = 1; | 457 const int _NotificationClient_onDismissedName = 1; |
443 | 458 |
| 459 |
| 460 |
| 461 class _NotificationClientServiceDescription implements service_describer.Service
Description { |
| 462 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 463 |
| 464 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 465 |
| 466 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 467 } |
| 468 |
444 abstract class NotificationClient { | 469 abstract class NotificationClient { |
445 static const String serviceName = null; | 470 static const String serviceName = null; |
446 void onSelected(); | 471 void onSelected(); |
447 void onDismissed(); | 472 void onDismissed(); |
448 } | 473 } |
449 | 474 |
450 | 475 |
451 class _NotificationClientProxyImpl extends bindings.Proxy { | 476 class _NotificationClientProxyImpl extends bindings.Proxy { |
452 _NotificationClientProxyImpl.fromEndpoint( | 477 _NotificationClientProxyImpl.fromEndpoint( |
453 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 478 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
454 | 479 |
455 _NotificationClientProxyImpl.fromHandle(core.MojoHandle handle) : | 480 _NotificationClientProxyImpl.fromHandle(core.MojoHandle handle) : |
456 super.fromHandle(handle); | 481 super.fromHandle(handle); |
457 | 482 |
458 _NotificationClientProxyImpl.unbound() : super.unbound(); | 483 _NotificationClientProxyImpl.unbound() : super.unbound(); |
459 | 484 |
460 static _NotificationClientProxyImpl newFromEndpoint( | 485 static _NotificationClientProxyImpl newFromEndpoint( |
461 core.MojoMessagePipeEndpoint endpoint) { | 486 core.MojoMessagePipeEndpoint endpoint) { |
462 assert(endpoint.setDescription("For _NotificationClientProxyImpl")); | 487 assert(endpoint.setDescription("For _NotificationClientProxyImpl")); |
463 return new _NotificationClientProxyImpl.fromEndpoint(endpoint); | 488 return new _NotificationClientProxyImpl.fromEndpoint(endpoint); |
464 } | 489 } |
465 | 490 |
| 491 service_describer.ServiceDescription get serviceDescription => |
| 492 new _NotificationClientServiceDescription(); |
| 493 |
466 void handleResponse(bindings.ServiceMessage message) { | 494 void handleResponse(bindings.ServiceMessage message) { |
467 switch (message.header.type) { | 495 switch (message.header.type) { |
468 default: | 496 default: |
469 proxyError("Unexpected message type: ${message.header.type}"); | 497 proxyError("Unexpected message type: ${message.header.type}"); |
470 close(immediate: true); | 498 close(immediate: true); |
471 break; | 499 break; |
472 } | 500 } |
473 } | 501 } |
474 | 502 |
475 String toString() { | 503 String toString() { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 assert(_impl == null); | 639 assert(_impl == null); |
612 _impl = d; | 640 _impl = d; |
613 } | 641 } |
614 | 642 |
615 String toString() { | 643 String toString() { |
616 var superString = super.toString(); | 644 var superString = super.toString(); |
617 return "NotificationClientStub($superString)"; | 645 return "NotificationClientStub($superString)"; |
618 } | 646 } |
619 | 647 |
620 int get version => 0; | 648 int get version => 0; |
| 649 |
| 650 service_describer.ServiceDescription get serviceDescription => |
| 651 new _NotificationClientServiceDescription(); |
621 } | 652 } |
622 | 653 |
623 const int _Notification_updateName = 0; | 654 const int _Notification_updateName = 0; |
624 const int _Notification_cancelName = 1; | 655 const int _Notification_cancelName = 1; |
625 | 656 |
| 657 |
| 658 |
| 659 class _NotificationServiceDescription implements service_describer.ServiceDescri
ption { |
| 660 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 661 |
| 662 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 663 |
| 664 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 665 } |
| 666 |
626 abstract class Notification { | 667 abstract class Notification { |
627 static const String serviceName = null; | 668 static const String serviceName = null; |
628 void update(NotificationData notificationData); | 669 void update(NotificationData notificationData); |
629 void cancel(); | 670 void cancel(); |
630 } | 671 } |
631 | 672 |
632 | 673 |
633 class _NotificationProxyImpl extends bindings.Proxy { | 674 class _NotificationProxyImpl extends bindings.Proxy { |
634 _NotificationProxyImpl.fromEndpoint( | 675 _NotificationProxyImpl.fromEndpoint( |
635 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 676 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
636 | 677 |
637 _NotificationProxyImpl.fromHandle(core.MojoHandle handle) : | 678 _NotificationProxyImpl.fromHandle(core.MojoHandle handle) : |
638 super.fromHandle(handle); | 679 super.fromHandle(handle); |
639 | 680 |
640 _NotificationProxyImpl.unbound() : super.unbound(); | 681 _NotificationProxyImpl.unbound() : super.unbound(); |
641 | 682 |
642 static _NotificationProxyImpl newFromEndpoint( | 683 static _NotificationProxyImpl newFromEndpoint( |
643 core.MojoMessagePipeEndpoint endpoint) { | 684 core.MojoMessagePipeEndpoint endpoint) { |
644 assert(endpoint.setDescription("For _NotificationProxyImpl")); | 685 assert(endpoint.setDescription("For _NotificationProxyImpl")); |
645 return new _NotificationProxyImpl.fromEndpoint(endpoint); | 686 return new _NotificationProxyImpl.fromEndpoint(endpoint); |
646 } | 687 } |
647 | 688 |
| 689 service_describer.ServiceDescription get serviceDescription => |
| 690 new _NotificationServiceDescription(); |
| 691 |
648 void handleResponse(bindings.ServiceMessage message) { | 692 void handleResponse(bindings.ServiceMessage message) { |
649 switch (message.header.type) { | 693 switch (message.header.type) { |
650 default: | 694 default: |
651 proxyError("Unexpected message type: ${message.header.type}"); | 695 proxyError("Unexpected message type: ${message.header.type}"); |
652 close(immediate: true); | 696 close(immediate: true); |
653 break; | 697 break; |
654 } | 698 } |
655 } | 699 } |
656 | 700 |
657 String toString() { | 701 String toString() { |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 assert(_impl == null); | 838 assert(_impl == null); |
795 _impl = d; | 839 _impl = d; |
796 } | 840 } |
797 | 841 |
798 String toString() { | 842 String toString() { |
799 var superString = super.toString(); | 843 var superString = super.toString(); |
800 return "NotificationStub($superString)"; | 844 return "NotificationStub($superString)"; |
801 } | 845 } |
802 | 846 |
803 int get version => 0; | 847 int get version => 0; |
| 848 |
| 849 service_describer.ServiceDescription get serviceDescription => |
| 850 new _NotificationServiceDescription(); |
804 } | 851 } |
805 | 852 |
806 const int _NotificationService_postName = 0; | 853 const int _NotificationService_postName = 0; |
807 | 854 |
| 855 |
| 856 |
| 857 class _NotificationServiceServiceDescription implements service_describer.Servic
eDescription { |
| 858 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 859 |
| 860 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 861 |
| 862 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 863 } |
| 864 |
808 abstract class NotificationService { | 865 abstract class NotificationService { |
809 static const String serviceName = "notifications::NotificationService"; | 866 static const String serviceName = "notifications::NotificationService"; |
810 void post(NotificationData notificationData, Object client, Object notificatio
n); | 867 void post(NotificationData notificationData, Object client, Object notificatio
n); |
811 } | 868 } |
812 | 869 |
813 | 870 |
814 class _NotificationServiceProxyImpl extends bindings.Proxy { | 871 class _NotificationServiceProxyImpl extends bindings.Proxy { |
815 _NotificationServiceProxyImpl.fromEndpoint( | 872 _NotificationServiceProxyImpl.fromEndpoint( |
816 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 873 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
817 | 874 |
818 _NotificationServiceProxyImpl.fromHandle(core.MojoHandle handle) : | 875 _NotificationServiceProxyImpl.fromHandle(core.MojoHandle handle) : |
819 super.fromHandle(handle); | 876 super.fromHandle(handle); |
820 | 877 |
821 _NotificationServiceProxyImpl.unbound() : super.unbound(); | 878 _NotificationServiceProxyImpl.unbound() : super.unbound(); |
822 | 879 |
823 static _NotificationServiceProxyImpl newFromEndpoint( | 880 static _NotificationServiceProxyImpl newFromEndpoint( |
824 core.MojoMessagePipeEndpoint endpoint) { | 881 core.MojoMessagePipeEndpoint endpoint) { |
825 assert(endpoint.setDescription("For _NotificationServiceProxyImpl")); | 882 assert(endpoint.setDescription("For _NotificationServiceProxyImpl")); |
826 return new _NotificationServiceProxyImpl.fromEndpoint(endpoint); | 883 return new _NotificationServiceProxyImpl.fromEndpoint(endpoint); |
827 } | 884 } |
828 | 885 |
| 886 service_describer.ServiceDescription get serviceDescription => |
| 887 new _NotificationServiceServiceDescription(); |
| 888 |
829 void handleResponse(bindings.ServiceMessage message) { | 889 void handleResponse(bindings.ServiceMessage message) { |
830 switch (message.header.type) { | 890 switch (message.header.type) { |
831 default: | 891 default: |
832 proxyError("Unexpected message type: ${message.header.type}"); | 892 proxyError("Unexpected message type: ${message.header.type}"); |
833 close(immediate: true); | 893 close(immediate: true); |
834 break; | 894 break; |
835 } | 895 } |
836 } | 896 } |
837 | 897 |
838 String toString() { | 898 String toString() { |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 assert(_impl == null); | 1024 assert(_impl == null); |
965 _impl = d; | 1025 _impl = d; |
966 } | 1026 } |
967 | 1027 |
968 String toString() { | 1028 String toString() { |
969 var superString = super.toString(); | 1029 var superString = super.toString(); |
970 return "NotificationServiceStub($superString)"; | 1030 return "NotificationServiceStub($superString)"; |
971 } | 1031 } |
972 | 1032 |
973 int get version => 0; | 1033 int get version => 0; |
| 1034 |
| 1035 service_describer.ServiceDescription get serviceDescription => |
| 1036 new _NotificationServiceServiceDescription(); |
974 } | 1037 } |
975 | 1038 |
976 | 1039 |
| 1040 |
OLD | NEW |