| 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 | 9 |
| 10 #include "ppapi/c/private/ppb_flash_clipboard.h" | 10 #include "ppapi/c/private/ppb_flash_clipboard.h" |
| 11 | 11 |
| 12 namespace pp { | 12 namespace pp { |
| 13 | 13 |
| 14 class Instance; | 14 class InstanceHandle; |
| 15 | 15 |
| 16 namespace flash { | 16 namespace flash { |
| 17 | 17 |
| 18 class Clipboard { | 18 class Clipboard { |
| 19 public: | 19 public: |
| 20 // Returns true if the required interface is available. | 20 // Returns true if the required interface is available. |
| 21 static bool IsAvailable(); | 21 static bool IsAvailable(); |
| 22 | 22 |
| 23 // Returns true if the given format is available from the given clipboard. | 23 // Returns true if the given format is available from the given clipboard. |
| 24 static bool IsFormatAvailable(Instance* instance, | 24 static bool IsFormatAvailable(const InstanceHandle& instance, |
| 25 PP_Flash_Clipboard_Type clipboard_type, | 25 PP_Flash_Clipboard_Type clipboard_type, |
| 26 PP_Flash_Clipboard_Format format); | 26 PP_Flash_Clipboard_Format format); |
| 27 | 27 |
| 28 // Returns true on success, in which case |text_out| will be filled with plain | 28 // Returns true on success, in which case |text_out| will be filled with plain |
| 29 // text read from the given clipboard. | 29 // text read from the given clipboard. |
| 30 static bool ReadPlainText(Instance* instance, | 30 static bool ReadPlainText(const InstanceHandle& instance, |
| 31 PP_Flash_Clipboard_Type clipboard_type, | 31 PP_Flash_Clipboard_Type clipboard_type, |
| 32 std::string* text_out); | 32 std::string* text_out); |
| 33 | 33 |
| 34 // Returns true on success (it may fail if |text| is too big). | 34 // Returns true on success (it may fail if |text| is too big). |
| 35 static bool WritePlainText(Instance* instance, | 35 static bool WritePlainText(const InstanceHandle& instance, |
| 36 PP_Flash_Clipboard_Type clipboard_type, | 36 PP_Flash_Clipboard_Type clipboard_type, |
| 37 const std::string& text); | 37 const std::string& text); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace flash | 40 } // namespace flash |
| 41 } // namespace pp | 41 } // namespace pp |
| 42 | 42 |
| 43 #endif // PPAPI_CPP_PRIVATE_FLASH_CLIPBOARD_H_ | 43 #endif // PPAPI_CPP_PRIVATE_FLASH_CLIPBOARD_H_ |
| OLD | NEW |