All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AndroidInputHandler.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "IAndroidInputHandler.h"
6 #include "KeyboardInput.h"
7 #include "AppInterface.h"
8 #include <list>
9 
10 namespace Eegeo
11 {
12  namespace Android
13  {
14  namespace Input
15  {
17  {
18  public:
20 
21  void Event_TouchRotate (const AppInterface::RotateData& data);
22  void Event_TouchRotate_Start (const AppInterface::RotateData& data);
23  void Event_TouchRotate_End (const AppInterface::RotateData& data);
24 
25  void Event_TouchPinch (const AppInterface::PinchData& data);
26  void Event_TouchPinch_Start (const AppInterface::PinchData& data);
27  void Event_TouchPinch_End (const AppInterface::PinchData& data);
28 
29  void Event_TouchPan (const AppInterface::PanData& data);
30  void Event_TouchPan_Start (const AppInterface::PanData& data);
31  void Event_TouchPan_End (const AppInterface::PanData& data);
32 
33  void Event_TouchTap (const AppInterface::TapData& data);
34  void Event_TouchDoubleTap (const AppInterface::TapData& data);
35 
36  void Event_TouchDown (const AppInterface::TouchData& data);
37  void Event_TouchMove (const AppInterface::TouchData& data);
38  void Event_TouchUp (const AppInterface::TouchData& data);
39 
40  bool Event_KeyPress(const AppInterface::KeyboardData& data);
41  void AddKeyPressListener(Eegeo::UI::NativeInput::IKeyboardInputKeyPressedHandler* handler);
42  bool RemoveKeyPressListener(Eegeo::UI::NativeInput::IKeyboardInputKeyPressedHandler* handler);
43 
44  void AddDelegateInputHandler(IAndroidInputHandler *delegate);
45  bool RemoveDelegateInputHandler(IAndroidInputHandler *delegate);
46 
47  void SetViewportOffset(float x, float y);
48  virtual float TranslateGlobalXToLocalX(float x);
49  virtual float TranslateGlobalYToLocalY(float y);
50 
51  private:
52  float m_windowOffsetX;
53  float m_windowOffsetY;
54  std::list<Eegeo::Android::Input::IAndroidInputHandler*> inputHandlerDelegates;
55  std::list<Eegeo::UI::NativeInput::IKeyboardInputKeyPressedHandler*> keyPressListeners;
56  };
57  }
58  }
59 }