Revert "[Tizen] Fix build errors in adaptor-uv by ecore wayland"
[platform/core/uifw/dali-adaptor.git] / adaptors / emscripten / sdl-gesture-manager.h
1 #ifndef __DALI_SDL_GESTURE_MANAGER_H__
2 #define __DALI_SDL_GESTURE_MANAGER_H__
3
4 /*
5 Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved
6
7 This file is part of Dali
8
9 PROPRIETARY/CONFIDENTIAL
10
11 This software is the confidential and proprietary information of
12 SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
13 disclose such Confidential Information and shall use it only in
14 accordance with the terms of the license agreement you entered
15 into with SAMSUNG ELECTRONICS.
16
17 SAMSUNG make no representations or warranties about the suitability
18 of the software, either express or implied, including but not limited
19 to the implied warranties of merchantability, fitness for a particular
20 purpose, or non-infringement. SAMSUNG shall not be liable for any
21 damages suffered by licensee as a result of using, modifying or
22 distributing this software or its derivatives.
23 */
24
25 // INTERNAL INCLUDES
26 #include <dali/integration-api/gesture-manager.h>
27 #include <dali/public-api/common/dali-common.h>
28
29 namespace Dali
30 {
31
32 /**
33  * Concrete implementation of the gesture manager class.
34  *
35  * A stubb class to give to core in the Emscripten/browser environment
36  */
37 class DALI_IMPORT_API SdlGestureManager : public Dali::Integration::GestureManager
38 {
39
40 public:
41
42   /**
43    * Constructor
44    */
45   SdlGestureManager()
46   {
47     Initialize();
48   }
49
50   /**
51    * Destructor
52    */
53   virtual ~SdlGestureManager()
54   {
55   }
56
57   /**
58    * @copydoc Dali::Integration::GestureManager::Register(Gesture::Type)
59    */
60   virtual void Register(const Integration::GestureRequest& request)
61   {
62     mFunctionsCalled.Register = true;
63   }
64
65   /**
66    * @copydoc Dali::Integration::GestureManager::Unregister(Gesture::Type)
67    */
68   virtual void Unregister(const Integration::GestureRequest& request)
69   {
70     mFunctionsCalled.Unregister = true;
71   }
72
73   /**
74    * @copydoc Dali::Integration::GestureManager::Update(Gesture::Type)
75    */
76   virtual void Update(const Integration::GestureRequest& request)
77   {
78     mFunctionsCalled.Update = true;
79   }
80
81 public: // TEST FUNCTIONS
82
83   // Enumeration of Gesture Manager methods
84   enum SdlFuncEnum
85   {
86     RegisterType,
87     UnregisterType,
88     UpdateType,
89   };
90
91   /** Call this every test */
92   void Initialize()
93   {
94     mFunctionsCalled.Reset();
95   }
96
97   bool WasCalled(SdlFuncEnum func)
98   {
99     switch(func)
100     {
101       case RegisterType:             return mFunctionsCalled.Register;
102       case UnregisterType:           return mFunctionsCalled.Unregister;
103       case UpdateType:               return mFunctionsCalled.Update;
104     }
105     return false;
106   }
107
108   void ResetCallStatistics(SdlFuncEnum func)
109   {
110     switch(func)
111     {
112       case RegisterType:             mFunctionsCalled.Register = false; break;
113       case UnregisterType:           mFunctionsCalled.Unregister = false; break;
114       case UpdateType:               mFunctionsCalled.Update = false; break;
115     }
116   }
117
118 private:
119
120   struct SdlFunctions
121   {
122     SdlFunctions()
123     : Register(false),
124       Unregister(false),
125       Update(false)
126     {
127     }
128
129     void Reset()
130     {
131       Register = false;
132       Unregister = false;
133       Update = false;
134     }
135
136     bool Register;
137     bool Unregister;
138     bool Update;
139   };
140
141   SdlFunctions mFunctionsCalled;
142 };
143
144 } // Dali
145
146 #endif // __DALI_SDL_GESTURE_MANAGER_H__