OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_CLIENT_INPUT_HANDLER_H_ | |
6 #define REMOTING_CLIENT_INPUT_HANDLER_H_ | |
7 | |
8 #include <set> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/task.h" | |
12 #include "remoting/proto/event.pb.h" | |
13 | |
14 namespace remoting { | |
15 | |
16 class ClientContext; | |
17 class ChromotingView; | |
18 | |
19 namespace protocol { | |
20 class ConnectionToHost; | |
21 } // namespace protocol | |
22 | |
23 class InputHandler { | |
24 public: | |
25 InputHandler(ClientContext* context, | |
26 protocol::ConnectionToHost* connection, | |
27 ChromotingView* view); | |
28 virtual ~InputHandler(); | |
29 | |
30 virtual void Initialize() = 0; | |
31 | |
32 void ReleaseAllKeys(); | |
33 | |
34 protected: | |
35 void SendKeyEvent(bool press, int keycode); | |
36 void SendMouseMoveEvent(int x, int y); | |
37 void SendMouseButtonEvent(bool down, | |
38 protocol::MouseEvent::MouseButton button); | |
39 void SendMouseWheelEvent(int dx, int dy); | |
40 | |
41 ClientContext* context_; | |
42 protocol::ConnectionToHost* connection_; | |
43 ChromotingView* view_; | |
44 | |
45 private: | |
46 std::set<int> pressed_keys_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(InputHandler); | |
49 }; | |
50 | |
51 } // namespace remoting | |
52 | |
53 #endif // REMOTING_CLIENT_INPUT_HANDLER_H_ | |
OLD | NEW |