| 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 clipboard_mojom; | 5 library clipboard_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 _ClipboardGetSequenceNumberParams extends bindings.Struct { | 16 class _ClipboardGetSequenceNumberParams extends bindings.Struct { |
| 15 static const List<bindings.StructDataHeader> kVersions = const [ | 17 static const List<bindings.StructDataHeader> kVersions = const [ |
| 16 const bindings.StructDataHeader(16, 0) | 18 const bindings.StructDataHeader(16, 0) |
| 17 ]; | 19 ]; |
| 18 ClipboardType clipboardType = null; | 20 ClipboardType clipboardType = null; |
| 19 | 21 |
| 20 _ClipboardGetSequenceNumberParams() : super(kVersions.last.size); | 22 _ClipboardGetSequenceNumberParams() : super(kVersions.last.size); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 77 } |
| 76 | 78 |
| 77 Map toJson() { | 79 Map toJson() { |
| 78 Map map = new Map(); | 80 Map map = new Map(); |
| 79 map["clipboardType"] = clipboardType; | 81 map["clipboardType"] = clipboardType; |
| 80 return map; | 82 return map; |
| 81 } | 83 } |
| 82 } | 84 } |
| 83 | 85 |
| 84 | 86 |
| 87 |
| 88 |
| 85 class ClipboardGetSequenceNumberResponseParams extends bindings.Struct { | 89 class ClipboardGetSequenceNumberResponseParams extends bindings.Struct { |
| 86 static const List<bindings.StructDataHeader> kVersions = const [ | 90 static const List<bindings.StructDataHeader> kVersions = const [ |
| 87 const bindings.StructDataHeader(16, 0) | 91 const bindings.StructDataHeader(16, 0) |
| 88 ]; | 92 ]; |
| 89 int sequence = 0; | 93 int sequence = 0; |
| 90 | 94 |
| 91 ClipboardGetSequenceNumberResponseParams() : super(kVersions.last.size); | 95 ClipboardGetSequenceNumberResponseParams() : super(kVersions.last.size); |
| 92 | 96 |
| 93 static ClipboardGetSequenceNumberResponseParams deserialize(bindings.Message m
essage) { | 97 static ClipboardGetSequenceNumberResponseParams deserialize(bindings.Message m
essage) { |
| 94 var decoder = new bindings.Decoder(message); | 98 var decoder = new bindings.Decoder(message); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 146 } |
| 143 | 147 |
| 144 Map toJson() { | 148 Map toJson() { |
| 145 Map map = new Map(); | 149 Map map = new Map(); |
| 146 map["sequence"] = sequence; | 150 map["sequence"] = sequence; |
| 147 return map; | 151 return map; |
| 148 } | 152 } |
| 149 } | 153 } |
| 150 | 154 |
| 151 | 155 |
| 156 |
| 157 |
| 152 class _ClipboardGetAvailableMimeTypesParams extends bindings.Struct { | 158 class _ClipboardGetAvailableMimeTypesParams extends bindings.Struct { |
| 153 static const List<bindings.StructDataHeader> kVersions = const [ | 159 static const List<bindings.StructDataHeader> kVersions = const [ |
| 154 const bindings.StructDataHeader(16, 0) | 160 const bindings.StructDataHeader(16, 0) |
| 155 ]; | 161 ]; |
| 156 ClipboardType clipboardTypes = null; | 162 ClipboardType clipboardTypes = null; |
| 157 | 163 |
| 158 _ClipboardGetAvailableMimeTypesParams() : super(kVersions.last.size); | 164 _ClipboardGetAvailableMimeTypesParams() : super(kVersions.last.size); |
| 159 | 165 |
| 160 static _ClipboardGetAvailableMimeTypesParams deserialize(bindings.Message mess
age) { | 166 static _ClipboardGetAvailableMimeTypesParams deserialize(bindings.Message mess
age) { |
| 161 var decoder = new bindings.Decoder(message); | 167 var decoder = new bindings.Decoder(message); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 } | 219 } |
| 214 | 220 |
| 215 Map toJson() { | 221 Map toJson() { |
| 216 Map map = new Map(); | 222 Map map = new Map(); |
| 217 map["clipboardTypes"] = clipboardTypes; | 223 map["clipboardTypes"] = clipboardTypes; |
| 218 return map; | 224 return map; |
| 219 } | 225 } |
| 220 } | 226 } |
| 221 | 227 |
| 222 | 228 |
| 229 |
| 230 |
| 223 class ClipboardGetAvailableMimeTypesResponseParams extends bindings.Struct { | 231 class ClipboardGetAvailableMimeTypesResponseParams extends bindings.Struct { |
| 224 static const List<bindings.StructDataHeader> kVersions = const [ | 232 static const List<bindings.StructDataHeader> kVersions = const [ |
| 225 const bindings.StructDataHeader(16, 0) | 233 const bindings.StructDataHeader(16, 0) |
| 226 ]; | 234 ]; |
| 227 List<String> types = null; | 235 List<String> types = null; |
| 228 | 236 |
| 229 ClipboardGetAvailableMimeTypesResponseParams() : super(kVersions.last.size); | 237 ClipboardGetAvailableMimeTypesResponseParams() : super(kVersions.last.size); |
| 230 | 238 |
| 231 static ClipboardGetAvailableMimeTypesResponseParams deserialize(bindings.Messa
ge message) { | 239 static ClipboardGetAvailableMimeTypesResponseParams deserialize(bindings.Messa
ge message) { |
| 232 var decoder = new bindings.Decoder(message); | 240 var decoder = new bindings.Decoder(message); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } | 304 } |
| 297 | 305 |
| 298 Map toJson() { | 306 Map toJson() { |
| 299 Map map = new Map(); | 307 Map map = new Map(); |
| 300 map["types"] = types; | 308 map["types"] = types; |
| 301 return map; | 309 return map; |
| 302 } | 310 } |
| 303 } | 311 } |
| 304 | 312 |
| 305 | 313 |
| 314 |
| 315 |
| 306 class _ClipboardReadMimeTypeParams extends bindings.Struct { | 316 class _ClipboardReadMimeTypeParams extends bindings.Struct { |
| 307 static const List<bindings.StructDataHeader> kVersions = const [ | 317 static const List<bindings.StructDataHeader> kVersions = const [ |
| 308 const bindings.StructDataHeader(24, 0) | 318 const bindings.StructDataHeader(24, 0) |
| 309 ]; | 319 ]; |
| 310 ClipboardType clipboardType = null; | 320 ClipboardType clipboardType = null; |
| 311 String mimeType = null; | 321 String mimeType = null; |
| 312 | 322 |
| 313 _ClipboardReadMimeTypeParams() : super(kVersions.last.size); | 323 _ClipboardReadMimeTypeParams() : super(kVersions.last.size); |
| 314 | 324 |
| 315 static _ClipboardReadMimeTypeParams deserialize(bindings.Message message) { | 325 static _ClipboardReadMimeTypeParams deserialize(bindings.Message message) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 | 386 |
| 377 Map toJson() { | 387 Map toJson() { |
| 378 Map map = new Map(); | 388 Map map = new Map(); |
| 379 map["clipboardType"] = clipboardType; | 389 map["clipboardType"] = clipboardType; |
| 380 map["mimeType"] = mimeType; | 390 map["mimeType"] = mimeType; |
| 381 return map; | 391 return map; |
| 382 } | 392 } |
| 383 } | 393 } |
| 384 | 394 |
| 385 | 395 |
| 396 |
| 397 |
| 386 class ClipboardReadMimeTypeResponseParams extends bindings.Struct { | 398 class ClipboardReadMimeTypeResponseParams extends bindings.Struct { |
| 387 static const List<bindings.StructDataHeader> kVersions = const [ | 399 static const List<bindings.StructDataHeader> kVersions = const [ |
| 388 const bindings.StructDataHeader(16, 0) | 400 const bindings.StructDataHeader(16, 0) |
| 389 ]; | 401 ]; |
| 390 List<int> data = null; | 402 List<int> data = null; |
| 391 | 403 |
| 392 ClipboardReadMimeTypeResponseParams() : super(kVersions.last.size); | 404 ClipboardReadMimeTypeResponseParams() : super(kVersions.last.size); |
| 393 | 405 |
| 394 static ClipboardReadMimeTypeResponseParams deserialize(bindings.Message messag
e) { | 406 static ClipboardReadMimeTypeResponseParams deserialize(bindings.Message messag
e) { |
| 395 var decoder = new bindings.Decoder(message); | 407 var decoder = new bindings.Decoder(message); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 } | 455 } |
| 444 | 456 |
| 445 Map toJson() { | 457 Map toJson() { |
| 446 Map map = new Map(); | 458 Map map = new Map(); |
| 447 map["data"] = data; | 459 map["data"] = data; |
| 448 return map; | 460 return map; |
| 449 } | 461 } |
| 450 } | 462 } |
| 451 | 463 |
| 452 | 464 |
| 465 |
| 466 |
| 453 class _ClipboardWriteClipboardDataParams extends bindings.Struct { | 467 class _ClipboardWriteClipboardDataParams extends bindings.Struct { |
| 454 static const List<bindings.StructDataHeader> kVersions = const [ | 468 static const List<bindings.StructDataHeader> kVersions = const [ |
| 455 const bindings.StructDataHeader(24, 0) | 469 const bindings.StructDataHeader(24, 0) |
| 456 ]; | 470 ]; |
| 457 ClipboardType clipboardType = null; | 471 ClipboardType clipboardType = null; |
| 458 Map<String, List<int>> data = null; | 472 Map<String, List<int>> data = null; |
| 459 | 473 |
| 460 _ClipboardWriteClipboardDataParams() : super(kVersions.last.size); | 474 _ClipboardWriteClipboardDataParams() : super(kVersions.last.size); |
| 461 | 475 |
| 462 static _ClipboardWriteClipboardDataParams deserialize(bindings.Message message
) { | 476 static _ClipboardWriteClipboardDataParams deserialize(bindings.Message message
) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 } | 592 } |
| 579 | 593 |
| 580 Map toJson() { | 594 Map toJson() { |
| 581 Map map = new Map(); | 595 Map map = new Map(); |
| 582 map["clipboardType"] = clipboardType; | 596 map["clipboardType"] = clipboardType; |
| 583 map["data"] = data; | 597 map["data"] = data; |
| 584 return map; | 598 return map; |
| 585 } | 599 } |
| 586 } | 600 } |
| 587 | 601 |
| 602 |
| 603 |
| 604 |
| 588 const int _Clipboard_getSequenceNumberName = 0; | 605 const int _Clipboard_getSequenceNumberName = 0; |
| 589 const int _Clipboard_getAvailableMimeTypesName = 1; | 606 const int _Clipboard_getAvailableMimeTypesName = 1; |
| 590 const int _Clipboard_readMimeTypeName = 2; | 607 const int _Clipboard_readMimeTypeName = 2; |
| 591 const int _Clipboard_writeClipboardDataName = 3; | 608 const int _Clipboard_writeClipboardDataName = 3; |
| 592 | 609 |
| 593 class ClipboardType extends bindings.MojoEnum { | 610 class ClipboardType extends bindings.MojoEnum { |
| 594 static const ClipboardType copyPaste = const ClipboardType._(0); | 611 static const ClipboardType copyPaste = const ClipboardType._(0); |
| 595 static const ClipboardType selection = const ClipboardType._(1); | 612 static const ClipboardType selection = const ClipboardType._(1); |
| 596 static const ClipboardType drag = const ClipboardType._(2); | 613 static const ClipboardType drag = const ClipboardType._(2); |
| 597 | 614 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 } | 651 } |
| 635 | 652 |
| 636 String toString() { | 653 String toString() { |
| 637 switch(this) { | 654 switch(this) { |
| 638 case copyPaste: | 655 case copyPaste: |
| 639 return 'ClipboardType.copyPaste'; | 656 return 'ClipboardType.copyPaste'; |
| 640 case selection: | 657 case selection: |
| 641 return 'ClipboardType.selection'; | 658 return 'ClipboardType.selection'; |
| 642 case drag: | 659 case drag: |
| 643 return 'ClipboardType.drag'; | 660 return 'ClipboardType.drag'; |
| 661 default: |
| 662 return null; |
| 644 } | 663 } |
| 645 } | 664 } |
| 646 | 665 |
| 647 int toJson() => mojoEnumValue; | 666 int toJson() => mojoEnumValue; |
| 648 } | 667 } |
| 649 | 668 |
| 669 |
| 670 |
| 671 |
| 672 |
| 673 class _ClipboardServiceDescription implements service_describer.ServiceDescripti
on { |
| 674 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 675 |
| 676 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 677 |
| 678 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 679 } |
| 680 |
| 650 abstract class Clipboard { | 681 abstract class Clipboard { |
| 651 static const String serviceName = "mojo::Clipboard"; | 682 static const String serviceName = "mojo::Clipboard"; |
| 652 dynamic getSequenceNumber(ClipboardType clipboardType,[Function responseFactor
y = null]); | 683 dynamic getSequenceNumber(ClipboardType clipboardType,[Function responseFactor
y = null]); |
| 653 dynamic getAvailableMimeTypes(ClipboardType clipboardTypes,[Function responseF
actory = null]); | 684 dynamic getAvailableMimeTypes(ClipboardType clipboardTypes,[Function responseF
actory = null]); |
| 654 dynamic readMimeType(ClipboardType clipboardType,String mimeType,[Function res
ponseFactory = null]); | 685 dynamic readMimeType(ClipboardType clipboardType,String mimeType,[Function res
ponseFactory = null]); |
| 655 void writeClipboardData(ClipboardType clipboardType, Map<String, List<int>> da
ta); | 686 void writeClipboardData(ClipboardType clipboardType, Map<String, List<int>> da
ta); |
| 656 static const String mimeTypeText = "text/plain"; | 687 static const String mimeTypeText = "text/plain"; |
| 657 static const String mimeTypeHtml = "text/html"; | 688 static const String mimeTypeHtml = "text/html"; |
| 658 static const String mimeTypeUrl = "text/url"; | 689 static const String mimeTypeUrl = "text/url"; |
| 659 } | 690 } |
| 660 | 691 |
| 661 | 692 |
| 662 class _ClipboardProxyImpl extends bindings.Proxy { | 693 class _ClipboardProxyImpl extends bindings.Proxy { |
| 663 _ClipboardProxyImpl.fromEndpoint( | 694 _ClipboardProxyImpl.fromEndpoint( |
| 664 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 695 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 665 | 696 |
| 666 _ClipboardProxyImpl.fromHandle(core.MojoHandle handle) : | 697 _ClipboardProxyImpl.fromHandle(core.MojoHandle handle) : |
| 667 super.fromHandle(handle); | 698 super.fromHandle(handle); |
| 668 | 699 |
| 669 _ClipboardProxyImpl.unbound() : super.unbound(); | 700 _ClipboardProxyImpl.unbound() : super.unbound(); |
| 670 | 701 |
| 671 static _ClipboardProxyImpl newFromEndpoint( | 702 static _ClipboardProxyImpl newFromEndpoint( |
| 672 core.MojoMessagePipeEndpoint endpoint) { | 703 core.MojoMessagePipeEndpoint endpoint) { |
| 673 assert(endpoint.setDescription("For _ClipboardProxyImpl")); | 704 assert(endpoint.setDescription("For _ClipboardProxyImpl")); |
| 674 return new _ClipboardProxyImpl.fromEndpoint(endpoint); | 705 return new _ClipboardProxyImpl.fromEndpoint(endpoint); |
| 675 } | 706 } |
| 676 | 707 |
| 708 service_describer.ServiceDescription get serviceDescription => |
| 709 new _ClipboardServiceDescription(); |
| 710 |
| 677 void handleResponse(bindings.ServiceMessage message) { | 711 void handleResponse(bindings.ServiceMessage message) { |
| 678 switch (message.header.type) { | 712 switch (message.header.type) { |
| 679 case _Clipboard_getSequenceNumberName: | 713 case _Clipboard_getSequenceNumberName: |
| 680 var r = ClipboardGetSequenceNumberResponseParams.deserialize( | 714 var r = ClipboardGetSequenceNumberResponseParams.deserialize( |
| 681 message.payload); | 715 message.payload); |
| 682 if (!message.header.hasRequestId) { | 716 if (!message.header.hasRequestId) { |
| 683 proxyError("Expected a message with a valid request Id."); | 717 proxyError("Expected a message with a valid request Id."); |
| 684 return; | 718 return; |
| 685 } | 719 } |
| 686 Completer c = completerMap[message.header.requestId]; | 720 Completer c = completerMap[message.header.requestId]; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 assert(_impl == null); | 1014 assert(_impl == null); |
| 981 _impl = d; | 1015 _impl = d; |
| 982 } | 1016 } |
| 983 | 1017 |
| 984 String toString() { | 1018 String toString() { |
| 985 var superString = super.toString(); | 1019 var superString = super.toString(); |
| 986 return "ClipboardStub($superString)"; | 1020 return "ClipboardStub($superString)"; |
| 987 } | 1021 } |
| 988 | 1022 |
| 989 int get version => 0; | 1023 int get version => 0; |
| 1024 |
| 1025 service_describer.ServiceDescription get serviceDescription => |
| 1026 new _ClipboardServiceDescription(); |
| 990 } | 1027 } |
| 991 | 1028 |
| 992 | 1029 |
| 1030 |
| OLD | NEW |