OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 REMOTING_CLIENT_CHROMOTING_VIEW_H_ | 5 #ifndef REMOTING_CLIENT_CHROMOTING_VIEW_H_ |
6 #define REMOTING_CLIENT_CHROMOTING_VIEW_H_ | 6 #define REMOTING_CLIENT_CHROMOTING_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "remoting/protocol/connection_to_host.h" | 9 #include "remoting/protocol/connection_to_host.h" |
10 | 10 |
11 namespace remoting { | 11 namespace remoting { |
12 | 12 |
13 static const uint32 kCreatedColor = 0xffccccff; | |
14 static const uint32 kDisconnectedColor = 0xff00ccff; | |
15 static const uint32 kFailedColor = 0xffcc00ff; | |
16 | |
17 // ChromotingView defines the behavior of an object that draws a view of the | 13 // ChromotingView defines the behavior of an object that draws a view of the |
18 // remote desktop. Its main function is to render the update stream onto the | 14 // remote desktop. Its main function is to render the update stream onto the |
19 // screen. | 15 // screen. |
20 class ChromotingView { | 16 class ChromotingView { |
21 public: | 17 public: |
22 virtual ~ChromotingView() {} | 18 virtual ~ChromotingView() {} |
23 | 19 |
24 // Initialize the common structures for the view. | 20 // Initialize the common structures for the view. |
25 virtual bool Initialize() = 0; | 21 virtual bool Initialize() = 0; |
26 | 22 |
27 // Free up resources allocated by this view. | 23 // Free up resources allocated by this view. |
28 virtual void TearDown() = 0; | 24 virtual void TearDown() = 0; |
29 | 25 |
30 // Tells the ChromotingView to paint the current image on the screen. | |
31 virtual void Paint() = 0; | |
32 | |
33 // Fill the screen with one single static color, and ignore updates. | |
34 // Useful for debugging. | |
35 virtual void SetSolidFill(uint32 color) = 0; | |
36 | |
37 // Removes a previously set solid fill. If no fill was previous set, this | |
38 // does nothing. | |
39 virtual void UnsetSolidFill() = 0; | |
40 | |
41 // Record the update the state of the connection, updating the UI as needed. | 26 // Record the update the state of the connection, updating the UI as needed. |
42 virtual void SetConnectionState(protocol::ConnectionToHost::State state, | 27 virtual void SetConnectionState(protocol::ConnectionToHost::State state, |
43 protocol::ConnectionToHost::Error error) = 0; | 28 protocol::ConnectionToHost::Error error) = 0; |
44 }; | 29 }; |
45 | 30 |
46 } // namespace remoting | 31 } // namespace remoting |
47 | 32 |
48 #endif // REMOTING_CLIENT_CHROMOTING_VIEW_H_ | 33 #endif // REMOTING_CLIENT_CHROMOTING_VIEW_H_ |
OLD | NEW |