{
if (__pAccessibilityElement == null)
{
- _LinkedList <_ListViewItemElement*> accessibilityElementList;
- _LinkedList <_ListViewItemElement>::_Iterator iter;
+ __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
+ SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityElement != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
- for (iter = __elements.begin(); iter != __elements.end(); iter++)
- {
- if (iter->elementType == LISTVIEW_ITEM_ELEMENT_TEXT)
- {
- accessibilityElementList.push_back(&(*iter));
- }
- }
+ __pAccessibilityElement->SetBounds(Rectangle(0, 0, _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().width), _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().height)));
+ __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
+ __pAccessibilityElement->SetName(L"ListViewItem");
- accessibilityElementList.sort(CompareAccessibilityElement);
+ pContainer->AddElement(*__pAccessibilityElement);
+ }
+ else
+ {
+ __pAccessibilityElement->SetBounds(Rectangle(0, 0, _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().width), _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().height)));
+ }
+ }
+}
- _LinkedList <_ListViewItemElement*>::_Iterator accessibilityIter;
- _ListViewItemElement* pElement = null;
- String accessibilityLable;
+void
+_ListViewItem::SetAccessibilityElementLabel(void)
+{
+ if (!_AccessibilityManager::IsActivated() || __pAccessibilityElement == null)
+ {
+ return;
+ }
- for (accessibilityIter = accessibilityElementList.begin(); accessibilityIter != accessibilityElementList.end(); accessibilityIter++)
- {
- pElement = *accessibilityIter;
+ _LinkedList <_ListViewItemElement*> accessibilityElementList;
+ _LinkedList <_ListViewItemElement>::_Iterator iter;
- int textLength = pElement->pTextElement->pTextObject->GetTextLength();
+ for (iter = __elements.begin(); iter != __elements.end(); iter++)
+ {
+ if ((iter->elementType == LISTVIEW_ITEM_ELEMENT_TEXT) || (iter->elementType == LISTVIEW_ITEM_ELEMENT_BITMAP))
+ {
+ accessibilityElementList.push_back(&(*iter));
+ }
+ }
- if (textLength > 0)
- {
- wchar_t* pAccessibilityText = new (std::nothrow) wchar_t[textLength + 1];
- SysTryReturnVoidResult(NID_UI_CTRL, (pAccessibilityText != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ accessibilityElementList.sort(CompareAccessibilityElement);
- pElement->pTextElement->pTextObject->GetText(pAccessibilityText, textLength);
+ _LinkedList <_ListViewItemElement*>::_Iterator accessibilityIter;
+ _ListViewItemElement* pElement = null;
+ String accessibilityLable;
- accessibilityLable += String(pAccessibilityText);
+ for (accessibilityIter = accessibilityElementList.begin(); accessibilityIter != accessibilityElementList.end(); accessibilityIter++)
+ {
+ pElement = *accessibilityIter;
- delete[] pAccessibilityText;
- }
- }
+ if (pElement->elementType == LISTVIEW_ITEM_ELEMENT_TEXT)
+ {
+ int textLength = pElement->pTextElement->pTextObject->GetTextLength();
- accessibilityElementList.clear();
+ if (textLength > 0)
+ {
+ wchar_t* pAccessibilityText = new (std::nothrow) wchar_t[textLength + 1];
+ SysTryReturnVoidResult(NID_UI_CTRL, (pAccessibilityText != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
- __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
- SysTryReturnVoidResult(NID_UI_CTRL, (__pAccessibilityElement != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ pElement->pTextElement->pTextObject->GetText(pAccessibilityText, textLength);
- __pAccessibilityElement->SetBounds(Rectangle(0, 0, _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().width), _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().height)));
- __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
- __pAccessibilityElement->SetName(L"ListViewItem");
+ accessibilityLable += String(pAccessibilityText);
+ accessibilityLable += L", ";
- if (accessibilityLable.IsEmpty())
- {
- accessibilityLable = L"ListViewItem";
+ delete[] pAccessibilityText;
}
+ }
+ else if (pElement->elementType == LISTVIEW_ITEM_ELEMENT_BITMAP)
+ {
+ accessibilityLable += L"Icon, ";
+ }
+ }
- __pAccessibilityElement->SetLabel(accessibilityLable);
+ accessibilityElementList.clear();
- pContainer->AddElement(*__pAccessibilityElement);
+ if (accessibilityLable.IsEmpty())
+ {
+ accessibilityLable = L"ListViewItem";
+ }
+
+ switch(GetItemStyle())
+ {
+ case TABLE_VIEW_ANNEX_STYLE_MARK:
+ if (IsChecked())
+ {
+ accessibilityLable += L"Tickbox ticked";
}
else
{
- __pAccessibilityElement->SetBounds(Rectangle(0, 0, _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().width), _CoordinateSystemUtils::ConvertToInteger(GetBoundsF().height)));
+ accessibilityLable += L"Tickbox unticked";
}
+ break;
+
+ case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
+ case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
+ if (IsChecked())
+ {
+ accessibilityLable += L"On/Off button On";
+ }
+ else
+ {
+ accessibilityLable += L"On/Off button Off";
+ }
+ break;
+
+ case TABLE_VIEW_ANNEX_STYLE_DETAILED:
+ accessibilityLable += L"button";
+ break;
+
+ case TABLE_VIEW_ANNEX_STYLE_RADIO:
+ if (IsChecked())
+ {
+ accessibilityLable += L"Radio button selected";
+ }
+ else
+ {
+ accessibilityLable += L"Radio button unselected";
+ }
+ break;
+
+ default:
+ break;
}
-}
-void
-_ListViewItem::SetAccessibilityElementLabel(void)
-{
- // nothing
+ if (__descriptionTextShowState)
+ {
+ String descriptionText = __pDescriptionText->GetText();
+ if (descriptionText.GetLength() > 0)
+ {
+ accessibilityLable += L", Description text (";
+ accessibilityLable += descriptionText;
+ accessibilityLable += L")";
+ }
+ }
+
+ if (__itemType == LISTVIEW_ITEM_TYPE_GROUP)
+ {
+ accessibilityLable += L", group Index";
+ }
+
+ __pAccessibilityElement->SetLabel(accessibilityLable);
}
_ListViewItemHitTestVEDelegator::_ListViewItemHitTestVEDelegator(void)