Jeff Brown | 928e054 | 2011-01-10 11:17:36 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 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_INPUT_APPLICATION_H |
| 18 | #define _UI_INPUT_APPLICATION_H |
| 19 | |
| 20 | #include <ui/Input.h> |
| 21 | |
| 22 | #include <utils/RefBase.h> |
| 23 | #include <utils/Timers.h> |
| 24 | #include <utils/String8.h> |
| 25 | |
| 26 | namespace android { |
| 27 | |
| 28 | /* |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame^] | 29 | * Describes the properties of an application that can receive input. |
| 30 | * |
| 31 | * Used by the native input dispatcher as a handle for the window manager objects |
Jeff Brown | 928e054 | 2011-01-10 11:17:36 -0800 | [diff] [blame] | 32 | * that describe an application. |
| 33 | */ |
| 34 | class InputApplicationHandle : public RefBase { |
Jeff Brown | 9302c87 | 2011-07-13 22:51:29 -0700 | [diff] [blame^] | 35 | public: |
| 36 | String8 name; |
| 37 | nsecs_t dispatchingTimeout; |
| 38 | |
| 39 | /** |
| 40 | * Requests that the state of this object be updated to reflect |
| 41 | * the most current available information about the application. |
| 42 | * |
| 43 | * This method should only be called from within the input dispatcher's |
| 44 | * critical section. |
| 45 | * |
| 46 | * Returns true on success, or false if the handle is no longer valid. |
| 47 | */ |
| 48 | virtual bool update() = 0; |
| 49 | |
Jeff Brown | 928e054 | 2011-01-10 11:17:36 -0800 | [diff] [blame] | 50 | protected: |
| 51 | InputApplicationHandle() { } |
| 52 | virtual ~InputApplicationHandle() { } |
| 53 | }; |
| 54 | |
Jeff Brown | 928e054 | 2011-01-10 11:17:36 -0800 | [diff] [blame] | 55 | } // namespace android |
| 56 | |
| 57 | #endif // _UI_INPUT_APPLICATION_H |