1 /* Copyright (c) 2012 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.
7 * This file defines the private <code>PPB_Flash_Clipboard</code> API used by
8 * Pepper Flash for reading and writing to the clipboard.
17 * The old version string for this interface, equivalent to version 3.0.
18 * TODO(viettrungluu): Remove this when enough time has passed. crbug.com/104184
20 #define PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY
"PPB_Flash_Clipboard;3"
24 * This enumeration contains the types of clipboards that can be accessed.
25 * These types correspond to clipboard types in WebKit.
28 enum PP_Flash_Clipboard_Type
{
29 /** The standard clipboard. */
30 PP_FLASH_CLIPBOARD_TYPE_STANDARD
= 0,
31 /** The selection clipboard (e.g., on Linux). */
32 PP_FLASH_CLIPBOARD_TYPE_SELECTION
= 1
36 * This enumeration contains the supported clipboard data formats.
39 enum PP_Flash_Clipboard_Format
{
40 /** Indicates an invalid or unsupported clipboard data format. */
41 PP_FLASH_CLIPBOARD_FORMAT_INVALID
= 0,
42 /** Indicates plain text clipboard data. */
43 PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT
= 1,
44 /** Indicates HTML clipboard data. */
45 PP_FLASH_CLIPBOARD_FORMAT_HTML
= 2
49 * The <code>PPB_Flash_Clipboard</code> interface contains pointers to functions
50 * used by Pepper Flash to access the clipboard.
52 * TODO(viettrungluu): Support more formats (e.g., HTML)....
55 interface PPB_Flash_Clipboard
{
57 * Checks whether a given data format is available from the given clipboard.
58 * Returns true if the given format is available from the given clipboard.
60 PP_Bool IsFormatAvailable
(
61 [in] PP_Instance instance_id
,
62 [in] PP_Flash_Clipboard_Type clipboard_type
,
63 [in] PP_Flash_Clipboard_Format format
);
66 * Reads plain text data from the clipboard.
69 [in] PP_Instance instance_id
,
70 [in] PP_Flash_Clipboard_Type clipboard_type
);
73 * Writes plain text data to the clipboard. If <code>text</code> is too large,
74 * it will return <code>PP_ERROR_NOSPACE</code> and not write to the
77 int32_t WritePlainText
(
78 [in] PP_Instance instance_id
,
79 [in] PP_Flash_Clipboard_Type clipboard_type
,