Chromium Code Reviews| 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 #ifndef PPAPI_CPP_PRIVATE_FLASH_CLIPBOARD_H_ | 5 #ifndef PPAPI_CPP_PRIVATE_FLASH_CLIPBOARD_H_ |
| 6 #define PPAPI_CPP_PRIVATE_FLASH_CLIPBOARD_H_ | 6 #define PPAPI_CPP_PRIVATE_FLASH_CLIPBOARD_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | |
| 9 | 10 |
| 10 #include "ppapi/c/private/ppb_flash_clipboard.h" | 11 #include "ppapi/c/private/ppb_flash_clipboard.h" |
| 11 | 12 |
| 12 namespace pp { | 13 namespace pp { |
| 13 | 14 |
| 14 class Instance; | 15 class Instance; |
| 15 | 16 |
| 16 namespace flash { | 17 namespace flash { |
| 17 | 18 |
| 18 class Clipboard { | 19 class Clipboard { |
| 19 public: | 20 public: |
| 20 // Returns true if the required interface is available. | 21 // Returns true if the required interface is available. |
| 21 static bool IsAvailable(); | 22 static bool IsAvailable(); |
| 22 | 23 |
| 23 // Returns true if the given format is available from the given clipboard. | 24 // Returns true if the given format is available from the given clipboard. |
| 24 static bool IsFormatAvailable(Instance* instance, | 25 static bool IsFormatAvailable(Instance* instance, |
| 25 PP_Flash_Clipboard_Type clipboard_type, | 26 PP_Flash_Clipboard_Type clipboard_type, |
| 26 PP_Flash_Clipboard_Format format); | 27 PP_Flash_Clipboard_Format format); |
| 27 | 28 |
| 28 // Returns true on success, in which case |text_out| will be filled with plain | 29 // Returns true on success in which case all of |data| will be written to |
| 29 // text read from the given clipboard. | 30 // the clipboard. Otherwise nothing will be written. |
| 30 static bool ReadPlainText(Instance* instance, | 31 static bool WriteData(Instance* instance, |
| 31 PP_Flash_Clipboard_Type clipboard_type, | 32 PP_Flash_Clipboard_Type clipboard_type, |
| 32 std::string* text_out); | 33 const std::vector<PP_Flash_Clipboard_Data_Item>& data); |
| 33 | 34 |
| 34 // Returns true on success (it may fail if |text| is too big). | 35 // Returns true on success, in which case |out| will be filled with |
| 35 static bool WritePlainText(Instance* instance, | 36 // data read from the given clipboard in the given format. |
| 36 PP_Flash_Clipboard_Type clipboard_type, | 37 static bool ReadData(Instance* instance, |
|
viettrungluu
2012/02/08 22:25:01
nit: I'd prefer that "Read" precede "Write". ;)
raymes
2012/02/09 00:20:27
Done.
| |
| 37 const std::string& text); | 38 PP_Flash_Clipboard_Type clipboard_type, |
| 39 PP_Flash_Clipboard_Format clipboard_format, | |
| 40 PP_Var* out); | |
| 38 }; | 41 }; |
| 39 | 42 |
| 40 } // namespace flash | 43 } // namespace flash |
| 41 } // namespace pp | 44 } // namespace pp |
| 42 | 45 |
| 43 #endif // PPAPI_CPP_PRIVATE_FLASH_CLIPBOARD_H_ | 46 #endif // PPAPI_CPP_PRIVATE_FLASH_CLIPBOARD_H_ |
| OLD | NEW |