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 /* From private/ppb_flash_clipboard.idl modified Wed Dec 14 18:08:00 2011. */ | 6 /* From private/ppb_flash_clipboard.idl modified Thu Feb 23 23:15:40 2012. */ |
7 | 7 |
8 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ | 8 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ |
9 #define PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ | 9 #define PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
13 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
14 #include "ppapi/c/pp_stdint.h" | 14 #include "ppapi/c/pp_stdint.h" |
15 #include "ppapi/c/pp_var.h" | 15 #include "ppapi/c/pp_var.h" |
16 | 16 |
17 #define PPB_FLASH_CLIPBOARD_INTERFACE_3_0 "PPB_Flash_Clipboard;3.0" | 17 #define PPB_FLASH_CLIPBOARD_INTERFACE_3_0 "PPB_Flash_Clipboard;3.0" |
18 #define PPB_FLASH_CLIPBOARD_INTERFACE PPB_FLASH_CLIPBOARD_INTERFACE_3_0 | 18 #define PPB_FLASH_CLIPBOARD_INTERFACE_4_0 "PPB_Flash_Clipboard;4.0" |
| 19 #define PPB_FLASH_CLIPBOARD_INTERFACE PPB_FLASH_CLIPBOARD_INTERFACE_4_0 |
19 | 20 |
20 /** | 21 /** |
21 * @file | 22 * @file |
22 * This file defines the private <code>PPB_Flash_Clipboard</code> API used by | 23 * This file defines the private <code>PPB_Flash_Clipboard</code> API used by |
23 * Pepper Flash for reading and writing to the clipboard. | 24 * Pepper Flash for reading and writing to the clipboard. |
24 */ | 25 */ |
25 | 26 |
26 | 27 |
27 /** | 28 /** |
28 * The old version string for this interface, equivalent to version 3.0. | 29 * The old version string for this interface, equivalent to version 3.0. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 */ | 64 */ |
64 | 65 |
65 /** | 66 /** |
66 * @addtogroup Interfaces | 67 * @addtogroup Interfaces |
67 * @{ | 68 * @{ |
68 */ | 69 */ |
69 /** | 70 /** |
70 * The <code>PPB_Flash_Clipboard</code> interface contains pointers to functions | 71 * The <code>PPB_Flash_Clipboard</code> interface contains pointers to functions |
71 * used by Pepper Flash to access the clipboard. | 72 * used by Pepper Flash to access the clipboard. |
72 * | 73 * |
73 * TODO(viettrungluu): Support more formats (e.g., HTML).... | |
74 */ | 74 */ |
75 struct PPB_Flash_Clipboard_3_0 { | 75 struct PPB_Flash_Clipboard_4_0 { |
76 /** | 76 /** |
77 * Checks whether a given data format is available from the given clipboard. | 77 * Checks whether a given data format is available from the given clipboard. |
78 * Returns true if the given format is available from the given clipboard. | 78 * Returns true if the given format is available from the given clipboard. |
79 */ | 79 */ |
80 PP_Bool (*IsFormatAvailable)(PP_Instance instance_id, | 80 PP_Bool (*IsFormatAvailable)(PP_Instance instance_id, |
81 PP_Flash_Clipboard_Type clipboard_type, | 81 PP_Flash_Clipboard_Type clipboard_type, |
82 PP_Flash_Clipboard_Format format); | 82 PP_Flash_Clipboard_Format format); |
83 /** | 83 /** |
84 * Reads plain text data from the clipboard. | 84 * Reads data in the given <code>format</code> from the clipboard. An |
| 85 * undefined <code>PP_Var</code> is returned if there is an error in reading |
| 86 * the clipboard data and a null <code>PP_Var</code> is returned if there is |
| 87 * no data of the specified <code>format</code> to read. |
85 */ | 88 */ |
| 89 struct PP_Var (*ReadData)(PP_Instance instance_id, |
| 90 PP_Flash_Clipboard_Type clipboard_type, |
| 91 PP_Flash_Clipboard_Format format); |
| 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 int32_t (*WriteData)(PP_Instance instance_id, |
| 107 PP_Flash_Clipboard_Type clipboard_type, |
| 108 uint32_t data_item_count, |
| 109 const PP_Flash_Clipboard_Format formats[], |
| 110 const struct PP_Var data_items[]); |
| 111 }; |
| 112 |
| 113 typedef struct PPB_Flash_Clipboard_4_0 PPB_Flash_Clipboard; |
| 114 |
| 115 struct PPB_Flash_Clipboard_3_0 { |
| 116 PP_Bool (*IsFormatAvailable)(PP_Instance instance_id, |
| 117 PP_Flash_Clipboard_Type clipboard_type, |
| 118 PP_Flash_Clipboard_Format format); |
86 struct PP_Var (*ReadPlainText)(PP_Instance instance_id, | 119 struct PP_Var (*ReadPlainText)(PP_Instance instance_id, |
87 PP_Flash_Clipboard_Type clipboard_type); | 120 PP_Flash_Clipboard_Type clipboard_type); |
88 /** | |
89 * Writes plain text data to the clipboard. If <code>text</code> is too large, | |
90 * it will return <code>PP_ERROR_NOSPACE</code> and not write to the | |
91 * clipboard. | |
92 */ | |
93 int32_t (*WritePlainText)(PP_Instance instance_id, | 121 int32_t (*WritePlainText)(PP_Instance instance_id, |
94 PP_Flash_Clipboard_Type clipboard_type, | 122 PP_Flash_Clipboard_Type clipboard_type, |
95 struct PP_Var text); | 123 struct PP_Var text); |
96 }; | 124 }; |
97 | |
98 typedef struct PPB_Flash_Clipboard_3_0 PPB_Flash_Clipboard; | |
99 /** | 125 /** |
100 * @} | 126 * @} |
101 */ | 127 */ |
102 | 128 |
103 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ */ | 129 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ */ |
104 | 130 |
OLD | NEW |