Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(715)

Side by Side Diff: ppapi/c/private/ppb_flash_clipboard.h

Issue 9212066: Modified the flash cipboard interface to add html clipboard support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 Mon Jan 30 08:54:16 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 27 matching lines...) Expand all
56 PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT = 1, 57 PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT = 1,
57 /** Indicates HTML clipboard data. */ 58 /** Indicates HTML clipboard data. */
58 PP_FLASH_CLIPBOARD_FORMAT_HTML = 2 59 PP_FLASH_CLIPBOARD_FORMAT_HTML = 2
59 } PP_Flash_Clipboard_Format; 60 } PP_Flash_Clipboard_Format;
60 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_Clipboard_Format, 4); 61 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_Clipboard_Format, 4);
61 /** 62 /**
62 * @} 63 * @}
63 */ 64 */
64 65
65 /** 66 /**
67 * @addtogroup Structs
68 * @{
69 */
70 struct PP_Flash_Clipboard_Data_Item {
dmichael (off chromium) 2012/02/23 18:13:25 This should probably be PP_FlashClipboardDataItem
raymes 2012/02/24 07:28:28 I removed this struct. I'll leave the other names
71 PP_Flash_Clipboard_Format format;
72 struct PP_Var data;
73 };
74 /**
75 * @}
76 */
77
78 /**
66 * @addtogroup Interfaces 79 * @addtogroup Interfaces
67 * @{ 80 * @{
68 */ 81 */
69 /** 82 /**
70 * The <code>PPB_Flash_Clipboard</code> interface contains pointers to functions 83 * The <code>PPB_Flash_Clipboard</code> interface contains pointers to functions
71 * used by Pepper Flash to access the clipboard. 84 * used by Pepper Flash to access the clipboard.
72 * 85 *
73 * TODO(viettrungluu): Support more formats (e.g., HTML)....
74 */ 86 */
75 struct PPB_Flash_Clipboard_3_0 { 87 struct PPB_Flash_Clipboard_4_0 {
76 /** 88 /**
77 * Checks whether a given data format is available from the given clipboard. 89 * 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. 90 * Returns true if the given format is available from the given clipboard.
79 */ 91 */
80 PP_Bool (*IsFormatAvailable)(PP_Instance instance_id, 92 PP_Bool (*IsFormatAvailable)(PP_Instance instance_id,
81 PP_Flash_Clipboard_Type clipboard_type, 93 PP_Flash_Clipboard_Type clipboard_type,
82 PP_Flash_Clipboard_Format format); 94 PP_Flash_Clipboard_Format format);
83 /** 95 /**
84 * Reads plain text data from the clipboard. 96 * Reads data in the given <code>format</code> from the clipboard. A null
97 * <code>PP_Var</code> is returned if there is an error in reading the
dmichael (off chromium) 2012/02/23 18:13:25 I think returning an undefined Var on error is mor
raymes 2012/02/24 07:28:28 Done. Undefined for an error and Null for an empty
98 * clipboard data.
85 */ 99 */
100 struct PP_Var (*ReadData)(PP_Instance instance_id,
dmichael (off chromium) 2012/02/23 18:13:25 So this requires a synchronous message through the
raymes 2012/02/24 07:28:28 Spoke to vtl and according to him this is not prac
101 PP_Flash_Clipboard_Type clipboard_type,
102 PP_Flash_Clipboard_Format format);
103 /**
104 * Writes the given array of data items to the clipboard. All existing
105 * clipboard data in any format is erased before writing this data. Thus,
106 * passing an array of size 0 has the effect of clearing the clipboard without
107 * writing any data. Each data item in the array should have a different
108 * <code>PP_Flash_Clipboard_Format</code>. If multiple data items have the
109 * same format, only the last item with that format will be written.
110 * If there is an error writing any of the items in the array to the
111 * clipboard, none will be written and an error code is returned.
112 * The error code will be <code>PP_ERROR_NOSPACE</code> if the value is
113 * too large to be written, <code>PP_ERROR_BADARGUMENT</code> if a PP_Var
114 * cannot be converted into the format supplied or <code>PP_FAILED</code>
115 * if the format is not supported.
116 */
117 int32_t (*WriteData)(
118 PP_Instance instance_id,
119 PP_Flash_Clipboard_Type clipboard_type,
120 uint32_t data_item_count,
121 const struct PP_Flash_Clipboard_Data_Item data_items[]);
122 };
123
124 typedef struct PPB_Flash_Clipboard_4_0 PPB_Flash_Clipboard;
125
126 struct PPB_Flash_Clipboard_3_0 {
127 PP_Bool (*IsFormatAvailable)(PP_Instance instance_id,
128 PP_Flash_Clipboard_Type clipboard_type,
129 PP_Flash_Clipboard_Format format);
86 struct PP_Var (*ReadPlainText)(PP_Instance instance_id, 130 struct PP_Var (*ReadPlainText)(PP_Instance instance_id,
87 PP_Flash_Clipboard_Type clipboard_type); 131 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, 132 int32_t (*WritePlainText)(PP_Instance instance_id,
94 PP_Flash_Clipboard_Type clipboard_type, 133 PP_Flash_Clipboard_Type clipboard_type,
95 struct PP_Var text); 134 struct PP_Var text);
96 }; 135 };
97
98 typedef struct PPB_Flash_Clipboard_3_0 PPB_Flash_Clipboard;
99 /** 136 /**
100 * @} 137 * @}
101 */ 138 */
102 139
103 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ */ 140 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ */
104 141
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698