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 | 4 |
5 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ | 5 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ |
6 #define PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ | 6 #define PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ |
7 | 7 |
| 8 #include "ppapi/c/pp_bool.h" |
8 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
10 | 11 |
11 #define PPB_FLASH_CLIPBOARD_INTERFACE "PPB_Flash_Clipboard;2" | 12 #define PPB_FLASH_CLIPBOARD_INTERFACE "PPB_Flash_Clipboard;3" |
12 | 13 |
13 typedef enum { | 14 typedef enum { |
14 PP_FLASH_CLIPBOARD_TYPE_STANDARD = 0, | 15 PP_FLASH_CLIPBOARD_TYPE_STANDARD = 0, |
15 PP_FLASH_CLIPBOARD_TYPE_SELECTION = 1, | 16 PP_FLASH_CLIPBOARD_TYPE_SELECTION = 1, |
16 PP_FLASH_CLIPBOARD_TYPE_DRAG = 2 | 17 PP_FLASH_CLIPBOARD_TYPE_DRAG = 2 |
17 } PP_Flash_Clipboard_Type; | 18 } PP_Flash_Clipboard_Type; |
18 | 19 |
| 20 typedef enum { |
| 21 PP_FLASH_CLIPBOARD_FORMAT_INVALID = 0, |
| 22 PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT = 1, |
| 23 PP_FLASH_CLIPBOARD_FORMAT_HTML = 2 |
| 24 } PP_Flash_Clipboard_Format; |
| 25 |
19 struct PPB_Flash_Clipboard { | 26 struct PPB_Flash_Clipboard { |
| 27 // Returns true if the given format is available from the given clipboard. |
| 28 PP_Bool (*IsFormatAvailable)(PP_Instance instance_id, |
| 29 PP_Flash_Clipboard_Type clipboard_type, |
| 30 PP_Flash_Clipboard_Format format); |
| 31 |
20 // Reads plain text data from the clipboard. | 32 // Reads plain text data from the clipboard. |
21 struct PP_Var (*ReadPlainText)(PP_Instance instance_id, | 33 struct PP_Var (*ReadPlainText)(PP_Instance instance_id, |
22 PP_Flash_Clipboard_Type clipboard_type); | 34 PP_Flash_Clipboard_Type clipboard_type); |
23 | 35 |
24 // Writes plain text data to the clipboard. If |text| is too large, it will | 36 // Writes plain text data to the clipboard. If |text| is too large, it will |
25 // return |PP_ERROR_NOSPACE| (and not write to the clipboard). | 37 // return |PP_ERROR_NOSPACE| (and not write to the clipboard). |
26 int32_t (*WritePlainText)(PP_Instance instance_id, | 38 int32_t (*WritePlainText)(PP_Instance instance_id, |
27 PP_Flash_Clipboard_Type clipboard_type, | 39 PP_Flash_Clipboard_Type clipboard_type, |
28 struct PP_Var text); | 40 struct PP_Var text); |
29 | 41 |
30 // TODO(vtl): More formats, a |IsFormatAvailable()|, .... | 42 // TODO(vtl): More formats (e.g., HTML).... |
31 }; | 43 }; |
32 | 44 |
33 #endif // PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ | 45 #endif // PPAPI_C_PRIVATE_PPB_FLASH_CLIPBOARD_H_ |
OLD | NEW |