| 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 |  | 
|  | 17 | #ifndef _UI_INPUTREADER_INPUT_READER_CONTEXT_H | 
|  | 18 | #define _UI_INPUTREADER_INPUT_READER_CONTEXT_H | 
|  | 19 |  | 
|  | 20 | #include <input/InputDevice.h> | 
|  | 21 |  | 
|  | 22 | #include <vector> | 
|  | 23 |  | 
|  | 24 | namespace android { | 
|  | 25 |  | 
|  | 26 | class EventHubInterface; | 
|  | 27 | class InputDevice; | 
|  | 28 | class InputListenerInterface; | 
|  | 29 | class InputMapper; | 
|  | 30 | class InputReaderPolicyInterface; | 
| Prabir Pradhan | c7ef27e | 2020-02-03 19:19:15 -0800 | [diff] [blame] | 31 | class PointerControllerInterface; | 
| Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 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 |  | 
|  | 48 | virtual void fadePointer() = 0; | 
| Michael Wright | 7a37667 | 2020-06-26 20:51:44 +0100 | [diff] [blame] | 49 | virtual std::shared_ptr<PointerControllerInterface> getPointerController(int32_t deviceId) = 0; | 
| Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 50 |  | 
|  | 51 | virtual void requestTimeoutAtTime(nsecs_t when) = 0; | 
|  | 52 | virtual int32_t bumpGeneration() = 0; | 
|  | 53 |  | 
|  | 54 | virtual void getExternalStylusDevices(std::vector<InputDeviceInfo>& outDevices) = 0; | 
|  | 55 | virtual void dispatchExternalStylusState(const StylusState& outState) = 0; | 
|  | 56 |  | 
|  | 57 | virtual InputReaderPolicyInterface* getPolicy() = 0; | 
|  | 58 | virtual InputListenerInterface* getListener() = 0; | 
|  | 59 | virtual EventHubInterface* getEventHub() = 0; | 
|  | 60 |  | 
| Garfield Tan | c51d1ba | 2020-01-28 13:24:04 -0800 | [diff] [blame] | 61 | virtual int32_t getNextId() = 0; | 
| Prabir Pradhan | baa5c82 | 2019-08-30 15:27:05 -0700 | [diff] [blame] | 62 | }; | 
|  | 63 |  | 
|  | 64 | } // namespace android | 
|  | 65 |  | 
|  | 66 | #endif // _UI_INPUTREADER_INPUT_READER_CONTEXT_H |