OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 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 */ |
| 5 |
| 6 /* From private/ppb_flash_clipboard.idl modified Mon Nov 14 13:36:44 2011. */ |
4 | 7 |
5 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ | 8 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ |
6 #define PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ | 9 #define PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ |
7 | 10 |
8 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
| 13 #include "ppapi/c/pp_macros.h" |
| 14 #include "ppapi/c/pp_stdint.h" |
10 #include "ppapi/c/pp_var.h" | 15 #include "ppapi/c/pp_var.h" |
11 | 16 |
12 #define PPB_FLASH_CLIPBOARD_INTERFACE "PPB_Flash_Clipboard;3" | 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 |
13 | 19 |
| 20 /** |
| 21 * @file |
| 22 * This file defines the private <code>PPB_Flash_Clipboard</code> API used by |
| 23 * Pepper Flash for reading and writing to the clipboard. |
| 24 */ |
| 25 |
| 26 |
| 27 /** |
| 28 * The old version string for this interface, equivalent to version 3.0. |
| 29 * TODO(viettrungluu): Remove this when enough time has passed. crbug.com/104184 |
| 30 */ |
| 31 #define PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY "PPB_Flash_Clipboard;3" |
| 32 |
| 33 /** |
| 34 * @addtogroup Enums |
| 35 * @{ |
| 36 */ |
| 37 /** |
| 38 * This enumeration contains the types of clipboards that can be accessed. |
| 39 * These types correspond to clipboard types in WebKit. |
| 40 */ |
14 typedef enum { | 41 typedef enum { |
| 42 /** The standard clipboard. */ |
15 PP_FLASH_CLIPBOARD_TYPE_STANDARD = 0, | 43 PP_FLASH_CLIPBOARD_TYPE_STANDARD = 0, |
| 44 /** The selection clipboard (e.g., on Linux). */ |
16 PP_FLASH_CLIPBOARD_TYPE_SELECTION = 1, | 45 PP_FLASH_CLIPBOARD_TYPE_SELECTION = 1, |
| 46 /** The drag clipboard. */ |
17 PP_FLASH_CLIPBOARD_TYPE_DRAG = 2 | 47 PP_FLASH_CLIPBOARD_TYPE_DRAG = 2 |
18 } PP_Flash_Clipboard_Type; | 48 } PP_Flash_Clipboard_Type; |
| 49 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_Clipboard_Type, 4); |
19 | 50 |
| 51 /** |
| 52 * This enumeration contains the supported clipboard data formats. |
| 53 */ |
20 typedef enum { | 54 typedef enum { |
| 55 /** Indicates an invalid or unsupported clipboard data format. */ |
21 PP_FLASH_CLIPBOARD_FORMAT_INVALID = 0, | 56 PP_FLASH_CLIPBOARD_FORMAT_INVALID = 0, |
| 57 /** Indicates plain text clipboard data. */ |
22 PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT = 1, | 58 PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT = 1, |
| 59 /** Indicates HTML clipboard data. */ |
23 PP_FLASH_CLIPBOARD_FORMAT_HTML = 2 | 60 PP_FLASH_CLIPBOARD_FORMAT_HTML = 2 |
24 } PP_Flash_Clipboard_Format; | 61 } PP_Flash_Clipboard_Format; |
| 62 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_Clipboard_Format, 4); |
| 63 /** |
| 64 * @} |
| 65 */ |
25 | 66 |
| 67 /** |
| 68 * @addtogroup Interfaces |
| 69 * @{ |
| 70 */ |
| 71 /** |
| 72 * The <code>PPB_Flash_Clipboard</code> interface contains pointers to functions |
| 73 * used by Pepper Flash to access the clipboard. |
| 74 * |
| 75 * TODO(viettrungluu): Support more formats (e.g., HTML).... |
| 76 */ |
26 struct PPB_Flash_Clipboard { | 77 struct PPB_Flash_Clipboard { |
27 // Returns true if the given format is available from the given clipboard. | 78 /** |
| 79 * Checks whether a given data format is available from the given clipboard. |
| 80 * Returns true if the given format is available from the given clipboard. |
| 81 */ |
28 PP_Bool (*IsFormatAvailable)(PP_Instance instance_id, | 82 PP_Bool (*IsFormatAvailable)(PP_Instance instance_id, |
29 PP_Flash_Clipboard_Type clipboard_type, | 83 PP_Flash_Clipboard_Type clipboard_type, |
30 PP_Flash_Clipboard_Format format); | 84 PP_Flash_Clipboard_Format format); |
31 | 85 /** |
32 // Reads plain text data from the clipboard. | 86 * Reads plain text data from the clipboard. |
| 87 */ |
33 struct PP_Var (*ReadPlainText)(PP_Instance instance_id, | 88 struct PP_Var (*ReadPlainText)(PP_Instance instance_id, |
34 PP_Flash_Clipboard_Type clipboard_type); | 89 PP_Flash_Clipboard_Type clipboard_type); |
35 | 90 /** |
36 // Writes plain text data to the clipboard. If |text| is too large, it will | 91 * Writes plain text data to the clipboard. If <code>text</code> is too large, |
37 // return |PP_ERROR_NOSPACE| (and not write to the clipboard). | 92 * it will return <code>PP_ERROR_NOSPACE</code> and not write to the |
| 93 * clipboard. |
| 94 */ |
38 int32_t (*WritePlainText)(PP_Instance instance_id, | 95 int32_t (*WritePlainText)(PP_Instance instance_id, |
39 PP_Flash_Clipboard_Type clipboard_type, | 96 PP_Flash_Clipboard_Type clipboard_type, |
40 struct PP_Var text); | 97 struct PP_Var text); |
| 98 }; |
| 99 /** |
| 100 * @} |
| 101 */ |
41 | 102 |
42 // TODO(vtl): More formats (e.g., HTML).... | 103 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ */ |
43 }; | |
44 | 104 |
45 #endif // PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ | |
OLD | NEW |