Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / atspi-accessibility.h
1 #ifndef DALI_DEVEL_ATSPI_ACCESSIBILITY_H
2 #define DALI_DEVEL_ATSPI_ACCESSIBILITY_H
3 /*
4  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 // EXTERNAL INCLUDES
21 #include <functional>
22
23 // INTERNAL INCLUDES
24 #include <dali/public-api/dali-adaptor-common.h>
25
26 namespace Dali
27 {
28 namespace AtspiAccessibility
29 {
30 /**
31  * @brief Reads given text by screen reader
32  * @param text The text to read
33  * @param discardable If TRUE, reading can be discarded by subsequent reading requests,
34  * if FALSE the reading must finish before next reading request can be started
35  * @param callback the callback function that is called on reading signals emitted
36  * during processing of this reading request.
37  * Callback can be one of the following signals:
38  * ReadingCancelled, ReadingStopped, ReadingSkipped
39  */
40 DALI_ADAPTOR_API void Say(const std::string& text, bool discardable, std::function<void(std::string)> callback);
41
42 /**
43  * @brief Force accessibility client to pause.
44  */
45 DALI_ADAPTOR_API void Pause();
46
47 /**
48  * @brief Force accessibility client to resume.
49  */
50 DALI_ADAPTOR_API void Resume();
51
52 /**
53  * @brief Cancels anything screen-reader is reading / has queued to read
54  *
55  * @param alsoNonDiscardable whether to cancel non-discardable readings as well
56  */
57 DALI_ADAPTOR_API void StopReading(bool alsoNonDiscardable = false);
58
59 /**
60  * @brief Suppresses reading of screen-reader
61  *
62  * @param suppress whether to suppress reading of screen-reader
63  * @return true on success, false otherwise
64  */
65 DALI_ADAPTOR_API bool SuppressScreenReader(bool suppress);
66
67 /**
68  * @brief Sets ATSPI to be turned On or Off forcibly.
69  *
70  * @param[in] turnOn true to turn on, false to turn off.
71  * @return The status of ATSPI : 0(ATSPI OFF, ScreenReader OFF), 1(ATSPI ON, ScreenReader OFF),
72  * 2 (ATSPI OFF, ScreenReader ON), 3(ATSPI ON, ScreenReader ON)
73  */
74 DALI_ADAPTOR_API int SetForcefully(bool turnOn);
75
76 /**
77  * @brief Gets ATSPI status.
78  * @return Status of ATSPI : 0(ATSPI OFF, ScreenReader OFF), 1(ATSPI ON, ScreenReader OFF),
79  * 2 (ATSPI OFF, ScreenReader ON), 3(ATSPI ON, ScreenReader ON)
80  */
81 DALI_ADAPTOR_API int GetStatus();
82
83 /**
84  * @brief Returns whether the state of Accessibility is enabled or not.
85  *
86  * @return True if Accessibility is enabled, false otherwise.
87  */
88 DALI_ADAPTOR_API bool IsEnabled();
89
90 /**
91  * @brief Returns whether the state of Screen Reader is enabled or not.
92  *
93  * @return True if Screen Reader is enabled, false otherwise.
94  */
95 DALI_ADAPTOR_API bool IsScreenReaderEnabled();
96
97 } //namespace AtspiAccessibility
98 } //namespace Dali
99
100 #endif // DALI_DEVEL_ATSPI_ACCESSIBILITY_H