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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 module mojo {
6
7 interface Clipboard {
8 enum Type {
9 COPY_PASTE,
10 SELECTION,
11 DRAG
12 };
13
14 // Mime type constants
15 const string MIME_TYPE_TEXT = "text/plain";
16 const string MIME_TYPE_HTML = "text/html";
17
18 // Returns a sequence number which uniquely identifies clipboard state. This
19 // number is monotonically increasing, is increased when the clipboard state
20 // 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
21 GetSequenceNumber(Type clipboard_type) => (uint64 sequence);
22
23 // Returns the available mime types. (Note: the chrome interface has a
24 // |contains_filenames| parameter here, but it appears to always be set
25 // to false.)
26 GetAvailableFormatMimeTypes(Type clipboard_types) => (string[] types);
27
28 ReadPlainText(Type clipboard_type) => (string text);
sky 2014/09/11 22:11:43 Seems like the return type should be nullable. In
29 ReadHTML(Type clipboard_type) =>
sky 2014/09/11 22:11:43 Can html and plain text be expressed as a mime typ
30 (string html, string url, uint32 fragment_start, uint32 fragment_end);
31 ReadMIMEType(Type clipboard_type, string mime_type) => (string data);
32 // TODO: We probably want an image type.
33
34 // Clipboard Writing
35 //
36 // Clipboard writing is a two phase operation, where a client queues all data
37 // types that they want written to the clipboard, and then writes all queued
38 // data in one pass. We do this to prevent racing with other applications on
39 // the system.
40
41 // Queue writing individual datatypes to specific clipboards.
42 QueueWritePlainText(Type clipboard_type, string text);
sky 2014/09/11 22:11:43 Two staged commit seems best done in the client. C
43 QueueWriteHTML(Type clipboard_type, string html_text, string url);
44 QueueWriteMIMEType(Type clipboard_type, string mime_type, string data);
45 // TODO: We probably want an image type.
46
47 // Writes all queued data types in one pass.
48 WriteQueuedData(Type clipboard_type);
49 };
50
51 } // module mojo
OLDNEW
« 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