OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /** | 6 /** |
7 * This file defines the private <code>PPB_Flash_Clipboard</code> API used by | 7 * This file defines the private <code>PPB_Flash_Clipboard</code> API used by |
8 * Pepper Flash for reading and writing to the clipboard. | 8 * Pepper Flash for reading and writing to the clipboard. |
9 */ | 9 */ |
10 | 10 |
11 label Chrome { | 11 label Chrome { |
12 M17 = 3.0 | 12 M17 = 3.0, |
| 13 M19 = 4.0 |
13 }; | 14 }; |
14 | 15 |
15 #inline c | 16 #inline c |
16 /** | 17 /** |
17 * The old version string for this interface, equivalent to version 3.0. | 18 * 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 | 19 * TODO(viettrungluu): Remove this when enough time has passed. crbug.com/104184 |
19 */ | 20 */ |
20 #define PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY "PPB_Flash_Clipboard;3" | 21 #define PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY "PPB_Flash_Clipboard;3" |
21 #endinl | 22 #endinl |
22 | 23 |
(...skipping 19 matching lines...) Expand all Loading... |
42 /** Indicates plain text clipboard data. */ | 43 /** Indicates plain text clipboard data. */ |
43 PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT = 1, | 44 PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT = 1, |
44 /** Indicates HTML clipboard data. */ | 45 /** Indicates HTML clipboard data. */ |
45 PP_FLASH_CLIPBOARD_FORMAT_HTML = 2 | 46 PP_FLASH_CLIPBOARD_FORMAT_HTML = 2 |
46 }; | 47 }; |
47 | 48 |
48 /** | 49 /** |
49 * The <code>PPB_Flash_Clipboard</code> interface contains pointers to functions | 50 * The <code>PPB_Flash_Clipboard</code> interface contains pointers to functions |
50 * used by Pepper Flash to access the clipboard. | 51 * used by Pepper Flash to access the clipboard. |
51 * | 52 * |
52 * TODO(viettrungluu): Support more formats (e.g., HTML).... | |
53 */ | 53 */ |
54 [version=3.0] | |
55 interface PPB_Flash_Clipboard { | 54 interface PPB_Flash_Clipboard { |
56 /** | 55 /** |
57 * Checks whether a given data format is available from the given clipboard. | 56 * 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. | 57 * Returns true if the given format is available from the given clipboard. |
59 */ | 58 */ |
60 PP_Bool IsFormatAvailable( | 59 PP_Bool IsFormatAvailable( |
61 [in] PP_Instance instance_id, | 60 [in] PP_Instance instance_id, |
62 [in] PP_Flash_Clipboard_Type clipboard_type, | 61 [in] PP_Flash_Clipboard_Type clipboard_type, |
63 [in] PP_Flash_Clipboard_Format format); | 62 [in] PP_Flash_Clipboard_Format format); |
64 | 63 |
65 /** | 64 /** |
66 * Reads plain text data from the clipboard. | 65 * Deprecated in 4.0. |
67 */ | 66 */ |
| 67 [version=3.0, deprecate=4.0] |
68 PP_Var ReadPlainText( | 68 PP_Var ReadPlainText( |
69 [in] PP_Instance instance_id, | 69 [in] PP_Instance instance_id, |
70 [in] PP_Flash_Clipboard_Type clipboard_type); | 70 [in] PP_Flash_Clipboard_Type clipboard_type); |
71 | 71 |
72 /** | 72 /** |
73 * Writes plain text data to the clipboard. If <code>text</code> is too large, | 73 * Deprecated in 4.0. |
74 * it will return <code>PP_ERROR_NOSPACE</code> and not write to the | |
75 * clipboard. | |
76 */ | 74 */ |
| 75 [version=3.0, deprecate=4.0] |
77 int32_t WritePlainText( | 76 int32_t WritePlainText( |
78 [in] PP_Instance instance_id, | 77 [in] PP_Instance instance_id, |
79 [in] PP_Flash_Clipboard_Type clipboard_type, | 78 [in] PP_Flash_Clipboard_Type clipboard_type, |
80 [in] PP_Var text); | 79 [in] PP_Var text); |
| 80 |
| 81 /** |
| 82 * Reads data in the given <code>format</code> from the clipboard. An |
| 83 * undefined <code>PP_Var</code> is returned if there is an error in reading |
| 84 * the clipboard data and a null <code>PP_Var</code> is returned if there is |
| 85 * no data of the specified <code>format</code> to read. |
| 86 */ |
| 87 [version=4.0] |
| 88 PP_Var ReadData([in] PP_Instance instance_id, |
| 89 [in] PP_Flash_Clipboard_Type clipboard_type, |
| 90 [in] PP_Flash_Clipboard_Format format); |
| 91 |
| 92 /** |
| 93 * Writes the given array of data items to the clipboard. All existing |
| 94 * clipboard data in any format is erased before writing this data. Thus, |
| 95 * passing an array of size 0 has the effect of clearing the clipboard without |
| 96 * writing any data. Each data item in the array should have a different |
| 97 * <code>PP_Flash_Clipboard_Format</code>. If multiple data items have the |
| 98 * same format, only the last item with that format will be written. |
| 99 * If there is an error writing any of the items in the array to the |
| 100 * clipboard, none will be written and an error code is returned. |
| 101 * The error code will be <code>PP_ERROR_NOSPACE</code> if the value is |
| 102 * too large to be written, <code>PP_ERROR_BADARGUMENT</code> if a PP_Var |
| 103 * cannot be converted into the format supplied or <code>PP_FAILED</code> |
| 104 * if the format is not supported. |
| 105 */ |
| 106 [version=4.0] |
| 107 int32_t WriteData([in] PP_Instance instance_id, |
| 108 [in] PP_Flash_Clipboard_Type clipboard_type, |
| 109 [in] uint32_t data_item_count, |
| 110 [in, size_is(data_item_count)] PP_Flash_Clipboard_Format[] formats, |
| 111 [in, size_is(data_item_count)] PP_Var[] data_items); |
81 }; | 112 }; |
OLD | NEW |