Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: mojo/dart/packages/mojo_services/lib/keyboard/keyboard.mojom.dart

Issue 1998433002: Dart: Adds Interface and InterfaceRequest interfaces. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 keyboard_mojom; 5 library keyboard_mojom;
6 import 'dart:async'; 6 import 'dart:async';
7 import 'package:mojo/bindings.dart' as bindings; 7 import 'package:mojo/bindings.dart' as bindings;
8 import 'package:mojo/core.dart' as core; 8 import 'package:mojo/core.dart' as core;
9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer; 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer;
10 import 'package:mojo_services/mojo/native_viewport_event_dispatcher.mojom.dart' as native_viewport_event_dispatcher_mojom; 10 import 'package:mojo_services/mojo/native_viewport_event_dispatcher.mojom.dart' as native_viewport_event_dispatcher_mojom;
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 map["action"] = action; 985 map["action"] = action;
986 return map; 986 return map;
987 } 987 }
988 } 988 }
989 989
990 990
991 class _KeyboardServiceShowParams extends bindings.Struct { 991 class _KeyboardServiceShowParams extends bindings.Struct {
992 static const List<bindings.StructDataHeader> kVersions = const [ 992 static const List<bindings.StructDataHeader> kVersions = const [
993 const bindings.StructDataHeader(24, 0) 993 const bindings.StructDataHeader(24, 0)
994 ]; 994 ];
995 Object client = null; 995 KeyboardClientInterface client = null;
996 KeyboardType type = null; 996 KeyboardType type = null;
997 997
998 _KeyboardServiceShowParams() : super(kVersions.last.size); 998 _KeyboardServiceShowParams() : super(kVersions.last.size);
999 999
1000 static _KeyboardServiceShowParams deserialize(bindings.Message message) { 1000 static _KeyboardServiceShowParams deserialize(bindings.Message message) {
1001 var decoder = new bindings.Decoder(message); 1001 var decoder = new bindings.Decoder(message);
1002 var result = decode(decoder); 1002 var result = decode(decoder);
1003 if (decoder.excessHandles != null) { 1003 if (decoder.excessHandles != null) {
1004 decoder.excessHandles.forEach((h) => h.close()); 1004 decoder.excessHandles.forEach((h) => h.close());
1005 } 1005 }
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 map["end"] = end; 1347 map["end"] = end;
1348 return map; 1348 return map;
1349 } 1349 }
1350 } 1350 }
1351 1351
1352 1352
1353 class _KeyboardServiceFactoryCreateKeyboardServiceParams extends bindings.Struct { 1353 class _KeyboardServiceFactoryCreateKeyboardServiceParams extends bindings.Struct {
1354 static const List<bindings.StructDataHeader> kVersions = const [ 1354 static const List<bindings.StructDataHeader> kVersions = const [
1355 const bindings.StructDataHeader(16, 0) 1355 const bindings.StructDataHeader(16, 0)
1356 ]; 1356 ];
1357 Object keyEventDispatcher = null; 1357 native_viewport_event_dispatcher_mojom.NativeViewportEventDispatcherInterfaceR equest keyEventDispatcher = null;
1358 Object serviceRequest = null; 1358 KeyboardServiceInterfaceRequest serviceRequest = null;
1359 1359
1360 _KeyboardServiceFactoryCreateKeyboardServiceParams() : super(kVersions.last.si ze); 1360 _KeyboardServiceFactoryCreateKeyboardServiceParams() : super(kVersions.last.si ze);
1361 1361
1362 static _KeyboardServiceFactoryCreateKeyboardServiceParams deserialize(bindings .Message message) { 1362 static _KeyboardServiceFactoryCreateKeyboardServiceParams deserialize(bindings .Message message) {
1363 var decoder = new bindings.Decoder(message); 1363 var decoder = new bindings.Decoder(message);
1364 var result = decode(decoder); 1364 var result = decode(decoder);
1365 if (decoder.excessHandles != null) { 1365 if (decoder.excessHandles != null) {
1366 decoder.excessHandles.forEach((h) => h.close()); 1366 decoder.excessHandles.forEach((h) => h.close());
1367 } 1367 }
1368 return result; 1368 return result;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 1448
1449 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 1449 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
1450 responseFactory(null); 1450 responseFactory(null);
1451 1451
1452 dynamic getAllTypeDefinitions([Function responseFactory]) => 1452 dynamic getAllTypeDefinitions([Function responseFactory]) =>
1453 responseFactory(null); 1453 responseFactory(null);
1454 } 1454 }
1455 1455
1456 abstract class KeyboardClient { 1456 abstract class KeyboardClient {
1457 static const String serviceName = null; 1457 static const String serviceName = null;
1458
1459 static service_describer.ServiceDescription _cachedServiceDescription;
1460 static service_describer.ServiceDescription get serviceDescription {
1461 if (_cachedServiceDescription == null) {
1462 _cachedServiceDescription = new _KeyboardClientServiceDescription();
1463 }
1464 return _cachedServiceDescription;
1465 }
1466
1467 static KeyboardClientProxy connectToService(
1468 bindings.ServiceConnector s, String url, [String serviceName]) {
1469 KeyboardClientProxy p = new KeyboardClientProxy.unbound();
1470 String name = serviceName ?? KeyboardClient.serviceName;
1471 if ((name == null) || name.isEmpty) {
1472 throw new core.MojoApiError(
1473 "If an interface has no ServiceName, then one must be provided.");
1474 }
1475 s.connectToService(url, p, name);
1476 return p;
1477 }
1458 void commitCompletion(CompletionData completion); 1478 void commitCompletion(CompletionData completion);
1459 void commitCorrection(CorrectionData correction); 1479 void commitCorrection(CorrectionData correction);
1460 void commitText(String text, int newCursorPosition); 1480 void commitText(String text, int newCursorPosition);
1461 void deleteSurroundingText(int beforeLength, int afterLength); 1481 void deleteSurroundingText(int beforeLength, int afterLength);
1462 void setComposingRegion(int start, int end); 1482 void setComposingRegion(int start, int end);
1463 void setComposingText(String text, int newCursorPosition); 1483 void setComposingText(String text, int newCursorPosition);
1464 void setSelection(int start, int end); 1484 void setSelection(int start, int end);
1465 void submit(SubmitAction action); 1485 void submit(SubmitAction action);
1466 } 1486 }
1467 1487
1488 abstract class KeyboardClientInterface
1489 implements bindings.MojoInterface<KeyboardClient>,
1490 KeyboardClient {
1491 factory KeyboardClientInterface([KeyboardClient impl]) =>
1492 new KeyboardClientStub.unbound(impl);
1493 factory KeyboardClientInterface.fromEndpoint(
1494 core.MojoMessagePipeEndpoint endpoint,
1495 [KeyboardClient impl]) =>
1496 new KeyboardClientStub.fromEndpoint(endpoint, impl);
1497 }
1498
1499 abstract class KeyboardClientInterfaceRequest
1500 implements bindings.MojoInterface<KeyboardClient>,
1501 KeyboardClient {
1502 factory KeyboardClientInterfaceRequest() =>
1503 new KeyboardClientProxy.unbound();
1504 }
1505
1468 class _KeyboardClientProxyControl 1506 class _KeyboardClientProxyControl
1469 extends bindings.ProxyMessageHandler 1507 extends bindings.ProxyMessageHandler
1470 implements bindings.ProxyControl { 1508 implements bindings.ProxyControl<KeyboardClient> {
1471 _KeyboardClientProxyControl.fromEndpoint( 1509 _KeyboardClientProxyControl.fromEndpoint(
1472 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 1510 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
1473 1511
1474 _KeyboardClientProxyControl.fromHandle( 1512 _KeyboardClientProxyControl.fromHandle(
1475 core.MojoHandle handle) : super.fromHandle(handle); 1513 core.MojoHandle handle) : super.fromHandle(handle);
1476 1514
1477 _KeyboardClientProxyControl.unbound() : super.unbound(); 1515 _KeyboardClientProxyControl.unbound() : super.unbound();
1478 1516
1479 service_describer.ServiceDescription get serviceDescription =>
1480 new _KeyboardClientServiceDescription();
1481
1482 String get serviceName => KeyboardClient.serviceName; 1517 String get serviceName => KeyboardClient.serviceName;
1483 1518
1484 void handleResponse(bindings.ServiceMessage message) { 1519 void handleResponse(bindings.ServiceMessage message) {
1485 switch (message.header.type) { 1520 switch (message.header.type) {
1486 default: 1521 default:
1487 proxyError("Unexpected message type: ${message.header.type}"); 1522 proxyError("Unexpected message type: ${message.header.type}");
1488 close(immediate: true); 1523 close(immediate: true);
1489 break; 1524 break;
1490 } 1525 }
1491 } 1526 }
1492 1527
1528 KeyboardClient get impl => null;
1529 set impl(KeyboardClient _) {
1530 throw new core.MojoApiError("The impl of a Proxy cannot be set.");
1531 }
1532
1493 @override 1533 @override
1494 String toString() { 1534 String toString() {
1495 var superString = super.toString(); 1535 var superString = super.toString();
1496 return "_KeyboardClientProxyControl($superString)"; 1536 return "_KeyboardClientProxyControl($superString)";
1497 } 1537 }
1498 } 1538 }
1499 1539
1500 class KeyboardClientProxy 1540 class KeyboardClientProxy
1501 extends bindings.Proxy 1541 extends bindings.Proxy<KeyboardClient>
1502 implements KeyboardClient { 1542 implements KeyboardClient,
1543 KeyboardClientInterface,
1544 KeyboardClientInterfaceRequest {
1503 KeyboardClientProxy.fromEndpoint( 1545 KeyboardClientProxy.fromEndpoint(
1504 core.MojoMessagePipeEndpoint endpoint) 1546 core.MojoMessagePipeEndpoint endpoint)
1505 : super(new _KeyboardClientProxyControl.fromEndpoint(endpoint)); 1547 : super(new _KeyboardClientProxyControl.fromEndpoint(endpoint));
1506 1548
1507 KeyboardClientProxy.fromHandle(core.MojoHandle handle) 1549 KeyboardClientProxy.fromHandle(core.MojoHandle handle)
1508 : super(new _KeyboardClientProxyControl.fromHandle(handle)); 1550 : super(new _KeyboardClientProxyControl.fromHandle(handle));
1509 1551
1510 KeyboardClientProxy.unbound() 1552 KeyboardClientProxy.unbound()
1511 : super(new _KeyboardClientProxyControl.unbound()); 1553 : super(new _KeyboardClientProxyControl.unbound());
1512 1554
1513 static KeyboardClientProxy newFromEndpoint( 1555 static KeyboardClientProxy newFromEndpoint(
1514 core.MojoMessagePipeEndpoint endpoint) { 1556 core.MojoMessagePipeEndpoint endpoint) {
1515 assert(endpoint.setDescription("For KeyboardClientProxy")); 1557 assert(endpoint.setDescription("For KeyboardClientProxy"));
1516 return new KeyboardClientProxy.fromEndpoint(endpoint); 1558 return new KeyboardClientProxy.fromEndpoint(endpoint);
1517 } 1559 }
1518 1560
1519 factory KeyboardClientProxy.connectToService(
1520 bindings.ServiceConnector s, String url, [String serviceName]) {
1521 KeyboardClientProxy p = new KeyboardClientProxy.unbound();
1522 s.connectToService(url, p, serviceName);
1523 return p;
1524 }
1525
1526 1561
1527 void commitCompletion(CompletionData completion) { 1562 void commitCompletion(CompletionData completion) {
1528 if (!ctrl.isBound) { 1563 if (!ctrl.isBound) {
1529 ctrl.proxyError("The Proxy is closed."); 1564 ctrl.proxyError("The Proxy is closed.");
1530 return; 1565 return;
1531 } 1566 }
1532 var params = new _KeyboardClientCommitCompletionParams(); 1567 var params = new _KeyboardClientCommitCompletionParams();
1533 params.completion = completion; 1568 params.completion = completion;
1534 ctrl.sendMessage(params, 1569 ctrl.sendMessage(params,
1535 _keyboardClientMethodCommitCompletionName); 1570 _keyboardClientMethodCommitCompletionName);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1623 } 1658 }
1624 1659
1625 _KeyboardClientStubControl.fromHandle( 1660 _KeyboardClientStubControl.fromHandle(
1626 core.MojoHandle handle, [KeyboardClient impl]) 1661 core.MojoHandle handle, [KeyboardClient impl])
1627 : super.fromHandle(handle, autoBegin: impl != null) { 1662 : super.fromHandle(handle, autoBegin: impl != null) {
1628 _impl = impl; 1663 _impl = impl;
1629 } 1664 }
1630 1665
1631 _KeyboardClientStubControl.unbound([this._impl]) : super.unbound(); 1666 _KeyboardClientStubControl.unbound([this._impl]) : super.unbound();
1632 1667
1668 String get serviceName => KeyboardClient.serviceName;
1669
1633 1670
1634 1671
1635 dynamic handleMessage(bindings.ServiceMessage message) { 1672 dynamic handleMessage(bindings.ServiceMessage message) {
1636 if (bindings.ControlMessageHandler.isControlMessage(message)) { 1673 if (bindings.ControlMessageHandler.isControlMessage(message)) {
1637 return bindings.ControlMessageHandler.handleMessage(this, 1674 return bindings.ControlMessageHandler.handleMessage(this,
1638 0, 1675 0,
1639 message); 1676 message);
1640 } 1677 }
1641 if (_impl == null) { 1678 if (_impl == null) {
1642 throw new core.MojoApiError("$this has no implementation set"); 1679 throw new core.MojoApiError("$this has no implementation set");
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1708 } 1745 }
1709 } 1746 }
1710 1747
1711 @override 1748 @override
1712 String toString() { 1749 String toString() {
1713 var superString = super.toString(); 1750 var superString = super.toString();
1714 return "_KeyboardClientStubControl($superString)"; 1751 return "_KeyboardClientStubControl($superString)";
1715 } 1752 }
1716 1753
1717 int get version => 0; 1754 int get version => 0;
1718
1719 static service_describer.ServiceDescription _cachedServiceDescription;
1720 static service_describer.ServiceDescription get serviceDescription {
1721 if (_cachedServiceDescription == null) {
1722 _cachedServiceDescription = new _KeyboardClientServiceDescription();
1723 }
1724 return _cachedServiceDescription;
1725 }
1726 } 1755 }
1727 1756
1728 class KeyboardClientStub 1757 class KeyboardClientStub
1729 extends bindings.Stub<KeyboardClient> 1758 extends bindings.Stub<KeyboardClient>
1730 implements KeyboardClient { 1759 implements KeyboardClient,
1760 KeyboardClientInterface,
1761 KeyboardClientInterfaceRequest {
1762 KeyboardClientStub.unbound([KeyboardClient impl])
1763 : super(new _KeyboardClientStubControl.unbound(impl));
1764
1731 KeyboardClientStub.fromEndpoint( 1765 KeyboardClientStub.fromEndpoint(
1732 core.MojoMessagePipeEndpoint endpoint, [KeyboardClient impl]) 1766 core.MojoMessagePipeEndpoint endpoint, [KeyboardClient impl])
1733 : super(new _KeyboardClientStubControl.fromEndpoint(endpoint, impl)); 1767 : super(new _KeyboardClientStubControl.fromEndpoint(endpoint, impl));
1734 1768
1735 KeyboardClientStub.fromHandle( 1769 KeyboardClientStub.fromHandle(
1736 core.MojoHandle handle, [KeyboardClient impl]) 1770 core.MojoHandle handle, [KeyboardClient impl])
1737 : super(new _KeyboardClientStubControl.fromHandle(handle, impl)); 1771 : super(new _KeyboardClientStubControl.fromHandle(handle, impl));
1738 1772
1739 KeyboardClientStub.unbound([KeyboardClient impl])
1740 : super(new _KeyboardClientStubControl.unbound(impl));
1741
1742 static KeyboardClientStub newFromEndpoint( 1773 static KeyboardClientStub newFromEndpoint(
1743 core.MojoMessagePipeEndpoint endpoint) { 1774 core.MojoMessagePipeEndpoint endpoint) {
1744 assert(endpoint.setDescription("For KeyboardClientStub")); 1775 assert(endpoint.setDescription("For KeyboardClientStub"));
1745 return new KeyboardClientStub.fromEndpoint(endpoint); 1776 return new KeyboardClientStub.fromEndpoint(endpoint);
1746 } 1777 }
1747 1778
1748 static service_describer.ServiceDescription get serviceDescription =>
1749 _KeyboardClientStubControl.serviceDescription;
1750
1751 1779
1752 void commitCompletion(CompletionData completion) { 1780 void commitCompletion(CompletionData completion) {
1753 return impl.commitCompletion(completion); 1781 return impl.commitCompletion(completion);
1754 } 1782 }
1755 void commitCorrection(CorrectionData correction) { 1783 void commitCorrection(CorrectionData correction) {
1756 return impl.commitCorrection(correction); 1784 return impl.commitCorrection(correction);
1757 } 1785 }
1758 void commitText(String text, int newCursorPosition) { 1786 void commitText(String text, int newCursorPosition) {
1759 return impl.commitText(text, newCursorPosition); 1787 return impl.commitText(text, newCursorPosition);
1760 } 1788 }
(...skipping 26 matching lines...) Expand all
1787 1815
1788 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 1816 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
1789 responseFactory(null); 1817 responseFactory(null);
1790 1818
1791 dynamic getAllTypeDefinitions([Function responseFactory]) => 1819 dynamic getAllTypeDefinitions([Function responseFactory]) =>
1792 responseFactory(null); 1820 responseFactory(null);
1793 } 1821 }
1794 1822
1795 abstract class KeyboardService { 1823 abstract class KeyboardService {
1796 static const String serviceName = "keyboard::KeyboardService"; 1824 static const String serviceName = "keyboard::KeyboardService";
1797 void show(Object client, KeyboardType type); 1825
1826 static service_describer.ServiceDescription _cachedServiceDescription;
1827 static service_describer.ServiceDescription get serviceDescription {
1828 if (_cachedServiceDescription == null) {
1829 _cachedServiceDescription = new _KeyboardServiceServiceDescription();
1830 }
1831 return _cachedServiceDescription;
1832 }
1833
1834 static KeyboardServiceProxy connectToService(
1835 bindings.ServiceConnector s, String url, [String serviceName]) {
1836 KeyboardServiceProxy p = new KeyboardServiceProxy.unbound();
1837 String name = serviceName ?? KeyboardService.serviceName;
1838 if ((name == null) || name.isEmpty) {
1839 throw new core.MojoApiError(
1840 "If an interface has no ServiceName, then one must be provided.");
1841 }
1842 s.connectToService(url, p, name);
1843 return p;
1844 }
1845 void show(KeyboardClientInterface client, KeyboardType type);
1798 void showByRequest(); 1846 void showByRequest();
1799 void hide(); 1847 void hide();
1800 void setText(String text); 1848 void setText(String text);
1801 void setSelection(int start, int end); 1849 void setSelection(int start, int end);
1802 } 1850 }
1803 1851
1852 abstract class KeyboardServiceInterface
1853 implements bindings.MojoInterface<KeyboardService>,
1854 KeyboardService {
1855 factory KeyboardServiceInterface([KeyboardService impl]) =>
1856 new KeyboardServiceStub.unbound(impl);
1857 factory KeyboardServiceInterface.fromEndpoint(
1858 core.MojoMessagePipeEndpoint endpoint,
1859 [KeyboardService impl]) =>
1860 new KeyboardServiceStub.fromEndpoint(endpoint, impl);
1861 }
1862
1863 abstract class KeyboardServiceInterfaceRequest
1864 implements bindings.MojoInterface<KeyboardService>,
1865 KeyboardService {
1866 factory KeyboardServiceInterfaceRequest() =>
1867 new KeyboardServiceProxy.unbound();
1868 }
1869
1804 class _KeyboardServiceProxyControl 1870 class _KeyboardServiceProxyControl
1805 extends bindings.ProxyMessageHandler 1871 extends bindings.ProxyMessageHandler
1806 implements bindings.ProxyControl { 1872 implements bindings.ProxyControl<KeyboardService> {
1807 _KeyboardServiceProxyControl.fromEndpoint( 1873 _KeyboardServiceProxyControl.fromEndpoint(
1808 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 1874 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
1809 1875
1810 _KeyboardServiceProxyControl.fromHandle( 1876 _KeyboardServiceProxyControl.fromHandle(
1811 core.MojoHandle handle) : super.fromHandle(handle); 1877 core.MojoHandle handle) : super.fromHandle(handle);
1812 1878
1813 _KeyboardServiceProxyControl.unbound() : super.unbound(); 1879 _KeyboardServiceProxyControl.unbound() : super.unbound();
1814 1880
1815 service_describer.ServiceDescription get serviceDescription =>
1816 new _KeyboardServiceServiceDescription();
1817
1818 String get serviceName => KeyboardService.serviceName; 1881 String get serviceName => KeyboardService.serviceName;
1819 1882
1820 void handleResponse(bindings.ServiceMessage message) { 1883 void handleResponse(bindings.ServiceMessage message) {
1821 switch (message.header.type) { 1884 switch (message.header.type) {
1822 default: 1885 default:
1823 proxyError("Unexpected message type: ${message.header.type}"); 1886 proxyError("Unexpected message type: ${message.header.type}");
1824 close(immediate: true); 1887 close(immediate: true);
1825 break; 1888 break;
1826 } 1889 }
1827 } 1890 }
1828 1891
1892 KeyboardService get impl => null;
1893 set impl(KeyboardService _) {
1894 throw new core.MojoApiError("The impl of a Proxy cannot be set.");
1895 }
1896
1829 @override 1897 @override
1830 String toString() { 1898 String toString() {
1831 var superString = super.toString(); 1899 var superString = super.toString();
1832 return "_KeyboardServiceProxyControl($superString)"; 1900 return "_KeyboardServiceProxyControl($superString)";
1833 } 1901 }
1834 } 1902 }
1835 1903
1836 class KeyboardServiceProxy 1904 class KeyboardServiceProxy
1837 extends bindings.Proxy 1905 extends bindings.Proxy<KeyboardService>
1838 implements KeyboardService { 1906 implements KeyboardService,
1907 KeyboardServiceInterface,
1908 KeyboardServiceInterfaceRequest {
1839 KeyboardServiceProxy.fromEndpoint( 1909 KeyboardServiceProxy.fromEndpoint(
1840 core.MojoMessagePipeEndpoint endpoint) 1910 core.MojoMessagePipeEndpoint endpoint)
1841 : super(new _KeyboardServiceProxyControl.fromEndpoint(endpoint)); 1911 : super(new _KeyboardServiceProxyControl.fromEndpoint(endpoint));
1842 1912
1843 KeyboardServiceProxy.fromHandle(core.MojoHandle handle) 1913 KeyboardServiceProxy.fromHandle(core.MojoHandle handle)
1844 : super(new _KeyboardServiceProxyControl.fromHandle(handle)); 1914 : super(new _KeyboardServiceProxyControl.fromHandle(handle));
1845 1915
1846 KeyboardServiceProxy.unbound() 1916 KeyboardServiceProxy.unbound()
1847 : super(new _KeyboardServiceProxyControl.unbound()); 1917 : super(new _KeyboardServiceProxyControl.unbound());
1848 1918
1849 static KeyboardServiceProxy newFromEndpoint( 1919 static KeyboardServiceProxy newFromEndpoint(
1850 core.MojoMessagePipeEndpoint endpoint) { 1920 core.MojoMessagePipeEndpoint endpoint) {
1851 assert(endpoint.setDescription("For KeyboardServiceProxy")); 1921 assert(endpoint.setDescription("For KeyboardServiceProxy"));
1852 return new KeyboardServiceProxy.fromEndpoint(endpoint); 1922 return new KeyboardServiceProxy.fromEndpoint(endpoint);
1853 } 1923 }
1854 1924
1855 factory KeyboardServiceProxy.connectToService(
1856 bindings.ServiceConnector s, String url, [String serviceName]) {
1857 KeyboardServiceProxy p = new KeyboardServiceProxy.unbound();
1858 s.connectToService(url, p, serviceName);
1859 return p;
1860 }
1861 1925
1862 1926 void show(KeyboardClientInterface client, KeyboardType type) {
1863 void show(Object client, KeyboardType type) {
1864 if (!ctrl.isBound) { 1927 if (!ctrl.isBound) {
1865 ctrl.proxyError("The Proxy is closed."); 1928 ctrl.proxyError("The Proxy is closed.");
1866 return; 1929 return;
1867 } 1930 }
1868 var params = new _KeyboardServiceShowParams(); 1931 var params = new _KeyboardServiceShowParams();
1869 params.client = client; 1932 params.client = client;
1870 params.type = type; 1933 params.type = type;
1871 ctrl.sendMessage(params, 1934 ctrl.sendMessage(params,
1872 _keyboardServiceMethodShowName); 1935 _keyboardServiceMethodShowName);
1873 } 1936 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1924 } 1987 }
1925 1988
1926 _KeyboardServiceStubControl.fromHandle( 1989 _KeyboardServiceStubControl.fromHandle(
1927 core.MojoHandle handle, [KeyboardService impl]) 1990 core.MojoHandle handle, [KeyboardService impl])
1928 : super.fromHandle(handle, autoBegin: impl != null) { 1991 : super.fromHandle(handle, autoBegin: impl != null) {
1929 _impl = impl; 1992 _impl = impl;
1930 } 1993 }
1931 1994
1932 _KeyboardServiceStubControl.unbound([this._impl]) : super.unbound(); 1995 _KeyboardServiceStubControl.unbound([this._impl]) : super.unbound();
1933 1996
1997 String get serviceName => KeyboardService.serviceName;
1998
1934 1999
1935 2000
1936 dynamic handleMessage(bindings.ServiceMessage message) { 2001 dynamic handleMessage(bindings.ServiceMessage message) {
1937 if (bindings.ControlMessageHandler.isControlMessage(message)) { 2002 if (bindings.ControlMessageHandler.isControlMessage(message)) {
1938 return bindings.ControlMessageHandler.handleMessage(this, 2003 return bindings.ControlMessageHandler.handleMessage(this,
1939 0, 2004 0,
1940 message); 2005 message);
1941 } 2006 }
1942 if (_impl == null) { 2007 if (_impl == null) {
1943 throw new core.MojoApiError("$this has no implementation set"); 2008 throw new core.MojoApiError("$this has no implementation set");
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 } 2055 }
1991 } 2056 }
1992 2057
1993 @override 2058 @override
1994 String toString() { 2059 String toString() {
1995 var superString = super.toString(); 2060 var superString = super.toString();
1996 return "_KeyboardServiceStubControl($superString)"; 2061 return "_KeyboardServiceStubControl($superString)";
1997 } 2062 }
1998 2063
1999 int get version => 0; 2064 int get version => 0;
2000
2001 static service_describer.ServiceDescription _cachedServiceDescription;
2002 static service_describer.ServiceDescription get serviceDescription {
2003 if (_cachedServiceDescription == null) {
2004 _cachedServiceDescription = new _KeyboardServiceServiceDescription();
2005 }
2006 return _cachedServiceDescription;
2007 }
2008 } 2065 }
2009 2066
2010 class KeyboardServiceStub 2067 class KeyboardServiceStub
2011 extends bindings.Stub<KeyboardService> 2068 extends bindings.Stub<KeyboardService>
2012 implements KeyboardService { 2069 implements KeyboardService,
2070 KeyboardServiceInterface,
2071 KeyboardServiceInterfaceRequest {
2072 KeyboardServiceStub.unbound([KeyboardService impl])
2073 : super(new _KeyboardServiceStubControl.unbound(impl));
2074
2013 KeyboardServiceStub.fromEndpoint( 2075 KeyboardServiceStub.fromEndpoint(
2014 core.MojoMessagePipeEndpoint endpoint, [KeyboardService impl]) 2076 core.MojoMessagePipeEndpoint endpoint, [KeyboardService impl])
2015 : super(new _KeyboardServiceStubControl.fromEndpoint(endpoint, impl)); 2077 : super(new _KeyboardServiceStubControl.fromEndpoint(endpoint, impl));
2016 2078
2017 KeyboardServiceStub.fromHandle( 2079 KeyboardServiceStub.fromHandle(
2018 core.MojoHandle handle, [KeyboardService impl]) 2080 core.MojoHandle handle, [KeyboardService impl])
2019 : super(new _KeyboardServiceStubControl.fromHandle(handle, impl)); 2081 : super(new _KeyboardServiceStubControl.fromHandle(handle, impl));
2020 2082
2021 KeyboardServiceStub.unbound([KeyboardService impl])
2022 : super(new _KeyboardServiceStubControl.unbound(impl));
2023
2024 static KeyboardServiceStub newFromEndpoint( 2083 static KeyboardServiceStub newFromEndpoint(
2025 core.MojoMessagePipeEndpoint endpoint) { 2084 core.MojoMessagePipeEndpoint endpoint) {
2026 assert(endpoint.setDescription("For KeyboardServiceStub")); 2085 assert(endpoint.setDescription("For KeyboardServiceStub"));
2027 return new KeyboardServiceStub.fromEndpoint(endpoint); 2086 return new KeyboardServiceStub.fromEndpoint(endpoint);
2028 } 2087 }
2029 2088
2030 static service_describer.ServiceDescription get serviceDescription =>
2031 _KeyboardServiceStubControl.serviceDescription;
2032 2089
2033 2090 void show(KeyboardClientInterface client, KeyboardType type) {
2034 void show(Object client, KeyboardType type) {
2035 return impl.show(client, type); 2091 return impl.show(client, type);
2036 } 2092 }
2037 void showByRequest() { 2093 void showByRequest() {
2038 return impl.showByRequest(); 2094 return impl.showByRequest();
2039 } 2095 }
2040 void hide() { 2096 void hide() {
2041 return impl.hide(); 2097 return impl.hide();
2042 } 2098 }
2043 void setText(String text) { 2099 void setText(String text) {
2044 return impl.setText(text); 2100 return impl.setText(text);
(...skipping 11 matching lines...) Expand all
2056 2112
2057 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 2113 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
2058 responseFactory(null); 2114 responseFactory(null);
2059 2115
2060 dynamic getAllTypeDefinitions([Function responseFactory]) => 2116 dynamic getAllTypeDefinitions([Function responseFactory]) =>
2061 responseFactory(null); 2117 responseFactory(null);
2062 } 2118 }
2063 2119
2064 abstract class KeyboardServiceFactory { 2120 abstract class KeyboardServiceFactory {
2065 static const String serviceName = "keyboard::KeyboardServiceFactory"; 2121 static const String serviceName = "keyboard::KeyboardServiceFactory";
2066 void createKeyboardService(Object keyEventDispatcher, Object serviceRequest); 2122
2123 static service_describer.ServiceDescription _cachedServiceDescription;
2124 static service_describer.ServiceDescription get serviceDescription {
2125 if (_cachedServiceDescription == null) {
2126 _cachedServiceDescription = new _KeyboardServiceFactoryServiceDescription( );
2127 }
2128 return _cachedServiceDescription;
2129 }
2130
2131 static KeyboardServiceFactoryProxy connectToService(
2132 bindings.ServiceConnector s, String url, [String serviceName]) {
2133 KeyboardServiceFactoryProxy p = new KeyboardServiceFactoryProxy.unbound();
2134 String name = serviceName ?? KeyboardServiceFactory.serviceName;
2135 if ((name == null) || name.isEmpty) {
2136 throw new core.MojoApiError(
2137 "If an interface has no ServiceName, then one must be provided.");
2138 }
2139 s.connectToService(url, p, name);
2140 return p;
2141 }
2142 void createKeyboardService(native_viewport_event_dispatcher_mojom.NativeViewpo rtEventDispatcherInterfaceRequest keyEventDispatcher, KeyboardServiceInterfaceRe quest serviceRequest);
2143 }
2144
2145 abstract class KeyboardServiceFactoryInterface
2146 implements bindings.MojoInterface<KeyboardServiceFactory>,
2147 KeyboardServiceFactory {
2148 factory KeyboardServiceFactoryInterface([KeyboardServiceFactory impl]) =>
2149 new KeyboardServiceFactoryStub.unbound(impl);
2150 factory KeyboardServiceFactoryInterface.fromEndpoint(
2151 core.MojoMessagePipeEndpoint endpoint,
2152 [KeyboardServiceFactory impl]) =>
2153 new KeyboardServiceFactoryStub.fromEndpoint(endpoint, impl);
2154 }
2155
2156 abstract class KeyboardServiceFactoryInterfaceRequest
2157 implements bindings.MojoInterface<KeyboardServiceFactory>,
2158 KeyboardServiceFactory {
2159 factory KeyboardServiceFactoryInterfaceRequest() =>
2160 new KeyboardServiceFactoryProxy.unbound();
2067 } 2161 }
2068 2162
2069 class _KeyboardServiceFactoryProxyControl 2163 class _KeyboardServiceFactoryProxyControl
2070 extends bindings.ProxyMessageHandler 2164 extends bindings.ProxyMessageHandler
2071 implements bindings.ProxyControl { 2165 implements bindings.ProxyControl<KeyboardServiceFactory> {
2072 _KeyboardServiceFactoryProxyControl.fromEndpoint( 2166 _KeyboardServiceFactoryProxyControl.fromEndpoint(
2073 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 2167 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
2074 2168
2075 _KeyboardServiceFactoryProxyControl.fromHandle( 2169 _KeyboardServiceFactoryProxyControl.fromHandle(
2076 core.MojoHandle handle) : super.fromHandle(handle); 2170 core.MojoHandle handle) : super.fromHandle(handle);
2077 2171
2078 _KeyboardServiceFactoryProxyControl.unbound() : super.unbound(); 2172 _KeyboardServiceFactoryProxyControl.unbound() : super.unbound();
2079 2173
2080 service_describer.ServiceDescription get serviceDescription =>
2081 new _KeyboardServiceFactoryServiceDescription();
2082
2083 String get serviceName => KeyboardServiceFactory.serviceName; 2174 String get serviceName => KeyboardServiceFactory.serviceName;
2084 2175
2085 void handleResponse(bindings.ServiceMessage message) { 2176 void handleResponse(bindings.ServiceMessage message) {
2086 switch (message.header.type) { 2177 switch (message.header.type) {
2087 default: 2178 default:
2088 proxyError("Unexpected message type: ${message.header.type}"); 2179 proxyError("Unexpected message type: ${message.header.type}");
2089 close(immediate: true); 2180 close(immediate: true);
2090 break; 2181 break;
2091 } 2182 }
2092 } 2183 }
2093 2184
2185 KeyboardServiceFactory get impl => null;
2186 set impl(KeyboardServiceFactory _) {
2187 throw new core.MojoApiError("The impl of a Proxy cannot be set.");
2188 }
2189
2094 @override 2190 @override
2095 String toString() { 2191 String toString() {
2096 var superString = super.toString(); 2192 var superString = super.toString();
2097 return "_KeyboardServiceFactoryProxyControl($superString)"; 2193 return "_KeyboardServiceFactoryProxyControl($superString)";
2098 } 2194 }
2099 } 2195 }
2100 2196
2101 class KeyboardServiceFactoryProxy 2197 class KeyboardServiceFactoryProxy
2102 extends bindings.Proxy 2198 extends bindings.Proxy<KeyboardServiceFactory>
2103 implements KeyboardServiceFactory { 2199 implements KeyboardServiceFactory,
2200 KeyboardServiceFactoryInterface,
2201 KeyboardServiceFactoryInterfaceRequest {
2104 KeyboardServiceFactoryProxy.fromEndpoint( 2202 KeyboardServiceFactoryProxy.fromEndpoint(
2105 core.MojoMessagePipeEndpoint endpoint) 2203 core.MojoMessagePipeEndpoint endpoint)
2106 : super(new _KeyboardServiceFactoryProxyControl.fromEndpoint(endpoint)); 2204 : super(new _KeyboardServiceFactoryProxyControl.fromEndpoint(endpoint));
2107 2205
2108 KeyboardServiceFactoryProxy.fromHandle(core.MojoHandle handle) 2206 KeyboardServiceFactoryProxy.fromHandle(core.MojoHandle handle)
2109 : super(new _KeyboardServiceFactoryProxyControl.fromHandle(handle)); 2207 : super(new _KeyboardServiceFactoryProxyControl.fromHandle(handle));
2110 2208
2111 KeyboardServiceFactoryProxy.unbound() 2209 KeyboardServiceFactoryProxy.unbound()
2112 : super(new _KeyboardServiceFactoryProxyControl.unbound()); 2210 : super(new _KeyboardServiceFactoryProxyControl.unbound());
2113 2211
2114 static KeyboardServiceFactoryProxy newFromEndpoint( 2212 static KeyboardServiceFactoryProxy newFromEndpoint(
2115 core.MojoMessagePipeEndpoint endpoint) { 2213 core.MojoMessagePipeEndpoint endpoint) {
2116 assert(endpoint.setDescription("For KeyboardServiceFactoryProxy")); 2214 assert(endpoint.setDescription("For KeyboardServiceFactoryProxy"));
2117 return new KeyboardServiceFactoryProxy.fromEndpoint(endpoint); 2215 return new KeyboardServiceFactoryProxy.fromEndpoint(endpoint);
2118 } 2216 }
2119 2217
2120 factory KeyboardServiceFactoryProxy.connectToService(
2121 bindings.ServiceConnector s, String url, [String serviceName]) {
2122 KeyboardServiceFactoryProxy p = new KeyboardServiceFactoryProxy.unbound();
2123 s.connectToService(url, p, serviceName);
2124 return p;
2125 }
2126 2218
2127 2219 void createKeyboardService(native_viewport_event_dispatcher_mojom.NativeViewpo rtEventDispatcherInterfaceRequest keyEventDispatcher, KeyboardServiceInterfaceRe quest serviceRequest) {
2128 void createKeyboardService(Object keyEventDispatcher, Object serviceRequest) {
2129 if (!ctrl.isBound) { 2220 if (!ctrl.isBound) {
2130 ctrl.proxyError("The Proxy is closed."); 2221 ctrl.proxyError("The Proxy is closed.");
2131 return; 2222 return;
2132 } 2223 }
2133 var params = new _KeyboardServiceFactoryCreateKeyboardServiceParams(); 2224 var params = new _KeyboardServiceFactoryCreateKeyboardServiceParams();
2134 params.keyEventDispatcher = keyEventDispatcher; 2225 params.keyEventDispatcher = keyEventDispatcher;
2135 params.serviceRequest = serviceRequest; 2226 params.serviceRequest = serviceRequest;
2136 ctrl.sendMessage(params, 2227 ctrl.sendMessage(params,
2137 _keyboardServiceFactoryMethodCreateKeyboardServiceName); 2228 _keyboardServiceFactoryMethodCreateKeyboardServiceName);
2138 } 2229 }
(...skipping 11 matching lines...) Expand all
2150 } 2241 }
2151 2242
2152 _KeyboardServiceFactoryStubControl.fromHandle( 2243 _KeyboardServiceFactoryStubControl.fromHandle(
2153 core.MojoHandle handle, [KeyboardServiceFactory impl]) 2244 core.MojoHandle handle, [KeyboardServiceFactory impl])
2154 : super.fromHandle(handle, autoBegin: impl != null) { 2245 : super.fromHandle(handle, autoBegin: impl != null) {
2155 _impl = impl; 2246 _impl = impl;
2156 } 2247 }
2157 2248
2158 _KeyboardServiceFactoryStubControl.unbound([this._impl]) : super.unbound(); 2249 _KeyboardServiceFactoryStubControl.unbound([this._impl]) : super.unbound();
2159 2250
2251 String get serviceName => KeyboardServiceFactory.serviceName;
2252
2160 2253
2161 2254
2162 dynamic handleMessage(bindings.ServiceMessage message) { 2255 dynamic handleMessage(bindings.ServiceMessage message) {
2163 if (bindings.ControlMessageHandler.isControlMessage(message)) { 2256 if (bindings.ControlMessageHandler.isControlMessage(message)) {
2164 return bindings.ControlMessageHandler.handleMessage(this, 2257 return bindings.ControlMessageHandler.handleMessage(this,
2165 0, 2258 0,
2166 message); 2259 message);
2167 } 2260 }
2168 if (_impl == null) { 2261 if (_impl == null) {
2169 throw new core.MojoApiError("$this has no implementation set"); 2262 throw new core.MojoApiError("$this has no implementation set");
(...skipping 30 matching lines...) Expand all
2200 } 2293 }
2201 } 2294 }
2202 2295
2203 @override 2296 @override
2204 String toString() { 2297 String toString() {
2205 var superString = super.toString(); 2298 var superString = super.toString();
2206 return "_KeyboardServiceFactoryStubControl($superString)"; 2299 return "_KeyboardServiceFactoryStubControl($superString)";
2207 } 2300 }
2208 2301
2209 int get version => 0; 2302 int get version => 0;
2210
2211 static service_describer.ServiceDescription _cachedServiceDescription;
2212 static service_describer.ServiceDescription get serviceDescription {
2213 if (_cachedServiceDescription == null) {
2214 _cachedServiceDescription = new _KeyboardServiceFactoryServiceDescription( );
2215 }
2216 return _cachedServiceDescription;
2217 }
2218 } 2303 }
2219 2304
2220 class KeyboardServiceFactoryStub 2305 class KeyboardServiceFactoryStub
2221 extends bindings.Stub<KeyboardServiceFactory> 2306 extends bindings.Stub<KeyboardServiceFactory>
2222 implements KeyboardServiceFactory { 2307 implements KeyboardServiceFactory,
2308 KeyboardServiceFactoryInterface,
2309 KeyboardServiceFactoryInterfaceRequest {
2310 KeyboardServiceFactoryStub.unbound([KeyboardServiceFactory impl])
2311 : super(new _KeyboardServiceFactoryStubControl.unbound(impl));
2312
2223 KeyboardServiceFactoryStub.fromEndpoint( 2313 KeyboardServiceFactoryStub.fromEndpoint(
2224 core.MojoMessagePipeEndpoint endpoint, [KeyboardServiceFactory impl]) 2314 core.MojoMessagePipeEndpoint endpoint, [KeyboardServiceFactory impl])
2225 : super(new _KeyboardServiceFactoryStubControl.fromEndpoint(endpoint, impl )); 2315 : super(new _KeyboardServiceFactoryStubControl.fromEndpoint(endpoint, impl ));
2226 2316
2227 KeyboardServiceFactoryStub.fromHandle( 2317 KeyboardServiceFactoryStub.fromHandle(
2228 core.MojoHandle handle, [KeyboardServiceFactory impl]) 2318 core.MojoHandle handle, [KeyboardServiceFactory impl])
2229 : super(new _KeyboardServiceFactoryStubControl.fromHandle(handle, impl)); 2319 : super(new _KeyboardServiceFactoryStubControl.fromHandle(handle, impl));
2230 2320
2231 KeyboardServiceFactoryStub.unbound([KeyboardServiceFactory impl])
2232 : super(new _KeyboardServiceFactoryStubControl.unbound(impl));
2233
2234 static KeyboardServiceFactoryStub newFromEndpoint( 2321 static KeyboardServiceFactoryStub newFromEndpoint(
2235 core.MojoMessagePipeEndpoint endpoint) { 2322 core.MojoMessagePipeEndpoint endpoint) {
2236 assert(endpoint.setDescription("For KeyboardServiceFactoryStub")); 2323 assert(endpoint.setDescription("For KeyboardServiceFactoryStub"));
2237 return new KeyboardServiceFactoryStub.fromEndpoint(endpoint); 2324 return new KeyboardServiceFactoryStub.fromEndpoint(endpoint);
2238 } 2325 }
2239 2326
2240 static service_describer.ServiceDescription get serviceDescription =>
2241 _KeyboardServiceFactoryStubControl.serviceDescription;
2242 2327
2243 2328 void createKeyboardService(native_viewport_event_dispatcher_mojom.NativeViewpo rtEventDispatcherInterfaceRequest keyEventDispatcher, KeyboardServiceInterfaceRe quest serviceRequest) {
2244 void createKeyboardService(Object keyEventDispatcher, Object serviceRequest) {
2245 return impl.createKeyboardService(keyEventDispatcher, serviceRequest); 2329 return impl.createKeyboardService(keyEventDispatcher, serviceRequest);
2246 } 2330 }
2247 } 2331 }
2248 2332
2249 2333
2250 2334
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698