, __pFont(null)
, __pDisplayVisualElement(null)
{
- GetAccessibilityContainer()->Activate(true);
}
_DateTimePicker::~_DateTimePicker(void)
delete __pPresenter;
__pPresenter = null;
-
- if (likely(_AccessibilityManager::IsActivated()))
- {
- _AccessibilityElement* pElement = null;
- while (__accessibilityElements.GetCount() > 0)
- {
- if ((__accessibilityElements.GetAt(0, pElement)) == E_SUCCESS)
- {
- __accessibilityElements.RemoveAt(0);
- pElement->GetParent()->RemoveElement(*pElement);
- }
- else
- {
- __accessibilityElements.RemoveAt(0);
- }
- }
- }
}
_DateTimePicker*
SysTryCatch(NID_UI_CTRL, (pView->__pDateTimeChangeEvent != null), , E_OUT_OF_MEMORY,
"[E_OUT_OF_MEMORY] Memory allocation failed.");
- if (likely(_AccessibilityManager::IsActivated()) && pView->GetAccessibilityContainer() != null)
+ if (pView->GetAccessibilityContainer() != null)
{
pView->GetAccessibilityContainer()->Activate(true);
}
_DateTimePicker::SetAccessibilityElementText(int index, const String& text, bool isAmPm)
{
_AccessibilityElement* pElement = null;
- int elementIndex = __accessibilityElements.GetCount() - 1 - index;
String hintAmPmText(L"Double tap to change to ");
- if (__accessibilityElements.GetAt(elementIndex, pElement) == E_SUCCESS)
+ if (__accessibilityElements.GetAt(index, pElement) == E_SUCCESS)
{
result r = GetLastResult();
SysTryReturnVoidResult(NID_UI_CTRL, (pElement != null), r, "[%s] Propagating.", GetErrorMessage(r));
result
_DateTimePicker::OnAttachedToMainTree(void)
{
- if (likely(!(_AccessibilityManager::IsActivated())))
- {
- return E_SUCCESS;
- }
-
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
if (pContainer != null)
{
pElement->SetHint(hintAmPmText);
pContainer->AddElement(*pElement);
}
- }
- if (pContainer)
- {
pContainer->GetElements(__accessibilityElements);
+ _AccessibilityManager::GetInstance()->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM);
+
}
return E_SUCCESS;
}
+result
+_DateTimePicker::OnDetachingFromMainTree(void)
+{
+ RemoveAllAccessibilityElement();
+
+ return _Window::OnDetachingFromMainTree();
+}
+
void
_DateTimePicker::OnChangeLayout(_ControlOrientation orientation)
{
__pPresenter->OnChangeLayout(orientation);
- if (likely(_AccessibilityManager::IsActivated()))
+ const _DateTimeDisplayBox* pBox = null;
+ IEnumeratorT<_AccessibilityElement*>* pEnumerator = __accessibilityElements.GetEnumeratorN();
+ SysTryReturnVoidResult(NID_UI_CTRL, (pEnumerator != null), GetLastResult(),
+ "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ _AccessibilityElement* pElement = null;
+ int index = 0;
+ while (pEnumerator->MoveNext() == E_SUCCESS)
{
- const _DateTimeDisplayBox* pBox = null;
- IEnumeratorT<_AccessibilityElement*>* pEnumerator = __accessibilityElements.GetEnumeratorN();
- _AccessibilityElement* pElement = null;
- int index = 0;
- while (pEnumerator->MoveNext() == E_SUCCESS)
+ if (pEnumerator->GetCurrent(pElement) == E_SUCCESS)
{
- if (pEnumerator->GetCurrent(pElement) == E_SUCCESS)
+ pBox = __pPresenter->GetDisplayBox(index);
+ if (pBox != null)
{
- pBox = __pPresenter->GetDisplayBox(index);
- if (pBox != null)
- {
- FloatRectangle displayBoxBounds = pBox->GetDisplayBoxBounds();
-
- if (__pDisplayVisualElement)
- {
- displayBoxBounds.y += __pDisplayVisualElement->GetBounds().y;
- }
+ FloatRectangle displayBoxBounds = pBox->GetDisplayBoxBounds();
- pElement->SetBounds(displayBoxBounds);
+ if (__pDisplayVisualElement)
+ {
+ displayBoxBounds.y += __pDisplayVisualElement->GetBounds().y;
}
+
+ pElement->SetBounds(displayBoxBounds);
}
- index++;
}
- delete pEnumerator;
+ index++;
}
+ delete pEnumerator;
return;
}
return indicatorBounds;
}
+void
+_DateTimePicker::RemoveAllAccessibilityElement(void)
+{
+ _AccessibilityContainer* pContainer = GetAccessibilityContainer();
+ SysTryReturnVoidResult(NID_UI_CTRL, (pContainer != null), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ _AccessibilityElement* pAccessibilityElement = null;
+
+ while (__accessibilityElements.GetCount() > 0)
+ {
+ if ((__accessibilityElements.GetAt(0, pAccessibilityElement)) == E_SUCCESS)
+ {
+ __accessibilityElements.RemoveAt(0);
+ pContainer->RemoveElement(*pAccessibilityElement);
+ }
+ else
+ {
+ __accessibilityElements.RemoveAt(0);
+ }
+ }
+}
+
}}} // Tizen::Ui::Controls