OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 module mus.mojom; |
| 6 |
| 7 interface Clipboard { |
| 8 enum Type { |
| 9 COPY_PASTE = 0, |
| 10 SELECTION = 1, |
| 11 DRAG = 2 |
| 12 }; |
| 13 |
| 14 // Mime type constants |
| 15 const string MIME_TYPE_TEXT = "text/plain"; |
| 16 const string MIME_TYPE_HTML = "text/html"; |
| 17 const string MIME_TYPE_URL = "text/url"; |
| 18 |
| 19 // Returns a sequence number which uniquely identifies clipboard state. |
| 20 // Clients are able to assume that the clipboard contents are unchanged as |
| 21 // long as this number has not changed. This number is monotonically |
| 22 // increasing, is increased when the clipboard state changes, and is |
| 23 // provided by Windows, Linux, and Mac. |
| 24 [Sync] |
| 25 GetSequenceNumber(Type clipboard_type) => (uint64 sequence); |
| 26 |
| 27 // Returns the available mime types, and the current sequence number. |
| 28 [Sync] |
| 29 GetAvailableMimeTypes(Type clipboard_types) |
| 30 => (uint64 sequence, array<string> types); |
| 31 |
| 32 // If the current sequence number is still |sequence|, returns true and the |
| 33 // current data associated with the requested Mime type. When the sequence |
| 34 // number has changed (because new data has been written to the clipboard), |
| 35 // returns false and null for |data|. |
| 36 // |
| 37 // We don't want to provide one API to return the entire clipboard state |
| 38 // because the combined size of the clipboard can be megabytes, especially |
| 39 // when image data is involved. |
| 40 [Sync] |
| 41 ReadMimeType(uint64 sequence, Type clipboard_type, string mime_type) |
| 42 => (bool sequence_valid, array<uint8>? data); |
| 43 |
| 44 // Writes a set of mime types to the clipboard. This will increment the |
| 45 // sequence number and return that. In the case of an empty or null map, |
| 46 // this will just clear the clipboard. |
| 47 [Sync] |
| 48 WriteClipboardData(Type clipboard_type, map<string, array<uint8>>? data) |
| 49 => (uint64 sequence); |
| 50 }; |
OLD | NEW |