Dali 3D User Interface Engine
accessibility-adaptor-impl.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_H__
2 #define __DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_H__
3 
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20 
21 // EXTERNAL INCLUDES
22 #include <string>
23 
28 
29 // INTERNAL INCLUDES
30 #include <accessibility-adaptor.h>
31 #include <accessibility-action-handler.h>
32 #include <accessibility-gesture-handler.h>
33 #include <indicator-interface.h>
35 
36 namespace Dali
37 {
38 
39 namespace Internal
40 {
41 
42 namespace Adaptor
43 {
44 
49 {
50 public:
51 
56 
64 
69  void EnableAccessibility();
70 
75  void DisableAccessibility();
76 
80  bool IsEnabled() const;
81 
85  Vector2 GetReadPosition() const;
86 
90  void SetActionHandler(AccessibilityActionHandler& handler);
91 
95  void SetGestureHandler(AccessibilityGestureHandler& handler);
96 
101  void SetIndicator( IndicatorInterface* indicator );
102 
106  virtual bool HandleActionNextEvent( bool allowEndFeedback = true);
107 
111  virtual bool HandleActionPreviousEvent( bool allowEndFeedback = true);
112 
116  virtual bool HandleActionActivateEvent();
117 
121  virtual bool HandleActionReadEvent( unsigned int x, unsigned int y, bool allowReadAgain );
122 
126  virtual bool HandleActionReadNextEvent( bool allowEndFeedback = true);
127 
131  virtual bool HandleActionReadPreviousEvent( bool allowEndFeedback = true);
132 
136  virtual bool HandleActionUpEvent();
137 
141  virtual bool HandleActionDownEvent();
142 
147 
151  bool HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp);
152 
156  bool HandleActionTouchEvent(const TouchPoint& point, unsigned long timeStamp);
157 
161  bool HandleActionBackEvent();
162 
167 
172 
177 
182 
187 
192 
197 
202 
207 
212 
217 
222 
226  bool HandleActionZoomEvent();
227 
232 
237 
242 
243 protected:
244 
248  virtual ~AccessibilityAdaptor();
249 
250 private:
251 
258  static void OnDestroy();
259 
260  // Undefined
263 
264 protected:
265 
266  Dali::Integration::TouchEventCombiner mCombiner;
267 
269 
270  AccessibilityActionHandler* mActionHandler;
271 
273 
275 
276  bool mIsEnabled : 1;
277  bool mIndicatorFocused : 1;
278 
279 public:
280 
281  // Helpers for public-api forwarding methods
282 
284  {
285  DALI_ASSERT_ALWAYS( adaptor && "AccessibilityAdaptor handle is empty" );
286 
287  BaseObject& handle = adaptor.GetBaseObject();
288 
289  return static_cast<Internal::Adaptor::AccessibilityAdaptor&>(handle);
290  }
291 
293  {
294  DALI_ASSERT_ALWAYS( adaptor && "AccessibilityAdaptor handle is empty" );
295 
296  const BaseObject& handle = adaptor.GetBaseObject();
297 
298  return static_cast<const Internal::Adaptor::AccessibilityAdaptor&>(handle);
299  }
300 
301 };
302 
303 } // namespace Adaptor
304 
305 } // namespace Internal
306 
307 } // namespace Dali
308 
309 #endif // __DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_H__
Dali Docs Home
Read more about Dali