atom_api_clipboard.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Copyright (c) 2016 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_COMMON_API_ATOM_API_CLIPBOARD_H_
  5. #define ATOM_COMMON_API_ATOM_API_CLIPBOARD_H_
  6. #include <string>
  7. #include <vector>
  8. #include "native_mate/arguments.h"
  9. #include "native_mate/dictionary.h"
  10. #include "ui/base/clipboard/clipboard.h"
  11. #include "ui/gfx/image/image.h"
  12. namespace atom {
  13. namespace api {
  14. class Clipboard {
  15. public:
  16. static ui::ClipboardType GetClipboardType(mate::Arguments* args);
  17. static std::vector<base::string16> AvailableFormats(mate::Arguments* args);
  18. static bool Has(const std::string& format_string, mate::Arguments* args);
  19. static void Clear(mate::Arguments* args);
  20. static std::string Read(const std::string& format_string);
  21. static void Write(const mate::Dictionary& data, mate::Arguments* args);
  22. static base::string16 ReadText(mate::Arguments* args);
  23. static void WriteText(const base::string16& text, mate::Arguments* args);
  24. static base::string16 ReadRTF(mate::Arguments* args);
  25. static void WriteRTF(const std::string& text, mate::Arguments* args);
  26. static base::string16 ReadHTML(mate::Arguments* args);
  27. static void WriteHTML(const base::string16& html, mate::Arguments* args);
  28. static v8::Local<v8::Value> ReadBookmark(mate::Arguments* args);
  29. static void WriteBookmark(const base::string16& title,
  30. const std::string& url,
  31. mate::Arguments* args);
  32. static gfx::Image ReadImage(mate::Arguments* args);
  33. static void WriteImage(const gfx::Image& image, mate::Arguments* args);
  34. static base::string16 ReadFindText();
  35. static void WriteFindText(const base::string16& text);
  36. static v8::Local<v8::Value> ReadBuffer(const std::string& format_string,
  37. mate::Arguments* args);
  38. static void WriteBuffer(const std::string& format_string,
  39. const v8::Local<v8::Value> buffer,
  40. mate::Arguments* args);
  41. private:
  42. DISALLOW_COPY_AND_ASSIGN(Clipboard);
  43. };
  44. } // namespace api
  45. } // namespace atom
  46. #endif // ATOM_COMMON_API_ATOM_API_CLIPBOARD_H_