OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_BASE_CLIPBOARD_CLIPBOARD_WIN_H_ |
| 6 #define UI_BASE_CLIPBOARD_CLIPBOARD_WIN_H_ |
| 7 |
| 8 #include "ui/base/clipboard/clipboard.h" |
| 9 |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 |
| 12 namespace ui { |
| 13 |
| 14 class ClipboardWin : public Clipboard { |
| 15 private: |
| 16 friend class Clipboard; |
| 17 |
| 18 ClipboardWin(); |
| 19 ~ClipboardWin() override; |
| 20 |
| 21 // Clipboard overrides: |
| 22 uint64 GetSequenceNumber(ClipboardType type) override; |
| 23 bool IsFormatAvailable(const FormatType& format, |
| 24 ClipboardType type) const override; |
| 25 void Clear(ClipboardType type) override; |
| 26 void ReadAvailableTypes(ClipboardType type, |
| 27 std::vector<base::string16>* types, |
| 28 bool* contains_filenames) const override; |
| 29 void ReadText(ClipboardType type, base::string16* result) const override; |
| 30 void ReadAsciiText(ClipboardType type, std::string* result) const override; |
| 31 void ReadHTML(ClipboardType type, |
| 32 base::string16* markup, |
| 33 std::string* src_url, |
| 34 uint32* fragment_start, |
| 35 uint32* fragment_end) const override; |
| 36 void ReadRTF(ClipboardType type, std::string* result) const override; |
| 37 SkBitmap ReadImage(ClipboardType type) const override; |
| 38 void ReadCustomData(ClipboardType clipboard_type, |
| 39 const base::string16& type, |
| 40 base::string16* result) const override; |
| 41 void ReadBookmark(base::string16* title, std::string* url) const override; |
| 42 void ReadData(const FormatType& format, std::string* result) const override; |
| 43 void WriteObjects(ClipboardType type, const ObjectMap& objects) override; |
| 44 void WriteText(const char* text_data, size_t text_len) override; |
| 45 void WriteHTML(const char* markup_data, |
| 46 size_t markup_len, |
| 47 const char* url_data, |
| 48 size_t url_len) override; |
| 49 void WriteRTF(const char* rtf_data, size_t data_len) override; |
| 50 void WriteBookmark(const char* title_data, |
| 51 size_t title_len, |
| 52 const char* url_data, |
| 53 size_t url_len) override; |
| 54 void WriteWebSmartPaste() override; |
| 55 void WriteBitmap(const SkBitmap& bitmap) override; |
| 56 void WriteData(const FormatType& format, |
| 57 const char* data_data, |
| 58 size_t data_len) override; |
| 59 |
| 60 void WriteBitmapFromHandle(HBITMAP source_hbitmap, const gfx::Size& size); |
| 61 |
| 62 // Safely write to system clipboard. Free |handle| on failure. |
| 63 void WriteToClipboard(unsigned int format, HANDLE handle); |
| 64 |
| 65 // Return the window that should be the clipboard owner, creating it |
| 66 // if neccessary. Marked const for lazily initialization by const methods. |
| 67 HWND GetClipboardWindow() const; |
| 68 |
| 69 // Mark this as mutable so const methods can still do lazy initialization. |
| 70 mutable scoped_ptr<base::win::MessageWindow> clipboard_owner_; |
| 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(ClipboardWin); |
| 73 }; |
| 74 |
| 75 } // namespace ui |
| 76 |
| 77 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_WIN_H_ |
OLD | NEW |