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> |
| 20 | |
| 21 | #include <vector> |
| 22 | |
| 23 | namespace android { |
| 24 | |
| 25 | class EventHubInterface; |
| 26 | class InputDevice; |
| 27 | class InputListenerInterface; |
| 28 | class InputMapper; |
| 29 | class InputReaderPolicyInterface; |
Prabir Pradhan | c7ef27e | 2020-02-03 19:19:15 -0800 | [diff] [blame] | 30 | class PointerControllerInterface; |
Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 31 | struct StylusState; |
| 32 | |
| 33 | /* Internal interface used by individual input devices to access global input device state |
| 34 | * and parameters maintained by the input reader. |
| 35 | */ |
| 36 | class InputReaderContext { |
| 37 | public: |
| 38 | InputReaderContext() {} |
| 39 | virtual ~InputReaderContext() {} |
| 40 | |
| 41 | virtual void updateGlobalMetaState() = 0; |
| 42 | virtual int32_t getGlobalMetaState() = 0; |
| 43 | |
| 44 | virtual void disableVirtualKeysUntil(nsecs_t time) = 0; |
Nathaniel R. Lewis | 26ec222 | 2020-01-10 16:30:54 -0800 | [diff] [blame] | 45 | 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] | 46 | |
| 47 | virtual void fadePointer() = 0; |
Michael Wright | 17db18e | 2020-06-26 20:51:44 +0100 | [diff] [blame] | 48 | virtual std::shared_ptr<PointerControllerInterface> getPointerController(int32_t deviceId) = 0; |
Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 49 | |
| 50 | virtual void requestTimeoutAtTime(nsecs_t when) = 0; |
| 51 | virtual int32_t bumpGeneration() = 0; |
| 52 | |
| 53 | virtual void getExternalStylusDevices(std::vector<InputDeviceInfo>& outDevices) = 0; |
| 54 | virtual void dispatchExternalStylusState(const StylusState& outState) = 0; |
| 55 | |
| 56 | virtual InputReaderPolicyInterface* getPolicy() = 0; |
Siarhei Vishniakou | 1805009 | 2021-09-01 13:32:49 -0700 | [diff] [blame] | 57 | virtual InputListenerInterface& getListener() = 0; |
Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 58 | virtual EventHubInterface* getEventHub() = 0; |
| 59 | |
Siarhei Vishniakou | f2f073b | 2021-02-09 21:59:56 +0000 | [diff] [blame] | 60 | virtual int32_t getNextId() = 0; |
| 61 | |
arthurhung | c903df1 | 2020-08-11 15:08:42 +0800 | [diff] [blame] | 62 | virtual void updateLedMetaState(int32_t metaState) = 0; |
| 63 | virtual int32_t getLedMetaState() = 0; |
Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | } // namespace android |