clipboard.h 1019 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. #ifndef REMOTING_HOST_CLIPBOARD_H_
  5. #define REMOTING_HOST_CLIPBOARD_H_
  6. #include <memory>
  7. #include <string>
  8. #include "base/callback.h"
  9. namespace remoting {
  10. namespace protocol {
  11. class ClipboardEvent;
  12. class ClipboardStub;
  13. } // namespace protocol
  14. // All Clipboard methods should be run on the UI thread, so that the Clipboard
  15. // can get change notifications.
  16. class Clipboard {
  17. public:
  18. virtual ~Clipboard() {}
  19. // Initialises any objects needed to read from or write to the clipboard.
  20. virtual void Start(
  21. std::unique_ptr<protocol::ClipboardStub> client_clipboard) = 0;
  22. // Writes an item to the clipboard. It must be called after Start().
  23. virtual void InjectClipboardEvent(const protocol::ClipboardEvent& event) = 0;
  24. static std::unique_ptr<Clipboard> Create();
  25. };
  26. } // namespace remoting
  27. #endif // REMOTING_HOST_CLIPBOARD_H_