// 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. 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 MinVersion: 1 // Next ID: 2 union ClipValue { // For images and other opaque structures. array blob@0; // For html, text and other text-based representations. string text@1; }; // One possible representation of the |ClipData|: |mime_type| + its |value|. // Next MinVersion: 1 // Next ID: 2 struct ClipRepresentation { // The mime type. string mime_type@0; // And its value. ClipValue value@1; }; // The |ClipData| to transfer. // Next MinVersion: 1 // 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 representations@0; }; // Next MinVersion: 2 // 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 MinVersion: 2 // Next method ID: 3 // IDs to be removed 18 weeks after being up revved: 1 interface ClipboardInstance { // Establishes full-duplex communication with the host. Init@0(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(); };