Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame^] | 1 | #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 | |
| 8 | namespace android { |
| 9 | namespace dvr { |
| 10 | |
| 11 | class VirtualTouchpadService : public BnVirtualTouchpadService { |
| 12 | public: |
| 13 | VirtualTouchpadService(VirtualTouchpad& touchpad) |
| 14 | : touchpad_(touchpad) {} |
| 15 | |
| 16 | // Must be called before clients can connect. |
| 17 | // Returns 0 if initialization is successful. |
| 18 | int Initialize(); |
| 19 | |
| 20 | static char const* getServiceName() { return "virtual_touchpad"; } |
| 21 | |
| 22 | protected: |
| 23 | // Implements IVirtualTouchpadService. |
| 24 | ::android::binder::Status touch(float x, float y, float pressure) override; |
| 25 | |
| 26 | private: |
| 27 | VirtualTouchpad& touchpad_; |
| 28 | |
| 29 | VirtualTouchpadService(const VirtualTouchpadService&) = delete; |
| 30 | void operator=(const VirtualTouchpadService&) = delete; |
| 31 | }; |
| 32 | |
| 33 | } // namespace dvr |
| 34 | } // namespace android |
| 35 | |
| 36 | #endif // ANDROID_DVR_VIRTUAL_TOUCHPAD_SERVICE_H |