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

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: Fixes for sky; commenting. 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..f9c163516f8be57d5eb85e1f00e783ee32564691
--- /dev/null
+++ b/mojo/services/public/interfaces/clipboard/clipboard.mojom
@@ -0,0 +1,51 @@
+// 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 {
+
+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";
+
+ // 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 all major operating systems (Win, Linux, Mac).
sky 2014/09/11 22:11:43 nit: no need to say provided by all major OSs here
+ 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);
+
+ ReadPlainText(Type clipboard_type) => (string text);
sky 2014/09/11 22:11:43 Seems like the return type should be nullable. In
+ ReadHTML(Type clipboard_type) =>
sky 2014/09/11 22:11:43 Can html and plain text be expressed as a mime typ
+ (string html, string url, uint32 fragment_start, uint32 fragment_end);
+ ReadMIMEType(Type clipboard_type, string mime_type) => (string data);
+ // TODO: We probably want an image type.
+
+ // Clipboard Writing
+ //
+ // Clipboard writing is a two phase operation, where a client queues all data
+ // types that they want written to the clipboard, and then writes all queued
+ // data in one pass. We do this to prevent racing with other applications on
+ // the system.
+
+ // Queue writing individual datatypes to specific clipboards.
+ QueueWritePlainText(Type clipboard_type, string text);
sky 2014/09/11 22:11:43 Two staged commit seems best done in the client. C
+ QueueWriteHTML(Type clipboard_type, string html_text, string url);
+ QueueWriteMIMEType(Type clipboard_type, string mime_type, string data);
+ // TODO: We probably want an image type.
+
+ // Writes all queued data types in one pass.
+ WriteQueuedData(Type clipboard_type);
+};
+
+} // 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