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 WEBKIT_GLUE_CLIPBOARD_CLIENT_H_ | 5 #ifndef WEBKIT_GLUE_CLIPBOARD_CLIENT_H_ |
6 #define WEBKIT_GLUE_CLIPBOARD_CLIENT_H_ | 6 #define WEBKIT_GLUE_CLIPBOARD_CLIENT_H_ |
7 | 7 |
8 #include "ui/base/clipboard/clipboard.h" | 8 #include "ui/base/clipboard/clipboard.h" |
9 | 9 |
10 class GURL; | 10 class GURL; |
11 | 11 |
12 namespace webkit_glue { | 12 namespace webkit_glue { |
13 | 13 |
14 // Interface for the webkit glue embedder to implement to support clipboard. | 14 // Interface for the webkit glue embedder to implement to support clipboard. |
15 class ClipboardClient { | 15 class ClipboardClient { |
16 public: | 16 public: |
17 class WriteContext { | 17 class WriteContext { |
18 public: | 18 public: |
19 virtual ~WriteContext() { } | 19 virtual ~WriteContext() { } |
20 | 20 |
21 // Writes bitmap data into the context, updating the ObjectMap. | 21 // Writes bitmap data into the context, updating the ObjectMap. |
22 virtual void WriteBitmapFromPixels(ui::Clipboard::ObjectMap* objects, | 22 virtual void WriteBitmapFromPixels(ui::Clipboard::ObjectMap* objects, |
23 const void* pixels, | 23 const void* pixels, |
24 const gfx::Size& size) = 0; | 24 const gfx::Size& size) = 0; |
25 | 25 |
26 // Flushes all gathered data, and destroys the context. | 26 // Flushes all gathered data. |
27 virtual void FlushAndDestroy(const ui::Clipboard::ObjectMap& objects) = 0; | 27 virtual void Flush(const ui::Clipboard::ObjectMap& objects) = 0; |
28 }; | 28 }; |
29 | 29 |
30 virtual ~ClipboardClient() { } | 30 virtual ~ClipboardClient() { } |
31 | 31 |
32 // Get a clipboard that can be used to construct a ScopedClipboardWriterGlue. | 32 // Get a clipboard that can be used to construct a ScopedClipboardWriterGlue. |
33 virtual ui::Clipboard* GetClipboard() = 0; | 33 virtual ui::Clipboard* GetClipboard() = 0; |
34 | 34 |
35 // Get a sequence number which uniquely identifies clipboard state. | 35 // Get a sequence number which uniquely identifies clipboard state. |
36 virtual uint64 GetSequenceNumber(ui::Clipboard::Buffer buffer) = 0; | 36 virtual uint64 GetSequenceNumber(ui::Clipboard::Buffer buffer) = 0; |
37 | 37 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 const string16& type, | 70 const string16& type, |
71 string16* data) = 0; | 71 string16* data) = 0; |
72 | 72 |
73 // Creates a context to write clipboard data. May return NULL. | 73 // Creates a context to write clipboard data. May return NULL. |
74 virtual WriteContext* CreateWriteContext() = 0; | 74 virtual WriteContext* CreateWriteContext() = 0; |
75 }; | 75 }; |
76 | 76 |
77 } // namespace webkit_glue | 77 } // namespace webkit_glue |
78 | 78 |
79 #endif // WEBKIT_GLUE_CLIPBOARD_CLIENT_H_ | 79 #endif // WEBKIT_GLUE_CLIPBOARD_CLIENT_H_ |
OLD | NEW |