OLD | NEW |
---|---|
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 Loading... | |
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. | |
88 */ | |
viettrungluu
2012/01/26 18:26:18
Probably you should add that it returns a null PP_
| |
89 [version=4.0] | |
90 PP_Var ReadData([in] PP_Instance instance_id, | |
91 [in] PP_Flash_Clipboard_Type clipboard_type, | |
92 [in] PP_Flash_Clipboard_Format format); | |
93 | |
94 /** | |
95 * Writes the given array of data items to the clipboard. Each data item | |
96 * should have a different <code>PP_Flash_Clipboard_Format</code>. | |
97 * Any existing clipboard data is erased before writing this data. | |
viettrungluu
2012/01/26 18:26:18
Any existing clipboard data in any format, I presu
| |
98 */ | |
viettrungluu
2012/01/26 18:26:18
You should probably clarify what happens on error.
| |
99 [version=4.0] | |
100 int32_t WriteData([in] PP_Instance instance_id, | |
101 [in] PP_Flash_Clipboard_Type clipboard_type, | |
102 [in] uint32_t data_item_count, | |
103 [in, size_is(data_item_count)] PP_Flash_Clipboard_Data_Item[] data_items); | |
81 }; | 104 }; |
OLD | NEW |