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