blob: 9b880b2e572bcab401d5521a4923c07a714e3c64 [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:
Kevin Schoedel89af70b2017-03-03 18:11:37 -050016 VirtualTouchpadService(sp<VirtualTouchpad> touchpad)
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080017 : touchpad_(touchpad) {}
Kevin Schoedel3002b8a2017-03-06 14:34:39 -050018 ~VirtualTouchpadService() override {}
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080019
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080020 protected:
21 // Implements IVirtualTouchpadService.
Kevin Schoedel3002b8a2017-03-06 14:34:39 -050022 binder::Status touch(int touchpad, float x, float y, float pressure) override;
23 binder::Status buttonState(int touchpad, int buttons) override;
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080024
25 private:
Kevin Schoedel89af70b2017-03-03 18:11:37 -050026 sp<VirtualTouchpad> touchpad_;
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080027
28 VirtualTouchpadService(const VirtualTouchpadService&) = delete;
29 void operator=(const VirtualTouchpadService&) = delete;
30};
31
32} // namespace dvr
33} // namespace android
34
35#endif // ANDROID_DVR_VIRTUAL_TOUCHPAD_SERVICE_H