Avi Drissman | d6cdf9b | 2022-09-15 19:52:53 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors |
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 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 | |||||
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 8 | #include <memory> |
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 9 | #include <string> |
10 | |||||
Avi Drissman | 135261e | 2023-01-11 22:43:15 | [diff] [blame^] | 11 | #include "base/functional/callback.h" |
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 12 | |
13 | namespace remoting { | ||||
14 | |||||
15 | namespace protocol { | ||||
16 | class ClipboardEvent; | ||||
[email protected] | 7f44ba4 | 2012-05-31 20:26:29 | [diff] [blame] | 17 | class ClipboardStub; |
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 18 | } // namespace protocol |
19 | |||||
[email protected] | 98f99a0 | 2012-05-16 18:03:32 | [diff] [blame] | 20 | // All Clipboard methods should be run on the UI thread, so that the Clipboard |
21 | // can get change notifications. | ||||
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 22 | class Clipboard { |
23 | public: | ||||
[email protected] | e19c2fc0 | 2012-07-10 01:18:20 | [diff] [blame] | 24 | virtual ~Clipboard() {} |
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 25 | |
26 | // Initialises any objects needed to read from or write to the clipboard. | ||||
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 27 | virtual void Start( |
28 | std::unique_ptr<protocol::ClipboardStub> client_clipboard) = 0; | ||||
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 29 | |
[email protected] | 98f99a0 | 2012-05-16 18:03:32 | [diff] [blame] | 30 | // Writes an item to the clipboard. It must be called after Start(). |
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 31 | virtual void InjectClipboardEvent(const protocol::ClipboardEvent& event) = 0; |
32 | |||||
dcheng | 0765c49 | 2016-04-06 22:41:53 | [diff] [blame] | 33 | static std::unique_ptr<Clipboard> Create(); |
[email protected] | 6d17db9 | 2012-05-11 17:03:14 | [diff] [blame] | 34 | }; |
35 | |||||
36 | } // namespace remoting | ||||
37 | |||||
38 | #endif // REMOTING_HOST_CLIPBOARD_H_ |