Use existing callback ID for recurring callbacks
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / accessibility-action-handler.h
1 #ifndef DALI_ACCESSIBILITY_ACTION_HANDLER_H
2 #define DALI_ACCESSIBILITY_ACTION_HANDLER_H
3
4 /*
5  * Copyright (c) 2020 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 <dali/public-api/dali-adaptor-common.h>
23 #include <dali/public-api/events/touch-event.h>
24
25 namespace Dali
26 {
27 /**
28  * AccessibilityActionHandler is an abstract interface, used by Dali to handle accessibility actions
29  * passed by the accessibility manager.
30  */
31 class AccessibilityActionHandler
32 {
33 public:
34   /**
35    * Change the accessibility status when Accessibility feature(screen-reader) turned on or off.
36    * @return whether the status is changed or not.
37    */
38   virtual bool ChangeAccessibilityStatus() = 0;
39
40   /**
41    * Clear the accessibility focus from the current focused actor.
42    * @return whether the focus is cleared or not.
43    */
44   virtual bool ClearAccessibilityFocus() = 0;
45
46   /**
47    * Perform the accessibility action associated with a scroll event.
48    * @param touch The touch point (and time) of the event.
49    * @return whether the focus is cleared or not.
50    */
51   virtual bool AccessibilityActionScroll(Dali::TouchEvent& touch) = 0;
52
53   /**
54    * Perform the accessibility action to move focus to the previous focusable actor (by one finger flick up).
55    * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
56    * @return whether the accessibility action is performed or not.
57    */
58   virtual bool AccessibilityActionPrevious(bool allowEndFeedback) = 0;
59
60   /**
61    * Perform the accessibility action to move focus to the next focusable actor (by one finger flick down).
62    * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
63    * @return whether the accessibility action is performed or not.
64    */
65   virtual bool AccessibilityActionNext(bool allowEndFeedback) = 0;
66
67   /**
68    * Perform the accessibility action to move focus to the previous focusable actor (by one finger flick left).
69    * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
70    * @return whether the accessibility action is performed or not.
71    */
72   virtual bool AccessibilityActionReadPrevious(bool allowEndFeedback) = 0;
73
74   /**
75    * Perform the accessibility action to move focus to the next focusable actor (by one finger flick right).
76    * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
77    * @return whether the accessibility action is performed or not.
78    */
79   virtual bool AccessibilityActionReadNext(bool allowEndFeedback) = 0;
80
81   /**
82    * Perform the accessibility action to focus and read the actor (by one finger tap or move).
83    * @param allowReadAgain true if the action read again the same object (i.e. read action)
84    *                       false if the action just read when the focus object is changed (i.e. over action)
85    * @return whether the accessibility action is performed or not.
86    */
87   virtual bool AccessibilityActionRead(bool allowReadAgain) = 0;
88
89   /**
90    * Perform the accessibility action to activate the current focused actor (by one finger double tap).
91    * @return whether the accessibility action is performed or not.
92    */
93   virtual bool AccessibilityActionActivate() = 0;
94
95   /**
96    * Perform the accessibility action to change the value when the current focused actor is a slider
97    * (by double finger down and move up and right).
98    * @return whether the accessibility action is performed or not.
99    */
100   virtual bool AccessibilityActionUp() = 0;
101
102   /**
103    * Perform the accessibility action to change the value when the current focused actor is a slider
104    * (by double finger down and move down and left).
105    * @return whether the accessibility action is performed or not.
106    */
107   virtual bool AccessibilityActionDown() = 0;
108
109   /**
110    * Perform the accessibility action to navigate back (by two fingers circle draw).
111    * @return whether the accessibility action is performed or not.
112    */
113   virtual bool AccessibilityActionBack() = 0;
114
115   /**
116    * Perform the accessibility action to scroll up the list and focus on the first item on the list
117    * after the scrolling and read the item (by two finger swipe up).
118    * @return whether the accessibility action is performed or not.
119    */
120   virtual bool AccessibilityActionScrollUp() = 0;
121
122   /**
123    * Perform the accessibility action to scroll down the list and focus on the first item on the list
124    * after the scrolling and read the item (by two finger swipe down).
125    * @return whether the accessibility action is performed or not.
126    */
127   virtual bool AccessibilityActionScrollDown() = 0;
128
129   /**
130    * Perform the accessibility action to scroll left to the previous page (by two finger swipe left).
131    * @return whether the accessibility action is performed or not.
132    */
133   virtual bool AccessibilityActionPageLeft() = 0;
134
135   /**
136    * Perform the accessibility action to scroll right to the next page (by two finger swipe right).
137    * @return whether the accessibility action is performed or not.
138    */
139   virtual bool AccessibilityActionPageRight() = 0;
140
141   /**
142    * Perform the accessibility action to scroll up to the previous page (by one finger swipe left and right).
143    * @return whether the accessibility action is performed or not.
144    */
145   virtual bool AccessibilityActionPageUp() = 0;
146
147   /**
148    * Perform the accessibility action to scroll down to the next page (by one finger swipe right and left).
149    * @return whether the accessibility action is performed or not.
150    */
151   virtual bool AccessibilityActionPageDown() = 0;
152
153   /**
154    * Perform the accessibility action to move the focus to the first item on the screen
155    * (by one finger swipe up and down).
156    * @return whether the accessibility action is performed or not.
157    */
158   virtual bool AccessibilityActionMoveToFirst() = 0;
159
160   /**
161    * Perform the accessibility action to move the focus to the last item on the screen
162    * (by one finger swipe down and up).
163    * @return whether the accessibility action is performed or not.
164    */
165   virtual bool AccessibilityActionMoveToLast() = 0;
166
167   /**
168    * Perform the accessibility action to move the focus to the first item on the top
169    * and read from the top item continuously (by three fingers single tap).
170    * @return whether the accessibility action is performed or not.
171    */
172   virtual bool AccessibilityActionReadFromTop() = 0;
173
174   /**
175    * Perform the accessibility action to move the focus to and read from the next item
176    * continuously (by three fingers double tap).
177    * @return whether the accessibility action is performed or not.
178    */
179   virtual bool AccessibilityActionReadFromNext() = 0;
180
181   /**
182    * Perform the accessibility action to move the focus to do the zooming (by one finger triple tap).
183    * @return whether the accessibility action is performed or not.
184    */
185   virtual bool AccessibilityActionZoom() = 0;
186
187   /**
188    * Perform the accessibility action to pause/resume the current read out (by two fingers single tap).
189    * @return whether the accessibility action is performed or not.
190    */
191   virtual bool AccessibilityActionReadPauseResume() = 0;
192
193   /**
194    * Perform the accessibility action to start/stop the current action (by two fingers double tap).
195    * @return whether the accessibility action is performed or not.
196    */
197   virtual bool AccessibilityActionStartStop() = 0;
198
199 }; // class AccessibilityActionHandler
200
201 } // namespace Dali
202
203 #endif // DALI_ACCESSIBILITY_ACTION_HANDLER_H