virtual void StopReading(bool alsoNonDiscardable) = 0;
/**
+ * @brief Suppresses reading of screen-reader
+ *
+ * @param suppress whether to suppress reading of screen-reader
+ */
+ virtual void SuppressScreenReader(bool suppress) = 0;
+
+ /**
* @brief Get screen reader status.
*/
virtual bool GetScreenReaderEnabled() = 0;
}
}
+bool Dali::AtspiAccessibility::SuppressScreenReader(bool suppress)
+{
+ if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
+ {
+ bridge->SuppressScreenReader(suppress);
+ return true;
+ }
+
+ return false;
+}
+
void Dali::AtspiAccessibility::Say(const std::string& text, bool discardable, std::function<void(std::string)> callback)
{
if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
DALI_ADAPTOR_API void StopReading(bool alsoNonDiscardable = false);
/**
+ * @brief Suppresses reading of screen-reader
+ *
+ * @param suppress whether to suppress reading of screen-reader
+ * @return true on success, false otherwise
+ */
+DALI_ADAPTOR_API bool SuppressScreenReader(bool suppress);
+
+/**
* @brief Set ATSPI to be turned On or Off forcibly.
*
* @param[in] turnOn true to turn on, false to turn off.
describedByObject};
}
+void BridgeAccessible::SuppressScreenReader(bool suppress)
+{
+ suppressScreenReader = suppress;
+}
+
DBus::ValueOrError<bool> BridgeAccessible::DoGesture(Dali::Accessibility::Gesture type, int32_t xBeg, int32_t yBeg, int32_t xEnd, int32_t yEnd, Dali::Accessibility::GestureState state, uint32_t eventTime)
{
return FindSelf()->DoGesture(Dali::Accessibility::GestureInfo{type, xBeg, xEnd, yBeg, yEnd, state, eventTime});
}
DBus::ValueOrError<std::unordered_map<std::string, std::string>> BridgeAccessible::GetAttributes()
{
- return FindSelf()->GetAttributes();
+ std::unordered_map<std::string, std::string> attributes = FindSelf()->GetAttributes();
+ if(suppressScreenReader)
+ {
+ attributes.insert({"suppress-screen-reader", "true"});
+ }
+
+ return attributes;
}
DBus::ValueOrError<std::vector<std::string>> BridgeAccessible::GetInterfaces()
{
BridgeAccessible();
void RegisterInterfaces();
+ bool suppressScreenReader = false;
public:
enum class GetNeighborSearchMode
>;
ReadingMaterialType GetReadingMaterial();
+ void SuppressScreenReader(bool) override;
DBus::ValueOrError<bool> DoGesture(Dali::Accessibility::Gesture type, int32_t xBeg, int32_t yBeg, int32_t xEnd, int32_t yEnd, Dali::Accessibility::GestureState state, uint32_t eventTime);
{
}
+ void SuppressScreenReader(bool suppress) override
+ {
+ }
+
bool GetScreenReaderEnabled() override
{
return false;