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]) => null; |
| 463 |
| 464 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 465 null; |
| 466 |
| 467 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 468 } |
| 469 |
444 abstract class NotificationClient { | 470 abstract class NotificationClient { |
445 static const String serviceName = null; | 471 static const String serviceName = null; |
446 void onSelected(); | 472 void onSelected(); |
447 void onDismissed(); | 473 void onDismissed(); |
448 } | 474 } |
449 | 475 |
450 | 476 |
451 class _NotificationClientProxyImpl extends bindings.Proxy { | 477 class _NotificationClientProxyImpl extends bindings.Proxy { |
452 _NotificationClientProxyImpl.fromEndpoint( | 478 _NotificationClientProxyImpl.fromEndpoint( |
453 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 479 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
454 | 480 |
455 _NotificationClientProxyImpl.fromHandle(core.MojoHandle handle) : | 481 _NotificationClientProxyImpl.fromHandle(core.MojoHandle handle) : |
456 super.fromHandle(handle); | 482 super.fromHandle(handle); |
457 | 483 |
458 _NotificationClientProxyImpl.unbound() : super.unbound(); | 484 _NotificationClientProxyImpl.unbound() : super.unbound(); |
459 | 485 |
460 static _NotificationClientProxyImpl newFromEndpoint( | 486 static _NotificationClientProxyImpl newFromEndpoint( |
461 core.MojoMessagePipeEndpoint endpoint) { | 487 core.MojoMessagePipeEndpoint endpoint) { |
462 assert(endpoint.setDescription("For _NotificationClientProxyImpl")); | 488 assert(endpoint.setDescription("For _NotificationClientProxyImpl")); |
463 return new _NotificationClientProxyImpl.fromEndpoint(endpoint); | 489 return new _NotificationClientProxyImpl.fromEndpoint(endpoint); |
464 } | 490 } |
465 | 491 |
| 492 service_describer.ServiceDescription get serviceDescription => |
| 493 new _NotificationClientServiceDescription(); |
| 494 |
466 void handleResponse(bindings.ServiceMessage message) { | 495 void handleResponse(bindings.ServiceMessage message) { |
467 switch (message.header.type) { | 496 switch (message.header.type) { |
468 default: | 497 default: |
469 proxyError("Unexpected message type: ${message.header.type}"); | 498 proxyError("Unexpected message type: ${message.header.type}"); |
470 close(immediate: true); | 499 close(immediate: true); |
471 break; | 500 break; |
472 } | 501 } |
473 } | 502 } |
474 | 503 |
475 String toString() { | 504 String toString() { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 assert(_impl == null); | 640 assert(_impl == null); |
612 _impl = d; | 641 _impl = d; |
613 } | 642 } |
614 | 643 |
615 String toString() { | 644 String toString() { |
616 var superString = super.toString(); | 645 var superString = super.toString(); |
617 return "NotificationClientStub($superString)"; | 646 return "NotificationClientStub($superString)"; |
618 } | 647 } |
619 | 648 |
620 int get version => 0; | 649 int get version => 0; |
| 650 |
| 651 service_describer.ServiceDescription get serviceDescription => |
| 652 new _NotificationClientServiceDescription(); |
621 } | 653 } |
622 | 654 |
623 const int _Notification_updateName = 0; | 655 const int _Notification_updateName = 0; |
624 const int _Notification_cancelName = 1; | 656 const int _Notification_cancelName = 1; |
625 | 657 |
| 658 |
| 659 |
| 660 class _NotificationServiceDescription implements service_describer.ServiceDescri
ption { |
| 661 dynamic getTopLevelInterface([Function responseFactory = null]) => null; |
| 662 |
| 663 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 664 null; |
| 665 |
| 666 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 667 } |
| 668 |
626 abstract class Notification { | 669 abstract class Notification { |
627 static const String serviceName = null; | 670 static const String serviceName = null; |
628 void update(NotificationData notificationData); | 671 void update(NotificationData notificationData); |
629 void cancel(); | 672 void cancel(); |
630 } | 673 } |
631 | 674 |
632 | 675 |
633 class _NotificationProxyImpl extends bindings.Proxy { | 676 class _NotificationProxyImpl extends bindings.Proxy { |
634 _NotificationProxyImpl.fromEndpoint( | 677 _NotificationProxyImpl.fromEndpoint( |
635 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 678 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
636 | 679 |
637 _NotificationProxyImpl.fromHandle(core.MojoHandle handle) : | 680 _NotificationProxyImpl.fromHandle(core.MojoHandle handle) : |
638 super.fromHandle(handle); | 681 super.fromHandle(handle); |
639 | 682 |
640 _NotificationProxyImpl.unbound() : super.unbound(); | 683 _NotificationProxyImpl.unbound() : super.unbound(); |
641 | 684 |
642 static _NotificationProxyImpl newFromEndpoint( | 685 static _NotificationProxyImpl newFromEndpoint( |
643 core.MojoMessagePipeEndpoint endpoint) { | 686 core.MojoMessagePipeEndpoint endpoint) { |
644 assert(endpoint.setDescription("For _NotificationProxyImpl")); | 687 assert(endpoint.setDescription("For _NotificationProxyImpl")); |
645 return new _NotificationProxyImpl.fromEndpoint(endpoint); | 688 return new _NotificationProxyImpl.fromEndpoint(endpoint); |
646 } | 689 } |
647 | 690 |
| 691 service_describer.ServiceDescription get serviceDescription => |
| 692 new _NotificationServiceDescription(); |
| 693 |
648 void handleResponse(bindings.ServiceMessage message) { | 694 void handleResponse(bindings.ServiceMessage message) { |
649 switch (message.header.type) { | 695 switch (message.header.type) { |
650 default: | 696 default: |
651 proxyError("Unexpected message type: ${message.header.type}"); | 697 proxyError("Unexpected message type: ${message.header.type}"); |
652 close(immediate: true); | 698 close(immediate: true); |
653 break; | 699 break; |
654 } | 700 } |
655 } | 701 } |
656 | 702 |
657 String toString() { | 703 String toString() { |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 assert(_impl == null); | 840 assert(_impl == null); |
795 _impl = d; | 841 _impl = d; |
796 } | 842 } |
797 | 843 |
798 String toString() { | 844 String toString() { |
799 var superString = super.toString(); | 845 var superString = super.toString(); |
800 return "NotificationStub($superString)"; | 846 return "NotificationStub($superString)"; |
801 } | 847 } |
802 | 848 |
803 int get version => 0; | 849 int get version => 0; |
| 850 |
| 851 service_describer.ServiceDescription get serviceDescription => |
| 852 new _NotificationServiceDescription(); |
804 } | 853 } |
805 | 854 |
806 const int _NotificationService_postName = 0; | 855 const int _NotificationService_postName = 0; |
807 | 856 |
| 857 |
| 858 |
| 859 class _NotificationServiceServiceDescription implements service_describer.Servic
eDescription { |
| 860 dynamic getTopLevelInterface([Function responseFactory = null]) => null; |
| 861 |
| 862 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 863 null; |
| 864 |
| 865 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 866 } |
| 867 |
808 abstract class NotificationService { | 868 abstract class NotificationService { |
809 static const String serviceName = "notifications::NotificationService"; | 869 static const String serviceName = "notifications::NotificationService"; |
810 void post(NotificationData notificationData, Object client, Object notificatio
n); | 870 void post(NotificationData notificationData, Object client, Object notificatio
n); |
811 } | 871 } |
812 | 872 |
813 | 873 |
814 class _NotificationServiceProxyImpl extends bindings.Proxy { | 874 class _NotificationServiceProxyImpl extends bindings.Proxy { |
815 _NotificationServiceProxyImpl.fromEndpoint( | 875 _NotificationServiceProxyImpl.fromEndpoint( |
816 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 876 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
817 | 877 |
818 _NotificationServiceProxyImpl.fromHandle(core.MojoHandle handle) : | 878 _NotificationServiceProxyImpl.fromHandle(core.MojoHandle handle) : |
819 super.fromHandle(handle); | 879 super.fromHandle(handle); |
820 | 880 |
821 _NotificationServiceProxyImpl.unbound() : super.unbound(); | 881 _NotificationServiceProxyImpl.unbound() : super.unbound(); |
822 | 882 |
823 static _NotificationServiceProxyImpl newFromEndpoint( | 883 static _NotificationServiceProxyImpl newFromEndpoint( |
824 core.MojoMessagePipeEndpoint endpoint) { | 884 core.MojoMessagePipeEndpoint endpoint) { |
825 assert(endpoint.setDescription("For _NotificationServiceProxyImpl")); | 885 assert(endpoint.setDescription("For _NotificationServiceProxyImpl")); |
826 return new _NotificationServiceProxyImpl.fromEndpoint(endpoint); | 886 return new _NotificationServiceProxyImpl.fromEndpoint(endpoint); |
827 } | 887 } |
828 | 888 |
| 889 service_describer.ServiceDescription get serviceDescription => |
| 890 new _NotificationServiceServiceDescription(); |
| 891 |
829 void handleResponse(bindings.ServiceMessage message) { | 892 void handleResponse(bindings.ServiceMessage message) { |
830 switch (message.header.type) { | 893 switch (message.header.type) { |
831 default: | 894 default: |
832 proxyError("Unexpected message type: ${message.header.type}"); | 895 proxyError("Unexpected message type: ${message.header.type}"); |
833 close(immediate: true); | 896 close(immediate: true); |
834 break; | 897 break; |
835 } | 898 } |
836 } | 899 } |
837 | 900 |
838 String toString() { | 901 String toString() { |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 assert(_impl == null); | 1027 assert(_impl == null); |
965 _impl = d; | 1028 _impl = d; |
966 } | 1029 } |
967 | 1030 |
968 String toString() { | 1031 String toString() { |
969 var superString = super.toString(); | 1032 var superString = super.toString(); |
970 return "NotificationServiceStub($superString)"; | 1033 return "NotificationServiceStub($superString)"; |
971 } | 1034 } |
972 | 1035 |
973 int get version => 0; | 1036 int get version => 0; |
| 1037 |
| 1038 service_describer.ServiceDescription get serviceDescription => |
| 1039 new _NotificationServiceServiceDescription(); |
974 } | 1040 } |
975 | 1041 |
976 | 1042 |
| 1043 |
| 1044 |
OLD | NEW |