naiveproxy/components/arc/common/clipboard.mojom
2018-01-28 13:32:06 -05:00

76 lines
2.4 KiB
Plaintext

// Copyright 2016 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.
// Next MinVersion: 3
module arc.mojom;
// |ClipData| contains one or more |ClipRepresentation| objects. Each
// |ClipRepresentation| has a |mime_type| and a |ClipValue|. |ClipValue| is
// either a |blob| or a |text|.
// Value for |ClipRepresentation|.
// Next ID: 2
union ClipValue {
// For images and other opaque structures.
array<uint8> blob@0;
// For html, text and other text-based representations.
string text@1;
};
// One possible representation of the |ClipData|: |mime_type| + its |value|.
// Next ID: 2
struct ClipRepresentation {
// The mime type.
string mime_type@0;
// And its value.
ClipValue value@1;
};
// The |ClipData| to transfer.
// Next ID: 1
struct ClipData {
// A |ClipData| could have multiple representations.
// Example: an image could be represented by an image/png and a text/html
array<ClipRepresentation> representations@0;
};
// Next method ID: 4
// IDs to be removed 18 weeks after being up revved: 0, 1
interface ClipboardHost {
// Tells the host to change its content, usually when the user initiates
// a 'copy' action.
SetTextContentDeprecated@0(string text);
// Tells the host to return its content, usually when the user initiates
// a 'paste' action or when the instance needs to re-sync its clipboard
// content with the host.
GetTextContentDeprecated@1();
// Tells the host to update its clipboard content, usually when the user
// initiates a 'copy' action.
[MinVersion=1] SetClipContent@2(ClipData data);
// Tells the host to return its clipboard content, usually when the user
// initiates a 'paste' action or when the instance needs to re-sync its
// clipboard content with the host.
[MinVersion=1] GetClipContent@3() => (ClipData data);
};
// Next method ID: 4
// IDs to be removed 18 weeks after being up revved: 1
interface ClipboardInstance {
// DEPRECATED: Please use Init@3 instead.
InitDeprecated@0(ClipboardHost host_ptr);
// Establishes full-duplex communication with the host.
[MinVersion=2] Init@3(ClipboardHost host_ptr) => ();
// Passes the result of ClipboardHost.GetTextContentDeprecated().
OnGetTextContentDeprecated@1(string returned_text);
// Tells that the Host clipboard has been updated.
[MinVersion=1] OnHostClipboardUpdated@2();
};