| /* Copyright (c) 2012 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. |
| */ |
| |
| /** |
| * This file defines the private <code>PPB_Flash_Clipboard</code> API used by |
| * Pepper Flash for reading and writing to the clipboard. |
| */ |
| |
| label Chrome { |
| M19 = 4.0, |
| M24 = 5.0, |
| M34 = 5.1 |
| }; |
| |
| /** |
| * This enumeration contains the types of clipboards that can be accessed. |
| * These types correspond to clipboard types in WebKit. |
| */ |
| [assert_size(4)] |
| enum PP_Flash_Clipboard_Type { |
| /** The standard clipboard. */ |
| PP_FLASH_CLIPBOARD_TYPE_STANDARD = 0, |
| /** The selection clipboard (e.g., on Linux). */ |
| PP_FLASH_CLIPBOARD_TYPE_SELECTION = 1 |
| }; |
| |
| /** |
| * This enumeration contains the predefined clipboard data formats. |
| */ |
| [assert_size(4)] |
| enum PP_Flash_Clipboard_Format { |
| /** Indicates an invalid or unsupported clipboard data format. */ |
| PP_FLASH_CLIPBOARD_FORMAT_INVALID = 0, |
| /** |
| * Indicates plaintext clipboard data. The format expected/returned is a |
| * <code>PP_VARTYPE_STRING</code>. |
| */ |
| PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT = 1, |
| /** |
| * Indicates HTML clipboard data. The format expected/returned is a |
| * <code>PP_VARTYPE_STRING</code>. |
| */ |
| PP_FLASH_CLIPBOARD_FORMAT_HTML = 2, |
| /** |
| * Indicates RTF clipboard data. The format expected/returned is a |
| * <code>PP_VARTYPE_ARRAY_BUFFER</code>. |
| */ |
| PP_FLASH_CLIPBOARD_FORMAT_RTF = 3 |
| }; |
| |
| /** |
| * The <code>PPB_Flash_Clipboard</code> interface contains pointers to functions |
| * used by Pepper Flash to access the clipboard. |
| * |
| */ |
| interface PPB_Flash_Clipboard { |
| /** |
| * Deprecated in 5.0. |
| */ |
| [version=4.0, deprecate=5.0] |
| PP_Bool IsFormatAvailable( |
| [in] PP_Instance instance_id, |
| [in] PP_Flash_Clipboard_Type clipboard_type, |
| [in] PP_Flash_Clipboard_Format format); |
| |
| /** |
| * Deprecated in 5.0. |
| */ |
| [version=4.0, deprecate=5.0] |
| PP_Var ReadData([in] PP_Instance instance_id, |
| [in] PP_Flash_Clipboard_Type clipboard_type, |
| [in] PP_Flash_Clipboard_Format format); |
| |
| /** |
| * Deprecated in 5.0. |
| */ |
| [version=4.0, deprecate=5.0] |
| int32_t WriteData([in] PP_Instance instance_id, |
| [in] PP_Flash_Clipboard_Type clipboard_type, |
| [in] uint32_t data_item_count, |
| [in, size_is(data_item_count)] PP_Flash_Clipboard_Format[] formats, |
| [in, size_is(data_item_count)] PP_Var[] data_items); |
| |
| /** |
| * Registers a custom clipboard format. The format is identified by a |
| * string. An id identifying the format will be returned if the format is |
| * successfully registered, which can be used to read/write data of that |
| * format. If the format has already been registered, the id associated with |
| * that format will be returned. If the format fails to be registered |
| * <code>PP_FLASH_CLIPBOARD_FORMAT_INVALID</code> will be returned. |
| * |
| * All custom data should be read/written as <code>PP_Var</code> array |
| * buffers. The clipboard format is pepper-specific meaning that although the |
| * data will be stored on the system clipboard, it can only be accessed in a |
| * sensible way by using the pepper API. Data stored in custom formats can |
| * be safely shared between different applications that use pepper. |
| */ |
| [version=5.0] |
| uint32_t RegisterCustomFormat( |
| [in] PP_Instance instance_id, |
| [in] str_t format_name); |
| |
| /** |
| * Checks whether a given data format is available from the given clipboard. |
| * Returns true if the given format is available from the given clipboard. |
| */ |
| [version=5.0] |
| PP_Bool IsFormatAvailable( |
| [in] PP_Instance instance_id, |
| [in] PP_Flash_Clipboard_Type clipboard_type, |
| [in] uint32_t format); |
| |
| /** |
| * Reads data in the given <code>format</code> from the clipboard. An |
| * undefined <code>PP_Var</code> is returned if there is an error in reading |
| * the clipboard data and a null <code>PP_Var</code> is returned if there is |
| * no data of the specified <code>format</code> to read. |
| */ |
| [version=5.0] |
| PP_Var ReadData([in] PP_Instance instance_id, |
| [in] PP_Flash_Clipboard_Type clipboard_type, |
| [in] uint32_t format); |
| |
| /** |
| * Writes the given array of data items to the clipboard. All existing |
| * clipboard data in any format is erased before writing this data. Thus, |
| * passing an array of size 0 has the effect of clearing the clipboard without |
| * writing any data. Each data item in the array should have a different |
| * <code>PP_Flash_Clipboard_Format</code>. If multiple data items have the |
| * same format, only the last item with that format will be written. |
| * If there is an error writing any of the items in the array to the |
| * clipboard, none will be written and an error code is returned. |
| * The error code will be <code>PP_ERROR_NOSPACE</code> if the value is |
| * too large to be written, <code>PP_ERROR_BADARGUMENT</code> if a PP_Var |
| * cannot be converted into the format supplied or <code>PP_FAILED</code> |
| * if the format is not supported. |
| */ |
| [version=5.0] |
| int32_t WriteData([in] PP_Instance instance_id, |
| [in] PP_Flash_Clipboard_Type clipboard_type, |
| [in] uint32_t data_item_count, |
| [in, size_is(data_item_count)] uint32_t[] formats, |
| [in, size_is(data_item_count)] PP_Var[] data_items); |
| |
| /** |
| * Gets a sequence number which uniquely identifies clipboard state. This can |
| * be used to version the data on the clipboard and determine whether it has |
| * changed. The sequence number will be placed in |sequence_number| and |
| * PP_TRUE returned if the sequence number was retrieved successfully. |
| */ |
| [version=5.1] |
| PP_Bool GetSequenceNumber([in] PP_Instance instance_id, |
| [in] PP_Flash_Clipboard_Type clipboard_type, |
| [out] uint64_t sequence_number); |
| }; |