summaryrefslogtreecommitdiffstats
path: root/ppapi/c
diff options
context:
space:
mode:
authorraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-24 23:15:00 +0000
committerraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-24 23:15:00 +0000
commitfc148a7aed3f536f26c136d5c66b45b8735c069b (patch)
tree8070272863600e0a38ecfa3e7ded91fec7634c98 /ppapi/c
parente49221987f30d61b7b696de183a6a416f502ffbf (diff)
downloadchromium_src-fc148a7aed3f536f26c136d5c66b45b8735c069b.zip
chromium_src-fc148a7aed3f536f26c136d5c66b45b8735c069b.tar.gz
chromium_src-fc148a7aed3f536f26c136d5c66b45b8735c069b.tar.bz2
Modified the flash cipboard interface to add html clipboard support.
This changes the way the interface works. To write data, the user now passes an array of data items, one for each format they want to write to the clipboard. When reading data, they specify the format they want to read. BUG=110796 TEST=./ui_tests --gtest_filter=*PPAPITest.*Clipboard* passes Review URL: http://codereview.chromium.org/9212066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r--ppapi/c/private/ppb_flash_clipboard.h50
1 files changed, 38 insertions, 12 deletions
diff --git a/ppapi/c/private/ppb_flash_clipboard.h b/ppapi/c/private/ppb_flash_clipboard.h
index 7b84a27..7ed50406 100644
--- a/ppapi/c/private/ppb_flash_clipboard.h
+++ b/ppapi/c/private/ppb_flash_clipboard.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From private/ppb_flash_clipboard.idl modified Wed Dec 14 18:08:00 2011. */
+/* From private/ppb_flash_clipboard.idl modified Thu Feb 23 23:15:40 2012. */
#ifndef PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_
#define PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_
@@ -15,7 +15,8 @@
#include "ppapi/c/pp_var.h"
#define PPB_FLASH_CLIPBOARD_INTERFACE_3_0 "PPB_Flash_Clipboard;3.0"
-#define PPB_FLASH_CLIPBOARD_INTERFACE PPB_FLASH_CLIPBOARD_INTERFACE_3_0
+#define PPB_FLASH_CLIPBOARD_INTERFACE_4_0 "PPB_Flash_Clipboard;4.0"
+#define PPB_FLASH_CLIPBOARD_INTERFACE PPB_FLASH_CLIPBOARD_INTERFACE_4_0
/**
* @file
@@ -70,9 +71,8 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Flash_Clipboard_Format, 4);
* The <code>PPB_Flash_Clipboard</code> interface contains pointers to functions
* used by Pepper Flash to access the clipboard.
*
- * TODO(viettrungluu): Support more formats (e.g., HTML)....
*/
-struct PPB_Flash_Clipboard_3_0 {
+struct PPB_Flash_Clipboard_4_0 {
/**
* Checks whether a given data format is available from the given clipboard.
* Returns true if the given format is available from the given clipboard.
@@ -81,21 +81,47 @@ struct PPB_Flash_Clipboard_3_0 {
PP_Flash_Clipboard_Type clipboard_type,
PP_Flash_Clipboard_Format format);
/**
- * Reads plain text data from the clipboard.
+ * Reads data in the given <code>format</code> from the clipboard. An
+ * undefined <code>PP_Var</code> is returned if there is an error in reading
+ * the clipboard data and a null <code>PP_Var</code> is returned if there is
+ * no data of the specified <code>format</code> to read.
*/
- struct PP_Var (*ReadPlainText)(PP_Instance instance_id,
- PP_Flash_Clipboard_Type clipboard_type);
+ struct PP_Var (*ReadData)(PP_Instance instance_id,
+ PP_Flash_Clipboard_Type clipboard_type,
+ PP_Flash_Clipboard_Format format);
/**
- * Writes plain text data to the clipboard. If <code>text</code> is too large,
- * it will return <code>PP_ERROR_NOSPACE</code> and not write to the
- * clipboard.
+ * Writes the given array of data items to the clipboard. All existing
+ * clipboard data in any format is erased before writing this data. Thus,
+ * passing an array of size 0 has the effect of clearing the clipboard without
+ * writing any data. Each data item in the array should have a different
+ * <code>PP_Flash_Clipboard_Format</code>. If multiple data items have the
+ * same format, only the last item with that format will be written.
+ * If there is an error writing any of the items in the array to the
+ * clipboard, none will be written and an error code is returned.
+ * The error code will be <code>PP_ERROR_NOSPACE</code> if the value is
+ * too large to be written, <code>PP_ERROR_BADARGUMENT</code> if a PP_Var
+ * cannot be converted into the format supplied or <code>PP_FAILED</code>
+ * if the format is not supported.
*/
+ int32_t (*WriteData)(PP_Instance instance_id,
+ PP_Flash_Clipboard_Type clipboard_type,
+ uint32_t data_item_count,
+ const PP_Flash_Clipboard_Format formats[],
+ const struct PP_Var data_items[]);
+};
+
+typedef struct PPB_Flash_Clipboard_4_0 PPB_Flash_Clipboard;
+
+struct PPB_Flash_Clipboard_3_0 {
+ PP_Bool (*IsFormatAvailable)(PP_Instance instance_id,
+ PP_Flash_Clipboard_Type clipboard_type,
+ PP_Flash_Clipboard_Format format);
+ struct PP_Var (*ReadPlainText)(PP_Instance instance_id,
+ PP_Flash_Clipboard_Type clipboard_type);
int32_t (*WritePlainText)(PP_Instance instance_id,
PP_Flash_Clipboard_Type clipboard_type,
struct PP_Var text);
};
-
-typedef struct PPB_Flash_Clipboard_3_0 PPB_Flash_Clipboard;
/**
* @}
*/