OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 [DartPackage="mojo_services"] | |
6 module mojo; | |
7 | |
8 interface Clipboard { | |
9 enum Type { | |
10 COPY_PASTE = 0, | |
11 SELECTION = 1, | |
12 DRAG = 2 | |
13 }; | |
14 | |
15 // Mime type constants | |
16 const string MIME_TYPE_TEXT = "text/plain"; | |
17 const string MIME_TYPE_HTML = "text/html"; | |
18 const string MIME_TYPE_URL = "text/url"; | |
19 | |
20 // Returns a sequence number which uniquely identifies clipboard state. | |
21 // Clients are able to assume that the clipboard contents are unchanged as | |
22 // long as this number has not changed. This number is monotonically | |
23 // increasing, is increased when the clipboard state changes, and is | |
24 // provided by Windows, Linux, and Mac. | |
25 GetSequenceNumber(Type clipboard_type) => (uint64 sequence); | |
26 | |
27 // Returns the available mime types. (Note: the chrome interface has a | |
28 // |contains_filenames| parameter here, but it appears to always be set | |
29 // to false.) | |
30 GetAvailableMimeTypes(Type clipboard_types) => (array<string> types); | |
31 | |
32 // Returns the data associated with a Mime type, returning NULL if that data | |
33 // doesn't exist. Note: because of the inherit raciness of clipboard access, | |
34 // this may return NULL even if you just verified that it exists with | |
35 // GetAvailableFormatMimeTypes(). We don't want to provide one API to return | |
36 // the entire clipboard state because the combined size of the clipboard can | |
37 // be megabytes, especially when image data is involved. | |
38 ReadMimeType(Type clipboard_type, string mime_type) => (array<uint8>? data); | |
39 | |
40 // Writes a set of mime types to the clipboard. This will increment the | |
41 // sequence number. In the case of an empty or null map, this will just | |
42 // clear the clipboard. | |
43 WriteClipboardData(Type clipboard_type, map<string, array<uint8>>? data); | |
44 }; | |
OLD | NEW |