blob: e2426e3700e5f6de728d2622ddbae975b6a32085 [file] [log] [blame]
Alex Vakulenkoe4eec202017-01-27 14:41:04 -08001#ifndef ANDROID_DVR_VIRTUAL_TOUCHPAD_SERVICE_H
2#define ANDROID_DVR_VIRTUAL_TOUCHPAD_SERVICE_H
3
4#include <android/dvr/BnVirtualTouchpadService.h>
5
6#include "VirtualTouchpad.h"
7
8namespace android {
9namespace dvr {
10
Kevin Schoedel43b5b062017-01-19 13:46:17 -050011// VirtualTouchpadService implements the service side of
12// the Binder interface defined in VirtualTouchpadService.aidl.
13//
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080014class VirtualTouchpadService : public BnVirtualTouchpadService {
15 public:
16 VirtualTouchpadService(VirtualTouchpad& touchpad)
17 : touchpad_(touchpad) {}
18
19 // Must be called before clients can connect.
20 // Returns 0 if initialization is successful.
21 int Initialize();
22
23 static char const* getServiceName() { return "virtual_touchpad"; }
24
25 protected:
26 // Implements IVirtualTouchpadService.
27 ::android::binder::Status touch(float x, float y, float pressure) override;
Kevin Schoedel43b5b062017-01-19 13:46:17 -050028 ::android::binder::Status buttonState(int buttons) override;
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080029
30 private:
31 VirtualTouchpad& touchpad_;
32
33 VirtualTouchpadService(const VirtualTouchpadService&) = delete;
34 void operator=(const VirtualTouchpadService&) = delete;
35};
36
37} // namespace dvr
38} // namespace android
39
40#endif // ANDROID_DVR_VIRTUAL_TOUCHPAD_SERVICE_H