return; // node no longer editable since event originally fired.
FireEvent(wrapper, ax::mojom::Event::kValueChanged);
break;
+#if defined(TIZEN_ATK_FEATURE_VD)
+ case ui::AXEventGenerator::Event::LIVE_REGION_NODE_CHANGED:
+ FireEvent(wrapper, ax::mojom::Event::kLiveRegionChanged);
+ break;
+#endif
// Currently unused events on this platform.
case ui::AXEventGenerator::Event::NONE:
case ui::AXEventGenerator::Event::LAYOUT_INVALIDATED:
case ui::AXEventGenerator::Event::LIVE_REGION_CHANGED:
case ui::AXEventGenerator::Event::LIVE_REGION_CREATED:
+#if !defined(TIZEN_ATK_FEATURE_VD)
case ui::AXEventGenerator::Event::LIVE_REGION_NODE_CHANGED:
+#endif
case ui::AXEventGenerator::Event::LIVE_RELEVANT_CHANGED:
case ui::AXEventGenerator::Event::LIVE_STATUS_CHANGED:
case ui::AXEventGenerator::Event::MULTILINE_STATE_CHANGED:
#include "base/strings/string_util.h"
#include "tizen/system_info.h"
+#include "ui/accessibility/ax_enum_util.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/display/device_display_info_efl.h"
#include "ui/display/display.h"
AXPlatformNodeAuraLinux::NotifyAccessibilityEvent(event_type);
switch (event_type) {
-#if defined(TIZEN_ATK_FEATURE_VD) && !defined(EWK_BRINGUP)
+#if defined(TIZEN_ATK_FEATURE_VD)
case ax::mojom::Event::kLiveRegionChanged:
OnLiveRegionChanged();
break;
}
#if defined(TIZEN_ATK_FEATURE_VD)
+void AXPlatformNodeEfl::OnLiveRegionChanged() {
+ gfx::NativeViewAccessible native_object = GetNativeViewAccessible();
+ if (!ATK_IS_OBJECT(native_object))
+ return;
+
+ std::string text_to_emit;
+ int member_of_id = 0;
+ AXPlatformNodeAuraLinux* root_node = nullptr;
+
+ if (GetBoolAttribute(ax::mojom::BoolAttribute::kBusy) ||
+ GetBoolAttribute(ax::mojom::BoolAttribute::kContainerLiveBusy) ||
+ ax::mojom::Role::kLineBreak == GetData().role)
+ return;
+
+ if (GetBoolAttribute(ax::mojom::BoolAttribute::kContainerLiveAtomic)) {
+ if (GetIntAttribute(ax::mojom::IntAttribute::kMemberOfId, &member_of_id))
+ root_node = static_cast<AXPlatformNodeAuraLinux*>(
+ delegate_->GetFromNodeID(member_of_id));
+ if (root_node)
+ text_to_emit = ToAXPlatformNodeEfl(root_node)->GetSubTreeSpeechContent();
+ else
+ LOG(INFO) << "aria live atomic, but can not find live root.";
+ } else {
+ text_to_emit = GetSpeechContent();
+ }
+
+ if (text_to_emit.empty())
+ return;
+
+ LOG(INFO) << "AXPlatformNodeEfl::OnLiveRegionChanged emit "
+ << "text-insert event for node: " << GetData().id
+ << ", text: " << text_to_emit.data();
+ g_signal_emit_by_name(native_object, "text-insert", 0, text_to_emit.length(),
+ text_to_emit.data());
+}
+
std::string AXPlatformNodeEfl::GetSupplementaryText() const {
// name and description have been got from BrowserAccessibilityAuraLinux
// if return here again, it will be speak twice
gchar* GetObjectText() const;
bool IsAccessible() const;
#if defined(TIZEN_ATK_FEATURE_VD)
+ void OnLiveRegionChanged();
std::string GetSupplementaryText() const;
std::string GetSubTreeSpeechContent() const;
std::string GetSpeechContent();
SetActiveViewsDialog();
if (g_current_focused) {
+#if defined(TIZEN_ATK_FEATURE_VD)
+ LOG(INFO) << "AXPlatformNodeAuraLinux::OnFocused emit old_focus "
+ "for node: "
+ << GetData().ToString();
+#endif
g_signal_emit_by_name(g_current_focused, "focus-event", false);
atk_object_notify_state_change(ATK_OBJECT(g_current_focused),
ATK_STATE_FOCUSED, false);
}
SetWeakGPtrToAtkObject(&g_current_focused, atk_object);
+#if defined(TIZEN_ATK_FEATURE_VD)
+ LOG(INFO) << "AXPlatformNodeAuraLinux::OnFocused emit new_focus "
+ "for node: "
+ << GetData().ToString();
+#endif
g_signal_emit_by_name(g_current_focused, "focus-event", true);
atk_object_notify_state_change(ATK_OBJECT(g_current_focused),
return;
}
+#if defined(TIZEN_ATK_FEATURE_VD)
+ // UpdateHypertext() trigger to emit event to screen reader, but for tv,
+ // it conflicts with AXPlatformNodeEfl::OnLiveRegionChanged().
+ if (IsInLiveRegion())
+ return;
+#endif
+
if (!EmitsAtkTextEvents())
return;
size_t shared_unicode_suffix = shared_prefix + old_len;
base::OffsetAdjuster::AdjustOffset(old_adjustments, &shared_unicode_suffix);
+#if defined(TIZEN_ATK_FEATURE_VD)
+ LOG(INFO) << "AXPlatformNodeAuraLinux::UpdateHypertext emit text-remove "
+ << "event and emit string is: "
+ << base::UTF16ToUTF8(removed_substring).c_str();
+#endif
+
g_signal_emit_by_name(
atk_object, "text-remove",
shared_unicode_prefix, // position of removal
size_t shared_unicode_prefix = UTF16ToUnicodeOffsetInText(shared_prefix);
size_t shared_unicode_suffix =
UTF16ToUnicodeOffsetInText(shared_prefix + new_len);
+#if defined(TIZEN_ATK_FEATURE_VD)
+ LOG(INFO) << "AXPlatformNodeAuraLinux::UpdateHypertext emit text-insert "
+ << "event and emit string is: "
+ << base::UTF16ToUTF8(inserted_substring).c_str() << "over";
+#endif
g_signal_emit_by_name(
atk_object, "text-insert",
shared_unicode_prefix, // position of insertion