__pAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
}
}
+void
+_ListViewItem::SetAccessibilityElementTrait(void)
+{
+ if(__pAccessibilityElement == null)
+ {
+ return;
+ }
+ int groupIndex = -1;
+ int itemIndex = -1;
+
+ switch (GetItemStyle())
+ {
+ case TABLE_VIEW_ANNEX_STYLE_NORMAL:
+ GetItemIndex(groupIndex, itemIndex);
+ if(groupIndex != -1 && itemIndex == -1)
+ {
+ __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_GROUP_INDEX");
+ }
+ break;
+ case TABLE_VIEW_ANNEX_STYLE_MARK:
+ __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_TICKBOX_T_TTS");
+ break;
+
+ case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
+ case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
+ __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_ON_OFF_BUTTON_T_TTS");
+ break;
+
+ case TABLE_VIEW_ANNEX_STYLE_DETAILED:
+ __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_BUTTON_T_TTS");
+ break;
+
+ case TABLE_VIEW_ANNEX_STYLE_RADIO:
+ __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_RADIO_BUTTON_T_TTS");
+ break;
+
+ default:
+ break;
+ }
+}
void
-_ListViewItem::SetAccessibilityElementLabel(void)
+_ListViewItem::SetAccessibilityElementValue(void)
{
- if (__pAccessibilityElement == null)
+ if(__pAccessibilityElement == null)
{
return;
}
+
+ switch (GetItemStyle())
+ {
+ case TABLE_VIEW_ANNEX_STYLE_MARK:
+ if (IsChecked())
+ {
+ __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_TICK_T_TTS");
+ }
+ else
+ {
+ __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_UNTICK_T_TTS");
+ }
+ break;
+
+ case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
+ case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
+ if (IsChecked())
+ {
+ __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_ON");
+ }
+ else
+ {
+ __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_OFF");
+ }
+ break;
+
+ case TABLE_VIEW_ANNEX_STYLE_RADIO:
+ if (IsChecked())
+ {
+ __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_SELECTED_T_TTS");
+ }
+ else
+ {
+ __pAccessibilityElement->SetValue(L"Unselected");
+ }
+ break;
+ default:
+ break;
+ }
+}
+void
+_ListViewItem::SetAccessibilityElementLabel(void)
+{
+ if(__pAccessibilityElement == null)
+ {
+ return;
+ }
+ if(__pAccessibilityElement->GetLabel().GetLength() > 0)
+ {
+ return;
+ }
_LinkedList <_ListViewItemElement*> accessibilityElementList;
_LinkedList <_ListViewItemElement>::_Iterator iter;
_LinkedList <_ListViewItemElement*>::_Iterator accessibilityIter;
_ListViewItemElement* pElement = null;
String accessibilityName;
- String accessibilityLable;
- String accessibilityTrait;
- String accessibilityValue;
+ String accessibilityLabel;
int groupIndex = -1;
int itemIndex = -1;
if (__itemType == LISTVIEW_ITEM_TYPE_GROUP)
{
- accessibilityTrait = L"Group Index";
accessibilityName = L"GroupIndex" + Integer::ToString(groupIndex);
}
else
pElement->pTextElement->pTextObject->GetText(pAccessibilityText, textLength);
- accessibilityLable += String(pAccessibilityText);
- accessibilityLable += L", ";
+ accessibilityLabel += String(pAccessibilityText);
+ accessibilityLabel += L", ";
delete[] pAccessibilityText;
}
}
else if (pElement->elementType == LISTVIEW_ITEM_ELEMENT_BITMAP)
{
- accessibilityLable += L"Icon, ";
+ accessibilityLabel += L"Icon, ";
}
}
accessibilityElementList.clear();
- if (accessibilityLable.IsEmpty())
+ if (accessibilityLabel.IsEmpty())
{
- accessibilityLable = L"ListViewItem";
+ accessibilityLabel = L"ListViewItem";
}
if (__descriptionTextShowState)
{
String descriptionText = __pDescriptionText->GetText();
- accessibilityLable += ((descriptionText.GetLength() > 0) ? (L", " + descriptionText + L"") : L"");
+ accessibilityLabel += ((descriptionText.GetLength() > 0) ? (L", " + descriptionText + L"") : L"");
}
-
- // accessibility element trait and value
- switch(GetItemStyle())
- {
- case TABLE_VIEW_ANNEX_STYLE_MARK:
- accessibilityTrait = L"Tickbox";
- accessibilityValue = (IsChecked() ? L"Ticked" : L"Unticked");
- break;
-
- case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
- case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
- accessibilityTrait = L"On/Off button";
- accessibilityValue = (IsChecked() ? L"On" : L"Off");
- break;
-
- case TABLE_VIEW_ANNEX_STYLE_DETAILED:
- accessibilityTrait = L"Button";
- break;
-
- case TABLE_VIEW_ANNEX_STYLE_RADIO:
- accessibilityTrait = L"Radio button";
- accessibilityValue = (IsChecked() ? L"Selected" : L"Unselected");
- break;
-
- default:
- break;
- }
-
__pAccessibilityElement->SetName(accessibilityName);
- __pAccessibilityElement->SetLabel(accessibilityLable);
- __pAccessibilityElement->SetTrait(accessibilityTrait);
- __pAccessibilityElement->SetValue(accessibilityValue);
+ __pAccessibilityElement->SetLabel(accessibilityLabel);
}
result
{
return __pAccessibilityElement;
}
-
void
-_TableViewItem::SetAccessibilityElementLabel(void)
+_TableViewItem::SetAccessibilityElementTrait(void)
{
- String accessibilityLabel;
- String space = L" ";
- int childControlCount = GetChildCount();
+ if(__pAccessibilityElement == null)
+ {
+ return;
+ }
int groupIndex = -1;
int itemIndex = -1;
-
- for (int i = 0; i < childControlCount; i++)
+
+ switch (__annexStyle)
{
- _Control* pChildControl = GetChild(i);
-
- if (pChildControl == null)
+ case TABLE_VIEW_ANNEX_STYLE_NORMAL:
+ GetItemIndex(groupIndex, itemIndex);
+ if(groupIndex != -1 && itemIndex == -1)
{
- continue;
+ __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_GROUP_INDEX");
}
+ break;
- if (__pItemDivider == pChildControl || __pItemTopDivider == pChildControl || __pItemCover == pChildControl)
- {
- continue;
- }
+ case TABLE_VIEW_ANNEX_STYLE_MARK:
+ __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_TICKBOX_T_TTS");
+ break;
- if (!IsIndividualSelectionEnabled(*pChildControl))
- {
- _AccessibilityContainer* pContainer = pChildControl->GetAccessibilityContainer();
- LinkedListT<_AccessibilityElement*> accessibilityElements;
- _AccessibilityElement* pElement = null;
+ case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING:
+ case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
+ __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_ON_OFF_BUTTON_T_TTS");
+ break;
- pContainer->GetElements(accessibilityElements);
- pContainer->Activate(false);
- int elementCount = accessibilityElements.GetCount();
+ case TABLE_VIEW_ANNEX_STYLE_DETAILED:
+ __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_BUTTON_T_TTS");
+ break;
- for (int i = 0; i < elementCount; i++)
- {
- if (accessibilityElements.GetAt(i, pElement) == E_SUCCESS)
- {
- accessibilityLabel += pElement->GetLabel();
- accessibilityLabel += space;
- }
- }
- }
- }
+ case TABLE_VIEW_ANNEX_STYLE_RADIO:
+ __pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_RADIO_BUTTON_T_TTS");
+ break;
+ default:
+ break;
+ }
+}
+void
+_TableViewItem::SetAccessibilityElementValue(void)
+{
+ if(__pAccessibilityElement == null)
+ {
+ return;
+ }
+
switch (__annexStyle)
{
- case TABLE_VIEW_ANNEX_STYLE_NORMAL:
- GetItemIndex(groupIndex, itemIndex);
- if (groupIndex != -1 && itemIndex == -1)
- {
- accessibilityLabel += L"group index";
- }
- break;
-
case TABLE_VIEW_ANNEX_STYLE_MARK:
if (IsChecked())
{
- accessibilityLabel += L"Tickbox ticked";
+ __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_TICK_T_TTS");
}
else
{
- accessibilityLabel += L"Tickbox unticked";
+ __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_UNTICK_T_TTS");
}
break;
case TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER:
if (IsChecked())
{
- accessibilityLabel += L"On/Off button On";
+ __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_ON");
}
else
{
- accessibilityLabel += L"On/Off button Off";
+ __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_OFF");
}
break;
- case TABLE_VIEW_ANNEX_STYLE_DETAILED:
- accessibilityLabel += L"button";
- break;
-
case TABLE_VIEW_ANNEX_STYLE_RADIO:
if (IsChecked())
{
- accessibilityLabel += L"Radio button selected";
+ __pAccessibilityElement->SetValueWithStringId("IDS_TPLATFORM_BODY_SELECTED_T_TTS");
}
else
{
- accessibilityLabel += L"Radio button unselected";
+ __pAccessibilityElement->SetValue(L"Unselected");
}
break;
default:
break;
}
+}
+void
+_TableViewItem::SetAccessibilityElementLabel(void)
+{
+ if(__pAccessibilityElement == null)
+ {
+ return;
+ }
+ if(__pAccessibilityElement->GetLabel().GetLength() > 0)
+ {
+ return;
+ }
+ String accessibilityLabel;
+ String space = L" ";
+ int childControlCount = GetChildCount();
+ int groupIndex = -1;
+ int itemIndex = -1;
- if (!accessibilityLabel.IsEmpty())
+ for (int i = 0; i < childControlCount; i++)
{
- __pAccessibilityElement->SetLabel(accessibilityLabel);
+ _Control* pChildControl = GetChild(i);
+
+ if (pChildControl == null)
+ {
+ continue;
+ }
+
+ if (__pItemDivider == pChildControl || __pItemTopDivider == pChildControl || __pItemCover == pChildControl)
+ {
+ continue;
+ }
+
+ if (!IsIndividualSelectionEnabled(*pChildControl))
+ {
+ _AccessibilityContainer* pContainer = pChildControl->GetAccessibilityContainer();
+ LinkedListT<_AccessibilityElement*> accessibilityElements;
+ _AccessibilityElement* pElement = null;
+
+ pContainer->GetElements(accessibilityElements);
+ pContainer->Activate(false);
+ int elementCount = accessibilityElements.GetCount();
+
+ for (int i = 0; i < elementCount; i++)
+ {
+ if (accessibilityElements.GetAt(i, pElement) == E_SUCCESS)
+ {
+ accessibilityLabel += pElement->GetLabel();
+ accessibilityLabel += space;
+ }
+ }
+ }
}
+
+ __pAccessibilityElement->SetLabel(accessibilityLabel);
}
_TableViewItem::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
{
SetAccessibilityElementLabel();
-
+ SetAccessibilityElementTrait();
+ SetAccessibilityElementValue();
return false;
}
virtual void SetAccessibilityElement(void);
virtual void SetAccessibilityElementLabel(void);
-
+ virtual void SetAccessibilityElementTrait(void);
+ virtual void SetAccessibilityElementValue(void);
+
private:
static const int TEXT_SLIDING_TIMER_DURATION = 60;
result Initialize(void);
virtual void SetAccessibilityElementLabel(void);
+ virtual void SetAccessibilityElementTrait(void);
+ virtual void SetAccessibilityElementValue(void);
void SetPressedControl(TableViewItemPressedControl pressedControl);
TableViewItemPressedControl GetPressedControl(void);