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

Unified Diff: mojo/services/public/interfaces/clipboard/clipboard.mojom

Issue 562483002: mojo: Create a basic clipboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes to the gn files. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/public/interfaces/clipboard/BUILD.gn ('k') | testing/buildbot/chromium.fyi.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c1e1be4ee09f79244c36d7437d4d918d3e1958c8
--- /dev/null
+++ b/mojo/services/public/interfaces/clipboard/clipboard.mojom
@@ -0,0 +1,52 @@
+// 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;
+ uint8[] data;
+};
+
+interface Clipboard {
+ enum Type {
+ COPY_PASTE = 0,
+ SELECTION = 1,
+ DRAG = 2
+ };
+
+ // 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.
+ // Clients are able to assume that the clipboard contents are unchanged as
+ // long as this number has not changed. This number is monotonically
+ // increasing, is increased when the clipboard state changes, and is
+ // provided by Windows, Linux, and Mac.
+ 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.)
+ GetAvailableMimeTypes(Type clipboard_types) => (string[] types);
+
+ // 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) => (uint8[]? data);
+
+ // Writes a set of mime types to the clipboard. This will increment the
+ // sequence number. In the case of an empty or NULL list, this will just
+ // clear the clipboard.
+ WriteClipboardData(Type clipboard_type, MimeTypePair[]? data);
+};
+
+} // module mojo
« no previous file with comments | « mojo/services/public/interfaces/clipboard/BUILD.gn ('k') | testing/buildbot/chromium.fyi.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698