Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 The Android Open Source 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 | |
Prabir Pradhan | 4810866 | 2022-09-09 21:22:04 +0000 | [diff] [blame] | 17 | #pragma once |
Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 18 | |
| 19 | #include <input/InputDevice.h> |
Vaibhav Devmurari | e58ffb9 | 2024-05-22 17:38:25 +0000 | [diff] [blame] | 20 | #include <input/KeyboardClassifier.h> |
Siarhei Vishniakou | 2935db7 | 2022-09-22 13:35:22 -0700 | [diff] [blame] | 21 | #include "NotifyArgs.h" |
Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 22 | |
| 23 | #include <vector> |
| 24 | |
| 25 | namespace android { |
| 26 | |
| 27 | class EventHubInterface; |
| 28 | class InputDevice; |
| 29 | class InputListenerInterface; |
| 30 | class InputMapper; |
| 31 | class InputReaderPolicyInterface; |
| 32 | struct StylusState; |
| 33 | |
| 34 | /* Internal interface used by individual input devices to access global input device state |
| 35 | * and parameters maintained by the input reader. |
| 36 | */ |
| 37 | class InputReaderContext { |
| 38 | public: |
| 39 | InputReaderContext() {} |
| 40 | virtual ~InputReaderContext() {} |
| 41 | |
| 42 | virtual void updateGlobalMetaState() = 0; |
| 43 | virtual int32_t getGlobalMetaState() = 0; |
| 44 | |
| 45 | virtual void disableVirtualKeysUntil(nsecs_t time) = 0; |
Nathaniel R. Lewis | 26ec222 | 2020-01-10 16:30:54 -0800 | [diff] [blame] | 46 | virtual bool shouldDropVirtualKey(nsecs_t now, int32_t keyCode, int32_t scanCode) = 0; |
Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 47 | |
Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 48 | virtual void requestTimeoutAtTime(nsecs_t when) = 0; |
| 49 | virtual int32_t bumpGeneration() = 0; |
| 50 | |
| 51 | virtual void getExternalStylusDevices(std::vector<InputDeviceInfo>& outDevices) = 0; |
Siarhei Vishniakou | 2935db7 | 2022-09-22 13:35:22 -0700 | [diff] [blame] | 52 | [[nodiscard]] virtual std::list<NotifyArgs> dispatchExternalStylusState( |
| 53 | const StylusState& outState) = 0; |
Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 54 | |
| 55 | virtual InputReaderPolicyInterface* getPolicy() = 0; |
Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 56 | virtual EventHubInterface* getEventHub() = 0; |
| 57 | |
Siarhei Vishniakou | f2f073b | 2021-02-09 21:59:56 +0000 | [diff] [blame] | 58 | virtual int32_t getNextId() = 0; |
| 59 | |
arthurhung | c903df1 | 2020-08-11 15:08:42 +0800 | [diff] [blame] | 60 | virtual void updateLedMetaState(int32_t metaState) = 0; |
| 61 | virtual int32_t getLedMetaState() = 0; |
Arpit Singh | a5ea7c1 | 2023-07-05 15:39:25 +0000 | [diff] [blame] | 62 | |
| 63 | virtual void setPreventingTouchpadTaps(bool prevent) = 0; |
| 64 | virtual bool isPreventingTouchpadTaps() = 0; |
Arpit Singh | 82e413e | 2023-10-10 19:30:58 +0000 | [diff] [blame] | 65 | |
| 66 | virtual void setLastKeyDownTimestamp(nsecs_t when) = 0; |
| 67 | virtual nsecs_t getLastKeyDownTimestamp() = 0; |
Vaibhav Devmurari | e58ffb9 | 2024-05-22 17:38:25 +0000 | [diff] [blame] | 68 | |
| 69 | virtual KeyboardClassifier& getKeyboardClassifier() = 0; |
Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 70 | }; |
| 71 | |
| 72 | } // namespace android |