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 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
6 module mojo; | 6 module mojo; |
7 | 7 |
8 [ServiceName="mojo::Clipboard"] | 8 [ServiceName="mojo::Clipboard"] |
9 interface Clipboard { | 9 interface Clipboard { |
10 enum Type { | 10 enum Type { |
11 COPY_PASTE = 0, | 11 COPY_PASTE = 0, |
12 SELECTION = 1, | 12 SELECTION = 1, |
13 DRAG = 2 | 13 DRAG = 2, |
14 }; | 14 }; |
15 | 15 |
16 // Mime type constants | 16 // Mime type constants |
17 const string MIME_TYPE_TEXT = "text/plain"; | 17 const string MIME_TYPE_TEXT = "text/plain"; |
18 const string MIME_TYPE_HTML = "text/html"; | 18 const string MIME_TYPE_HTML = "text/html"; |
19 const string MIME_TYPE_URL = "text/url"; | 19 const string MIME_TYPE_URL = "text/url"; |
20 | 20 |
21 // Returns a sequence number which uniquely identifies clipboard state. | 21 // Returns a sequence number which uniquely identifies clipboard state. |
22 // Clients are able to assume that the clipboard contents are unchanged as | 22 // Clients are able to assume that the clipboard contents are unchanged as |
23 // long as this number has not changed. This number is monotonically | 23 // long as this number has not changed. This number is monotonically |
(...skipping 12 matching lines...) Expand all Loading... |
36 // GetAvailableFormatMimeTypes(). We don't want to provide one API to return | 36 // GetAvailableFormatMimeTypes(). We don't want to provide one API to return |
37 // the entire clipboard state because the combined size of the clipboard can | 37 // the entire clipboard state because the combined size of the clipboard can |
38 // be megabytes, especially when image data is involved. | 38 // be megabytes, especially when image data is involved. |
39 ReadMimeType(Type clipboard_type, string mime_type) => (array<uint8>? data); | 39 ReadMimeType(Type clipboard_type, string mime_type) => (array<uint8>? data); |
40 | 40 |
41 // Writes a set of mime types to the clipboard. This will increment the | 41 // Writes a set of mime types to the clipboard. This will increment the |
42 // sequence number. In the case of an empty or null map, this will just | 42 // sequence number. In the case of an empty or null map, this will just |
43 // clear the clipboard. | 43 // clear the clipboard. |
44 WriteClipboardData(Type clipboard_type, map<string, array<uint8>>? data); | 44 WriteClipboardData(Type clipboard_type, map<string, array<uint8>>? data); |
45 }; | 45 }; |
OLD | NEW |