client_user_interface.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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_CLIENT_CLIENT_USER_INTERFACE_H_
  5. #define REMOTING_CLIENT_CLIENT_USER_INTERFACE_H_
  6. #include <memory>
  7. #include <string>
  8. #include "remoting/protocol/connection_to_host.h"
  9. #include "remoting/protocol/third_party_client_authenticator.h"
  10. namespace webrtc {
  11. class DesktopSize;
  12. class DesktopVector;
  13. } // namespace webrtc
  14. namespace remoting {
  15. namespace protocol {
  16. class ClipboardStub;
  17. class CursorShapeStub;
  18. class ExtensionMessage;
  19. class KeyboardLayoutStub;
  20. class PairingResponse;
  21. } // namespace protocol
  22. // ClientUserInterface is an interface that must be implemented by
  23. // applications embedding the Chromoting client, to provide client's user
  24. // interface.
  25. //
  26. // TODO(sergeyu): Cleanup this interface, see crbug.com/138108 .
  27. class ClientUserInterface {
  28. public:
  29. virtual ~ClientUserInterface() {}
  30. // Record the update the state of the connection, updating the UI as needed.
  31. virtual void OnConnectionState(protocol::ConnectionToHost::State state,
  32. protocol::ErrorCode error) = 0;
  33. virtual void OnConnectionReady(bool ready) = 0;
  34. virtual void OnRouteChanged(const std::string& channel_name,
  35. const protocol::TransportRoute& route) = 0;
  36. // Passes the final set of capabilities negotiated between the client and host
  37. // to the application.
  38. virtual void SetCapabilities(const std::string& capabilities) = 0;
  39. // Passes a pairing response message to the client.
  40. virtual void SetPairingResponse(
  41. const protocol::PairingResponse& pairing_response) = 0;
  42. // Deliver an extension message from the host to the client.
  43. virtual void DeliverHostMessage(
  44. const protocol::ExtensionMessage& message) = 0;
  45. // Notify the client about screen dimensions. The |size| is in physical
  46. // pixels.
  47. virtual void SetDesktopSize(const webrtc::DesktopSize& size,
  48. const webrtc::DesktopVector& dpi) = 0;
  49. // Get the view's ClipboardStub implementation.
  50. virtual protocol::ClipboardStub* GetClipboardStub() = 0;
  51. // Get the view's CursorShapeStub implementation.
  52. virtual protocol::CursorShapeStub* GetCursorShapeStub() = 0;
  53. // Get the view's KeyboardLayoutStub implementation.
  54. virtual protocol::KeyboardLayoutStub* GetKeyboardLayoutStub() = 0;
  55. };
  56. } // namespace remoting
  57. #endif // REMOTING_CLIENT_CLIENT_USER_INTERFACE_H_