blob: 35517f1b2a15bad97404c34f413c86bedbd1c132 [file] [log] [blame]
Paul Keith5b3bd862019-01-08 23:45:03 +01001/*
2 * Copyright (C) 2019 The LineageOS Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef VENDOR_LINEAGE_TOUCH_V1_0_TOUCHSCREENGESTURE_H
18#define VENDOR_LINEAGE_TOUCH_V1_0_TOUCHSCREENGESTURE_H
19
Paul Keith5b3bd862019-01-08 23:45:03 +010020#include <hidl/MQDescriptor.h>
21#include <hidl/Status.h>
Jan Altensen6f3af5a2019-07-20 01:00:46 +020022#include <vendor/lineage/touch/1.0/ITouchscreenGesture.h>
Paul Keith5b3bd862019-01-08 23:45:03 +010023
24namespace vendor {
25namespace lineage {
26namespace touch {
27namespace V1_0 {
Paul Keith2b27b272019-01-09 00:11:40 +010028namespace samsung {
Paul Keith5b3bd862019-01-08 23:45:03 +010029
30using ::android::hardware::hidl_array;
31using ::android::hardware::hidl_memory;
32using ::android::hardware::hidl_string;
33using ::android::hardware::hidl_vec;
34using ::android::hardware::Return;
35using ::android::hardware::Void;
36using ::android::sp;
37
Paul Keith2b27b272019-01-09 00:11:40 +010038class TouchscreenGesture : public ITouchscreenGesture {
39 public:
40 bool isSupported();
Paul Keith5b3bd862019-01-08 23:45:03 +010041
Paul Keith2b27b272019-01-09 00:11:40 +010042 // Methods from ::vendor::lineage::touch::V1_0::ITouchscreenGesture follow.
43 Return<void> getSupportedGestures(getSupportedGestures_cb resultCb) override;
44 Return<bool> setGestureEnabled(const ::vendor::lineage::touch::V1_0::Gesture& gesture,
45 bool enabled) override;
46
47 private:
48 typedef struct {
49 int32_t keycode;
50 const char* name;
51 } GestureInfo;
52 static const std::map<int32_t, GestureInfo> kGestureInfoMap; // id -> info
Paul Keith5b3bd862019-01-08 23:45:03 +010053};
54
55// FIXME: most likely delete, this is only for passthrough implementations
56// extern "C" ITouchscreenGesture* HIDL_FETCH_ITouchscreenGesture(const char* name);
57
Paul Keith2b27b272019-01-09 00:11:40 +010058} // namespace samsung
Paul Keith5b3bd862019-01-08 23:45:03 +010059} // namespace V1_0
60} // namespace touch
61} // namespace lineage
62} // namespace vendor
63
64#endif // VENDOR_LINEAGE_TOUCH_V1_0_TOUCHSCREENGESTURE_H