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

Side by Side Diff: ppapi/api/private/ppb_flash_clipboard.idl

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 /** 6 /**
7 * This file defines the private <code>PPB_Flash_Clipboard</code> API used by 7 * This file defines the private <code>PPB_Flash_Clipboard</code> API used by
8 * Pepper Flash for reading and writing to the clipboard. 8 * Pepper Flash for reading and writing to the clipboard.
9 */ 9 */
10 10
11 label Chrome { 11 label Chrome {
12 M17 = 3.0 12 M17 = 3.0,
13 M19 = 4.0
13 }; 14 };
14 15
15 #inline c 16 #inline c
16 /** 17 /**
17 * The old version string for this interface, equivalent to version 3.0. 18 * The old version string for this interface, equivalent to version 3.0.
18 * TODO(viettrungluu): Remove this when enough time has passed. crbug.com/104184 19 * TODO(viettrungluu): Remove this when enough time has passed. crbug.com/104184
19 */ 20 */
20 #define PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY "PPB_Flash_Clipboard;3" 21 #define PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY "PPB_Flash_Clipboard;3"
21 #endinl 22 #endinl
22 23
(...skipping 15 matching lines...) Expand all
38 [assert_size(4)] 39 [assert_size(4)]
39 enum PP_Flash_Clipboard_Format { 40 enum PP_Flash_Clipboard_Format {
40 /** Indicates an invalid or unsupported clipboard data format. */ 41 /** Indicates an invalid or unsupported clipboard data format. */
41 PP_FLASH_CLIPBOARD_FORMAT_INVALID = 0, 42 PP_FLASH_CLIPBOARD_FORMAT_INVALID = 0,
42 /** Indicates plain text clipboard data. */ 43 /** Indicates plain text clipboard data. */
43 PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT = 1, 44 PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT = 1,
44 /** Indicates HTML clipboard data. */ 45 /** Indicates HTML clipboard data. */
45 PP_FLASH_CLIPBOARD_FORMAT_HTML = 2 46 PP_FLASH_CLIPBOARD_FORMAT_HTML = 2
46 }; 47 };
47 48
49 struct PP_Flash_Clipboard_Data_Item {
50 PP_Flash_Clipboard_Format format;
51 PP_Var data;
52 };
53
48 /** 54 /**
49 * The <code>PPB_Flash_Clipboard</code> interface contains pointers to functions 55 * The <code>PPB_Flash_Clipboard</code> interface contains pointers to functions
50 * used by Pepper Flash to access the clipboard. 56 * used by Pepper Flash to access the clipboard.
51 * 57 *
52 * TODO(viettrungluu): Support more formats (e.g., HTML)....
53 */ 58 */
54 [version=3.0]
55 interface PPB_Flash_Clipboard { 59 interface PPB_Flash_Clipboard {
56 /** 60 /**
57 * Checks whether a given data format is available from the given clipboard. 61 * Checks whether a given data format is available from the given clipboard.
58 * Returns true if the given format is available from the given clipboard. 62 * Returns true if the given format is available from the given clipboard.
59 */ 63 */
60 PP_Bool IsFormatAvailable( 64 PP_Bool IsFormatAvailable(
61 [in] PP_Instance instance_id, 65 [in] PP_Instance instance_id,
62 [in] PP_Flash_Clipboard_Type clipboard_type, 66 [in] PP_Flash_Clipboard_Type clipboard_type,
63 [in] PP_Flash_Clipboard_Format format); 67 [in] PP_Flash_Clipboard_Format format);
64 68
65 /** 69 /**
66 * Reads plain text data from the clipboard. 70 * Deprecated in 4.0.
67 */ 71 */
72 [version=3.0, deprecate=4.0]
68 PP_Var ReadPlainText( 73 PP_Var ReadPlainText(
69 [in] PP_Instance instance_id, 74 [in] PP_Instance instance_id,
70 [in] PP_Flash_Clipboard_Type clipboard_type); 75 [in] PP_Flash_Clipboard_Type clipboard_type);
71 76
72 /** 77 /**
73 * Writes plain text data to the clipboard. If <code>text</code> is too large, 78 * Deprecated in 4.0.
74 * it will return <code>PP_ERROR_NOSPACE</code> and not write to the
75 * clipboard.
76 */ 79 */
80 [version=3.0, deprecate=4.0]
77 int32_t WritePlainText( 81 int32_t WritePlainText(
78 [in] PP_Instance instance_id, 82 [in] PP_Instance instance_id,
79 [in] PP_Flash_Clipboard_Type clipboard_type, 83 [in] PP_Flash_Clipboard_Type clipboard_type,
80 [in] PP_Var text); 84 [in] PP_Var text);
85
86 /**
87 * Reads data in the given <code>format</code> from the clipboard. A null
88 * <code>PP_Var</code> is returned if there is an error in reading the
89 * clipboard data.
90 */
91 [version=4.0]
92 PP_Var ReadData([in] PP_Instance instance_id,
93 [in] PP_Flash_Clipboard_Type clipboard_type,
94 [in] PP_Flash_Clipboard_Format format);
95
96 /**
97 * Writes the given array of data items to the clipboard. All existing
98 * clipboard data in any format is erased before writing this data. Thus,
99 * passing an array of size 0 has the effect of clearing the clipboard without
100 * writing any data. Each data item in the array should have a different
101 * <code>PP_Flash_Clipboard_Format</code>. If multiple data items have the
102 * same format, only the last item with that format will be written.
103 * If there is an error writing any of the items in the array to the
104 * clipboard, none will be written and an error code is returned.
105 * The error code will be <code>PP_ERROR_NOSPACE</code> if the value is
106 * too large to be written, <code>PP_ERROR_BADARGUMENT</code> if a PP_Var
107 * cannot be converted into the format supplied or <code>PP_FAILED</code>
108 * if the format is not supported.
109 */
110 [version=4.0]
111 int32_t WriteData([in] PP_Instance instance_id,
112 [in] PP_Flash_Clipboard_Type clipboard_type,
113 [in] uint32_t data_item_count,
114 [in, size_is(data_item_count)] PP_Flash_Clipboard_Data_Item[] data_items);
81 }; 115 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698