Index: mojo/services/public/interfaces/clipboard/clipboard.mojom |
diff --git a/mojo/services/public/interfaces/clipboard/clipboard.mojom b/mojo/services/public/interfaces/clipboard/clipboard.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..76eeba036c3b0db77069201ef67f411619a2a699 |
--- /dev/null |
+++ b/mojo/services/public/interfaces/clipboard/clipboard.mojom |
@@ -0,0 +1,49 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+module mojo { |
+ |
+// A wrapper type which is just a Key/Value pair. Workaround until we get |
+// proper maps in mojom. |
+struct MimeTypePair { |
+ string mime_type; |
+ string data; |
sky
2014/09/15 15:28:20
Is there a reason you want a string here rather th
|
+}; |
+ |
+interface Clipboard { |
+ enum Type { |
+ COPY_PASTE, |
+ SELECTION, |
+ DRAG |
+ }; |
+ |
+ // Mime type constants |
+ const string MIME_TYPE_TEXT = "text/plain"; |
+ const string MIME_TYPE_HTML = "text/html"; |
+ const string MIME_TYPE_URL = "text/url"; |
+ |
+ // Returns a sequence number which uniquely identifies clipboard state. This |
+ // number is monotonically increasing, is increased when the clipboard state |
+ // changes, and is provided by Windoes, Linux, and Mac. |
darin (slow to review)
2014/09/15 16:28:24
nit: Windoes -> Windows
Perhaps there should be a
|
+ GetSequenceNumber(Type clipboard_type) => (uint64 sequence); |
+ |
+ // Returns the available mime types. (Note: the chrome interface has a |
+ // |contains_filenames| parameter here, but it appears to always be set |
+ // to false.) |
+ GetAvailableFormatMimeTypes(Type clipboard_types) => (string[] types); |
sky
2014/09/15 15:28:20
What does 'format' mean here? How about GetAvailab
|
+ |
+ // Returns the data associated with a MIME type, returning NULL if that data |
+ // doesn't exist. Note: because of the inherit raciness of clipboard access, |
+ // this may return NULL even if you just verified that it exists with |
+ // GetAvailableFormatMimeTypes(). We don't want to provide one API to return |
+ // the entire clipboard state because the combined size of the clipboard can |
+ // be megabytes, especially when image data is involved. |
+ ReadMIMEType(Type clipboard_type, string mime_type) => (string? data); |
sky
2014/09/15 15:28:20
ReadMimeType (you use Mime above, not MIME).
|
+ |
+ // Writes a set of mime types to the clipboard. This will increment the |
+ // sequence number. |
+ WriteClipboardData(Type clipboard_type, MimeTypePair[] data); |
sky
2014/09/15 15:28:20
Is there ever a need to clear the clipboard? I'm s
|
+}; |
+ |
+} // module mojo |