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

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: Rebase to ToT to fix patch apply. 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 // A wrapper type which is just a Key/Value pair. Workaround until we get
8 // proper maps in mojom.
9 struct MimeTypePair {
10 string mime_type;
11 string data;
sky 2014/09/15 15:28:20 Is there a reason you want a string here rather th
12 };
13
14 interface Clipboard {
15 enum Type {
16 COPY_PASTE,
17 SELECTION,
18 DRAG
19 };
20
21 // Mime type constants
22 const string MIME_TYPE_TEXT = "text/plain";
23 const string MIME_TYPE_HTML = "text/html";
24 const string MIME_TYPE_URL = "text/url";
25
26 // Returns a sequence number which uniquely identifies clipboard state. This
27 // number is monotonically increasing, is increased when the clipboard state
28 // 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
29 GetSequenceNumber(Type clipboard_type) => (uint64 sequence);
30
31 // Returns the available mime types. (Note: the chrome interface has a
32 // |contains_filenames| parameter here, but it appears to always be set
33 // to false.)
34 GetAvailableFormatMimeTypes(Type clipboard_types) => (string[] types);
sky 2014/09/15 15:28:20 What does 'format' mean here? How about GetAvailab
35
36 // Returns the data associated with a MIME type, returning NULL if that data
37 // doesn't exist. Note: because of the inherit raciness of clipboard access,
38 // this may return NULL even if you just verified that it exists with
39 // GetAvailableFormatMimeTypes(). We don't want to provide one API to return
40 // the entire clipboard state because the combined size of the clipboard can
41 // be megabytes, especially when image data is involved.
42 ReadMIMEType(Type clipboard_type, string mime_type) => (string? data);
sky 2014/09/15 15:28:20 ReadMimeType (you use Mime above, not MIME).
43
44 // Writes a set of mime types to the clipboard. This will increment the
45 // sequence number.
46 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
47 };
48
49 } // 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