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