[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef REMOTING_HOST_CLIPBOARD_H_ | ||||
6 | #define REMOTING_HOST_CLIPBOARD_H_ | ||||
7 | |||||
8 | #include <string> | ||||
9 | |||||
10 | #include "base/callback.h" | ||||
11 | |||||
12 | namespace remoting { | ||||
13 | |||||
14 | namespace protocol { | ||||
15 | class ClipboardEvent; | ||||
[email protected] | 7f44ba4 | 2012-05-31 20:26:29 | [diff] [blame^] | 16 | class ClipboardStub; |
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 17 | } // namespace protocol |
18 | |||||
[email protected] | 98f99a0 | 2012-05-16 18:03:32 | [diff] [blame] | 19 | // All Clipboard methods should be run on the UI thread, so that the Clipboard |
20 | // can get change notifications. | ||||
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 21 | class Clipboard { |
22 | public: | ||||
23 | virtual ~Clipboard() {}; | ||||
24 | |||||
25 | // Initialises any objects needed to read from or write to the clipboard. | ||||
[email protected] | 7f44ba4 | 2012-05-31 20:26:29 | [diff] [blame^] | 26 | virtual void Start(scoped_ptr<protocol::ClipboardStub> client_clipboard) = 0; |
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 27 | |
28 | // Destroys any objects initialised by Start(). | ||||
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 29 | virtual void Stop() = 0; |
30 | |||||
[email protected] | 98f99a0 | 2012-05-16 18:03:32 | [diff] [blame] | 31 | // Writes an item to the clipboard. It must be called after Start(). |
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 32 | virtual void InjectClipboardEvent(const protocol::ClipboardEvent& event) = 0; |
33 | |||||
34 | static scoped_ptr<Clipboard> Create(); | ||||
35 | }; | ||||
36 | |||||
37 | } // namespace remoting | ||||
38 | |||||
39 | #endif // REMOTING_HOST_CLIPBOARD_H_ |