blob: 1fe8574ddd96ee4fe2b94dafdf0d75007a32c464 [file] [log] [blame]
// Copyright 2018 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 ui.mojom;
import "mojo/public/mojom/base/big_string.mojom";
import "mojo/public/mojom/base/string16.mojom";
import "mojo/public/mojom/base/time.mojom";
import "skia/public/interfaces/bitmap.mojom";
enum ClipboardType {
// Provides remote access to a ui::Clipboard instance.
interface ClipboardHost {
GetSequenceNumber(ClipboardType type) => (uint64 result);
IsFormatAvailable(string format, ClipboardType type) => (bool result);
Clear(ClipboardType type);
ReadAvailableTypes(ClipboardType type) =>
(array<mojo_base.mojom.String16> types, bool contains_filenames);
ReadText(ClipboardType type) => (mojo_base.mojom.BigString16 result);
ReadAsciiText(ClipboardType type) => (mojo_base.mojom.BigString result);
ReadHTML(ClipboardType type) => (mojo_base.mojom.BigString16 markup,
string src_url,
uint32 fragment_start,
uint32 fragment_end);
ReadRTF(ClipboardType type) => (string result);
ReadImage(ClipboardType type) => (skia.mojom.Bitmap? image);
ReadCustomData(ClipboardType clipboard_type, mojo_base.mojom.String16 type) =>
(mojo_base.mojom.BigString16 result);
ReadBookmark() => (mojo_base.mojom.String16 title, string url);
ReadData(string format) => (string result);
GetLastModifiedTime() => (mojo_base.mojom.Time time);
// Writing to the clipboard via IPC is a two-phase operation. First, the
// client sends all the types of data it would like to write to the host.
// Then, it calls CommitWrite to commit the data to the system clipboard.
WriteText(mojo_base.mojom.BigString16 text);
WriteHTML(mojo_base.mojom.BigString16 markup, string url);
WriteRTF(string rtf);
WriteBookmark(string url, mojo_base.mojom.String16 title);
WriteBitmap(skia.mojom.Bitmap bitmap);
WriteData(string type, mojo_base.mojom.BigString data);
CommitWrite(ClipboardType type);
WriteStringToFindPboard(mojo_base.mojom.String16 text);