Mir
default_dispatcher_policy.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Robert Carr <robert.carr@canonical.com>
17  */
18 
19 #ifndef MIR_INPUT_ANDROID_EVENT_FILTER_DISPATCHER_POLICY_H_
20 #define MIR_INPUT_ANDROID_EVENT_FILTER_DISPATCHER_POLICY_H_
21 
22 #include "mir/input/event_filter.h"
23 
24 #include <InputDispatcher.h>
25 
26 namespace android
27 {
28 class InputEvent;
29 }
30 
31 namespace droidinput = android;
32 
33 namespace mir
34 {
35 namespace input
36 {
37 namespace android
38 {
39 //class EventFilter;
40 
41 class DefaultDispatcherPolicy : public droidinput::InputDispatcherPolicyInterface
42 {
43 public:
44  explicit DefaultDispatcherPolicy();
46 
47  void notifyConfigurationChanged(std::chrono::nanoseconds when);
48  std::chrono::nanoseconds notifyANR(droidinput::sp<droidinput::InputApplicationHandle> const& inputApplicationHandle,
49  droidinput::sp<droidinput::InputWindowHandle> const& inputWindowHandle);
50  void notifyInputChannelBroken(droidinput::sp<droidinput::InputWindowHandle> const& inputWindowHandle);
51  bool filterInputEvent(const droidinput::InputEvent* input_event,
52  uint32_t policy_flags);
53  void interceptKeyBeforeQueueing(const droidinput::KeyEvent* key_event,
54  uint32_t& policy_flags);
55  void getDispatcherConfiguration(droidinput::InputDispatcherConfiguration* outConfig);
56  bool isKeyRepeatEnabled();
57  void interceptMotionBeforeQueueing(std::chrono::nanoseconds when, uint32_t& policyFlags);
58 
59  std::chrono::nanoseconds interceptKeyBeforeDispatching(droidinput::sp<droidinput::InputWindowHandle> const& inputWindowHandle,
60  droidinput::KeyEvent const* keyEvent, uint32_t policyFlags);
61 
62  bool dispatchUnhandledKey(droidinput::sp<droidinput::InputWindowHandle> const& inputWindowHandle,
63  droidinput::KeyEvent const* keyEvent, uint32_t policyFlags,
64  droidinput::KeyEvent* outFallbackKeyEvent);
65 
66  void notifySwitch(std::chrono::nanoseconds when, int32_t switchCode, int32_t switchValue, uint32_t policyFlags);
67  void pokeUserActivity(std::chrono::nanoseconds eventTime, int32_t eventType);
68  bool checkInjectEventsPermissionNonReentrant(int32_t injectorPid, int32_t injectorUid);
69 
70 protected:
73 };
74 
75 }
76 }
77 }
78 
79 #endif // MIR_INPUT_ANDROID_EVENT_FILTER_DISPATCHER_POLICY_H_
All things Mir.
Definition: atomic_callback.h:25
void getDispatcherConfiguration(droidinput::InputDispatcherConfiguration *outConfig)
void pokeUserActivity(std::chrono::nanoseconds eventTime, int32_t eventType)
void interceptKeyBeforeQueueing(const droidinput::KeyEvent *key_event, uint32_t &policy_flags)
bool filterInputEvent(const droidinput::InputEvent *input_event, uint32_t policy_flags)
virtual ~DefaultDispatcherPolicy()
Definition: default_dispatcher_policy.h:45
DefaultDispatcherPolicy & operator=(const DefaultDispatcherPolicy &)=delete
void notifyInputChannelBroken(droidinput::sp< droidinput::InputWindowHandle > const &inputWindowHandle)
std::chrono::nanoseconds interceptKeyBeforeDispatching(droidinput::sp< droidinput::InputWindowHandle > const &inputWindowHandle, droidinput::KeyEvent const *keyEvent, uint32_t policyFlags)
std::chrono::nanoseconds notifyANR(droidinput::sp< droidinput::InputApplicationHandle > const &inputApplicationHandle, droidinput::sp< droidinput::InputWindowHandle > const &inputWindowHandle)
bool dispatchUnhandledKey(droidinput::sp< droidinput::InputWindowHandle > const &inputWindowHandle, droidinput::KeyEvent const *keyEvent, uint32_t policyFlags, droidinput::KeyEvent *outFallbackKeyEvent)
Definition: default_dispatcher_policy.h:41
void notifySwitch(std::chrono::nanoseconds when, int32_t switchCode, int32_t switchValue, uint32_t policyFlags)
Definition: android_input_receiver.h:36
bool checkInjectEventsPermissionNonReentrant(int32_t injectorPid, int32_t injectorUid)
void notifyConfigurationChanged(std::chrono::nanoseconds when)
void interceptMotionBeforeQueueing(std::chrono::nanoseconds when, uint32_t &policyFlags)

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015