1 #ifndef DALI_DEVEL_ATSPI_ACCESSIBILITY_H
2 #define DALI_DEVEL_ATSPI_ACCESSIBILITY_H
4 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
24 #include <dali/public-api/dali-adaptor-common.h>
28 namespace AtspiAccessibility
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
40 DALI_ADAPTOR_API void Say(const std::string& text, bool discardable, std::function<void(std::string)> callback);
43 * @brief Force accessibility client to pause.
45 DALI_ADAPTOR_API void Pause();
48 * @brief Force accessibility client to resume.
50 DALI_ADAPTOR_API void Resume();
53 * @brief Cancels anything screen-reader is reading / has queued to read
55 * @param alsoNonDiscardable whether to cancel non-discardable readings as well
57 DALI_ADAPTOR_API void StopReading(bool alsoNonDiscardable = false);
60 * @brief Suppresses reading of screen-reader
62 * @param suppress whether to suppress reading of screen-reader
63 * @return true on success, false otherwise
65 DALI_ADAPTOR_API bool SuppressScreenReader(bool suppress);
68 * @brief Sets ATSPI to be turned On or Off forcibly.
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)
74 DALI_ADAPTOR_API int SetForcefully(bool turnOn);
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)
81 DALI_ADAPTOR_API int GetStatus();
84 * @brief Returns whether the state of Accessibility is enabled or not.
86 * @return True if Accessibility is enabled, false otherwise.
88 DALI_ADAPTOR_API bool IsEnabled();
91 * @brief Returns whether the state of Screen Reader is enabled or not.
93 * @return True if Screen Reader is enabled, false otherwise.
95 DALI_ADAPTOR_API bool IsScreenReaderEnabled();
97 } //namespace AtspiAccessibility
100 #endif // DALI_DEVEL_ATSPI_ACCESSIBILITY_H