2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiCtrl_EditTime.cpp
20 * @brief This is the implementation file for the _EditTime class.
23 #include <FSysSettingInfo.h>
24 #include "FUi_CoordinateSystemUtils.h"
25 #include "FUi_AccessibilityContainer.h"
26 #include "FUi_AccessibilityElement.h"
27 #include "FUi_ResourceManager.h"
28 #include "FUiAnim_VisualElement.h"
29 #include "FUiCtrl_EditTime.h"
30 #include "FUiCtrl_EditTimePresenter.h"
31 #include "FUiCtrl_Form.h"
32 #include "FUiCtrl_Frame.h"
33 #include "FUiCtrl_DateTimeDefine.h"
35 using namespace Tizen::Graphics;
36 using namespace Tizen::Base::Runtime;
37 using namespace Tizen::Base;
38 using namespace Tizen::System;
40 namespace Tizen { namespace Ui { namespace Controls
43 IMPLEMENT_PROPERTY(_EditTime);
45 _EditTime::_EditTime(void)
46 : __pEditTimePresenter(null)
47 , __pTimeChangeEvent(null)
48 , __pDateTimeBar(null)
49 , __absoluteBounds(FloatRectangle())
51 , __pAccessibilityEditTimeElement(null)
52 , __pAccessibilityHourElement(null)
53 , __pAccessibilityMinuteElement(null)
54 , __pAccessibilityAmPmElement(null)
58 _EditTime::~_EditTime(void)
60 SettingInfo::RemoveSettingEventListener(*this);
62 delete __pDateTimeBar;
63 __pDateTimeBar = null;
65 delete __pEditTimePresenter;
66 __pEditTimePresenter = null;
68 if (__pTimeChangeEvent != null)
70 delete __pTimeChangeEvent;
71 __pTimeChangeEvent = null;
74 if (__pAccessibilityEditTimeElement)
76 __pAccessibilityEditTimeElement->Activate(false);
77 __pAccessibilityEditTimeElement = null;
79 if (__pAccessibilityHourElement)
81 __pAccessibilityHourElement->Activate(false);
82 __pAccessibilityHourElement = null;
84 if (__pAccessibilityMinuteElement)
86 __pAccessibilityMinuteElement->Activate(false);
87 __pAccessibilityMinuteElement = null;
89 if (__pAccessibilityAmPmElement)
91 __pAccessibilityAmPmElement->Activate(false);
92 __pAccessibilityAmPmElement = null;
97 _EditTime::CreateEditTimeN(const String& title)
101 _AccessibilityContainer* pContainer = null;
103 _EditTime* pEditTime = new (std::nothrow) _EditTime;
104 SysTryReturn(NID_UI_CTRL, pEditTime, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
106 pEditTime->GetVisualElement()->SetSurfaceOpaque(false);
108 pEditTime->__pEditTimePresenter = _EditTimePresenter::CreateInstanceN(*pEditTime, title);
110 SysTryCatch(NID_UI_CTRL, pEditTime->__pEditTimePresenter, , r, "[%s] Propagating.", GetErrorMessage(r));
112 r = pEditTime->CreateDateTimeBar();
113 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
115 pEditTime->__pEditTimePresenter->Initialize();
117 SysTryCatch(NID_UI_CTRL, pEditTime->__pEditTimePresenter, , r, "[%s] Propagating.", GetErrorMessage(r));
119 pEditTime->__pEditTimePresenter->SetCurrentTime();
121 if (title.IsEmpty() != true)
123 pEditTime->__title = title;
126 pContainer = pEditTime->GetAccessibilityContainer();
129 pContainer->Activate(true);
130 pEditTime->CreateAccessibilityElement();
133 pEditTime->AcquireHandle();
143 _EditTime::CreateDateTimeBar(void)
145 result r = E_SUCCESS;
147 __pDateTimeBar = _DateTimeBar::CreateDateTimeBarN(*this);
149 SysTryReturn(NID_UI_CTRL, (__pDateTimeBar != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
151 r = __pDateTimeBar->AddActionEventListener(*this);
152 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
154 r = __pDateTimeBar->AddDateTimeChangeEventListener(*this);
155 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
157 r = SettingInfo::AddSettingEventListener(*this);
158 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
163 delete __pDateTimeBar;
168 _EditTime::AddTimeChangeEventListener(const _IDateTimeChangeEventListener& listener)
170 if (__pTimeChangeEvent == null)
172 __pTimeChangeEvent = new (std::nothrow) _DateTimeChangeEvent(*this);
173 SysTryReturn(NID_UI_CTRL, (__pTimeChangeEvent != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
174 "[E_OUT_OF_MEMORY] Memory allocation failed.");
177 result r = __pTimeChangeEvent->AddListener(listener);
178 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
184 _EditTime::RemoveTimeChangeEventListener(const _IDateTimeChangeEventListener& listener)
186 result r = E_OBJ_NOT_FOUND;
188 if (__pTimeChangeEvent)
190 r = __pTimeChangeEvent->RemoveListener(listener);
193 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
199 _EditTime::SetTime(const DateTime& time)
201 SetProperty("time", Variant(time));
206 _EditTime::SetPropertyTime(const Variant& time)
208 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), E_SYSTEM, E_SYSTEM,
209 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
211 __pEditTimePresenter->SetTime(time.ToDateTime());
213 UpdateAccessibilityElement();
218 _EditTime::GetTime(void) const
220 Variant time = GetProperty("time");
222 return time.ToDateTime();
226 _EditTime::GetPropertyTime(void) const
230 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), Variant(), E_SYSTEM,
231 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
233 time = __pEditTimePresenter->GetTime();
235 return Variant(time);
239 _EditTime::SetHour(int hour)
241 result r = E_SUCCESS;
243 SetProperty("hour", Variant(hour));
251 _EditTime::SetPropertyHour(const Variant& hour)
253 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), E_SYSTEM, E_SYSTEM,
254 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
256 result r = E_SUCCESS;
258 r = __pEditTimePresenter->SetHour(hour.ToInt());
259 SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
261 UpdateAccessibilityElement();
267 _EditTime::GetHour(void) const
269 Variant hour = GetProperty("hour");
275 _EditTime::GetPropertyHour(void) const
279 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), Variant(), E_SYSTEM,
280 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
282 hour = __pEditTimePresenter->GetHour();
284 return Variant(hour);
288 _EditTime::SetMinute(int minute)
290 result r = E_SUCCESS;
292 SetProperty("minute", Variant(minute));
300 _EditTime::SetPropertyMinute(const Variant& minute)
302 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), E_SYSTEM, E_SYSTEM,
303 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
305 result r = E_SUCCESS;
307 r = __pEditTimePresenter->SetMinute(minute.ToInt());
308 SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
310 UpdateAccessibilityElement();
316 _EditTime::GetMinute(void) const
318 Variant minute = GetProperty("minute");
320 return minute.ToInt();
324 _EditTime::GetPropertyMinute(void) const
328 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), Variant(), E_SYSTEM,
329 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
331 minute = __pEditTimePresenter->GetMinute();
333 return Variant(minute);
337 _EditTime::SetCurrentTime(void)
339 SysTryReturnVoidResult(NID_UI_CTRL, (__pEditTimePresenter != null), E_SYSTEM,
340 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
342 __pEditTimePresenter->SetCurrentTime();
344 UpdateAccessibilityElement();
350 _EditTime::SetTimePickerEnabled(bool enable)
352 SetProperty("timePickerEnabled", Variant(enable));
357 _EditTime::SetPropertyTimePickerEnabled(const Variant& enable)
359 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), E_SYSTEM, E_SYSTEM,
360 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
362 __pEditTimePresenter->SetTimePickerEnabled(enable.ToBool());
368 _EditTime::IsTimePickerEnabled(void) const
370 Variant enable = GetProperty("timePickerEnabled");
372 return enable.ToBool();
376 _EditTime::GetPropertyTimePickerEnabled(void) const
380 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), Variant(), E_SYSTEM,
381 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
383 enable = __pEditTimePresenter->IsTimePickerEnabled();
385 return Variant(enable);
389 _EditTime::Set24HourNotationEnabled(bool enable)
391 SysTryReturnVoidResult(NID_UI_CTRL, (__pEditTimePresenter != null), E_SYSTEM,
392 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
394 __pEditTimePresenter->Set24HourNotationEnabled(enable);
399 _EditTime::Is24HourNotationEnabled(void) const
401 SysAssertf((__pEditTimePresenter != null), "The _EditDatePresenter instance is null.");
403 return __pEditTimePresenter->Is24HourNotationEnabled();
407 _EditTime::CalculateDateTimeBarPosition(void)
409 result r = E_SUCCESS;
411 float dateTimeBarHeight = 0.0f;
412 float arrowHeight = 0.0f;
413 float timeHeight = 0.0f;
414 float timeBarMargin = 0.0f;
415 float textHeight = 0.0f;
416 float titleTimeMargin = 0.0f;
417 float bottomPosition = 0.0f;
420 FloatRectangle absoluteBounds;
421 FloatRectangle frameBounds;
422 FloatRectangle parentWindowBounds;
423 FloatRectangle titleBounds;
425 _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
426 SysTryReturn(NID_UI_CTRL, (pFrame != null), E_SYSTEM, E_SYSTEM,
427 "[E_SYSTEM] A system error has occurred. Failed to get frame instance.");
429 frameBounds = pFrame->GetAbsoluteBoundsF();
430 absoluteBounds = GetAbsoluteBoundsF();
431 parentWindowBounds = GetParentWindowBounds();
432 titleBounds = __pEditTimePresenter->GetTitleBounds();
434 GET_SHAPE_CONFIG(DATETIMEBAR::ITEM_HEIGHT, GetOrientation(), dateTimeBarHeight);
435 GET_SHAPE_CONFIG(DATETIMEBAR::ARROW_HEIGHT, GetOrientation(), arrowHeight);
436 GET_SHAPE_CONFIG(EDITTIME::TIME_HEIGHT, GetOrientation(), timeHeight);
437 GET_SHAPE_CONFIG(EDITTIME::TIME_BAR_MARGIN, GetOrientation(), timeBarMargin);
438 GET_SHAPE_CONFIG(EDITTIME::TITLE_HEIGHT, GetOrientation(), textHeight);
439 GET_SHAPE_CONFIG(EDITTIME::TITLE_TIME_MARGIN, GetOrientation(), titleTimeMargin);
441 if (!__title.IsEmpty()) //with title
443 timeY = titleBounds.y + textHeight + titleTimeMargin ;
447 timeY = (absoluteBounds.height - timeHeight) / 2.0f ;
450 bottomPosition = absoluteBounds.y + timeY + timeHeight + timeBarMargin + arrowHeight + dateTimeBarHeight;
452 GetDateTimeBar()->SetParentWindowBounds(parentWindowBounds);
454 if (bottomPosition > frameBounds.y + parentWindowBounds.y + parentWindowBounds.height) //ALIGN_UP
456 r = GetDateTimeBar()->SetPositionAndAlignment(FloatPoint(parentWindowBounds.x, absoluteBounds.y + timeY - timeBarMargin - arrowHeight), DATETIME_BAR_ALIGN_UP);
457 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
461 r = GetDateTimeBar()->SetPositionAndAlignment(FloatPoint(parentWindowBounds.x, absoluteBounds.y + timeY + timeHeight + timeBarMargin + arrowHeight), DATETIME_BAR_ALIGN_DOWN);
462 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
465 __absoluteBounds = absoluteBounds;
471 _EditTime::OnDraw(void)
473 if (GetDateTimeBar() != null)
475 CalculateDateTimeBarPosition();
478 __pEditTimePresenter->Draw();
480 UpdateAccessibilityElement();
485 _EditTime::CreateAccessibilityElement(void)
487 _AccessibilityContainer* pContainer = GetAccessibilityContainer();
488 FloatRectangle hourBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR);
489 FloatRectangle minuteBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE);
490 FloatRectangle ampmBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
492 pContainer->AddListener(*this);
493 if (__pAccessibilityEditTimeElement == null)
495 __pAccessibilityEditTimeElement = new _AccessibilityElement(true);
496 __pAccessibilityEditTimeElement->SetBounds(GetClientBounds());
497 __pAccessibilityEditTimeElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
498 __pAccessibilityEditTimeElement->SetName(L"EditTimeText");
499 pContainer->AddElement(*__pAccessibilityEditTimeElement);
502 if (__pAccessibilityHourElement == null && __pAccessibilityMinuteElement == null)
504 String hintText(L"Double tap to edit");
506 __pAccessibilityHourElement = new _AccessibilityElement(true);
507 __pAccessibilityHourElement->SetBounds(hourBounds);
508 __pAccessibilityHourElement->SetTrait(ACCESSIBILITY_TRAITS_HOUR);
509 __pAccessibilityHourElement->SetHint(hintText);
510 pContainer->AddElement(*__pAccessibilityHourElement);
512 __pAccessibilityMinuteElement = new _AccessibilityElement(true);
513 __pAccessibilityMinuteElement->SetBounds(minuteBounds);
514 __pAccessibilityMinuteElement->SetTrait(ACCESSIBILITY_TRAITS_MINUTE);
515 __pAccessibilityMinuteElement->SetHint(hintText);
516 pContainer->AddElement(*__pAccessibilityMinuteElement);
518 if (Is24HourNotationEnabled() == false)
520 __pAccessibilityAmPmElement = new _AccessibilityElement(true);
521 __pAccessibilityAmPmElement->SetBounds(ampmBounds);
522 __pAccessibilityAmPmElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON);
523 pContainer->AddElement(*__pAccessibilityAmPmElement);
529 _EditTime::OnBoundsChanged(void)
531 __pEditTimePresenter->Initialize();
533 if (__pAccessibilityEditTimeElement)
535 __pAccessibilityEditTimeElement->SetBounds(__pEditTimePresenter->GetTitleBounds());
537 if (__pAccessibilityHourElement)
539 __pAccessibilityHourElement->SetBounds(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR));
541 if (__pAccessibilityMinuteElement)
543 __pAccessibilityMinuteElement->SetBounds(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE));
545 if (__pAccessibilityAmPmElement)
547 __pAccessibilityAmPmElement->SetBounds(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM));
554 _EditTime::OnChangeLayout(_ControlOrientation orientation)
558 GET_SHAPE_CONFIG(EDITTIME::WIDTH, GetOrientation(), dim.width);
559 GET_SHAPE_CONFIG(EDITTIME::HEIGHT, GetOrientation(), dim.height);
563 __pEditTimePresenter->Initialize();
565 if (GetDateTimeBar() != null)
567 CalculateDateTimeBarPosition();
568 GetDateTimeBar()->SetVisibleState(false);
569 GetDateTimeBar()->Close();
576 _EditTime::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
578 FloatRectangle absoluteBounds = GetAbsoluteBoundsF();
582 if (absoluteBounds.y != __absoluteBounds.y || absoluteBounds.height != __absoluteBounds.height)
584 CalculateDateTimeBarPosition();
587 return __pEditTimePresenter->OnTouchPressed(source, touchinfo);
591 _EditTime::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
593 return __pEditTimePresenter->OnTouchReleased(source, touchinfo);
597 _EditTime::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
599 return __pEditTimePresenter->OnTouchCanceled(source, touchinfo);
603 _EditTime::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
605 return __pEditTimePresenter->OnTouchMoved(source, touchinfo);
609 _EditTime::OnTouchMoveHandled(const _Control& control)
611 __pEditTimePresenter->OnTouchMoveHandled(control);
616 _EditTime::FireTimeChangeEvent(_DateTimeChangeStatus status)
618 SysTryReturn(NID_UI_CTRL, (__pTimeChangeEvent != null), E_SYSTEM, E_SYSTEM,
619 "[E_SYSTEM] A system error has occurred. The _DateTimeChangeEvent instance is null.");
621 _DateTimeChangeEventArg* pDateTimeEventArg = new (std::nothrow) _DateTimeChangeEventArg(status);
622 SysTryReturn(NID_UI_CTRL, pDateTimeEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
623 "[E_OUT_OF_MEMORY] Memory allocation failed.");
625 pDateTimeEventArg->SetTime(GetHour(), GetMinute());
627 __pTimeChangeEvent->Fire(*pDateTimeEventArg);
633 _EditTime::OnDateTimeChanged(const _Control& source, int year, int month, int day, int hour, int minute)
635 __pEditTimePresenter->Animate();
637 FireTimeChangeEvent(TIME_INTERNAL_CHANGE_SAVED);
642 _EditTime::OnDateTimeChangeCanceled(const _Control& source)
646 FireTimeChangeEvent(TIME_INTERNAL_CHANGE_CANCELED);
651 _EditTime::OnActionPerformed(const Ui::_Control& source, int actionId)
653 _DateTimeId boxId = __pEditTimePresenter->GetLastSelectedId();
655 if (boxId == DATETIME_ID_HOUR)
657 bool amEnable = true;
658 amEnable = __pEditTimePresenter->GetAmEnabled();
662 if (amEnable == false && Is24HourNotationEnabled() == false)
664 if (hour < DATETIME_HOUR_MAX_FOR_24NOTATION)
666 hour += DATETIME_HOUR_MAX_FOR_24NOTATION;
669 else if (amEnable == true && Is24HourNotationEnabled() == false)
671 if (hour == DATETIME_HOUR_MAX_FOR_24NOTATION)
673 hour = DATETIME_HOUR_MIN;
678 else if (boxId == DATETIME_ID_MINUTE)
688 _EditTime::GetDateTimeBar(void) const
690 return __pDateTimeBar;
694 _EditTime::OnFontChanged(Font* pFont)
696 __pEditTimePresenter->OnFontChanged(pFont);
702 _EditTime::OnFontInfoRequested(unsigned long& style, float& size)
704 __pEditTimePresenter->OnFontInfoRequested(style, size);
710 _EditTime::OnSettingChanged(String& key)
712 if (key.Equals(L"http://tizen.org/setting/locale.time.format.24hour", false))
714 __pEditTimePresenter->UpdateTimeFormat();
722 _EditTime::GetParentWindowBounds(void) const
725 _Window* pwindow = null;
726 _Control* pControlCore = GetParent();
728 FloatDimension dateTimeBarSize(0.0f, 0.0f);
730 GET_DIMENSION_CONFIG(DATETIMEBAR::DEFAULT_SIZE, GetOrientation(), dateTimeBarSize);
732 FloatRectangle parentWindowBounds(0.0f, 0.0f, dateTimeBarSize.width, dateTimeBarSize.height);
736 if (pControlCore == null)
738 SysLog(NID_UI_CTRL,"[E_SYSTEM] Parent window not found.");
740 return parentWindowBounds;
743 // If the parent is a Frame, then return the Form's bounds.
744 pForm = dynamic_cast<_Form*>(pControlCore);
747 parentWindowBounds = pForm->GetBoundsF();
751 pwindow = dynamic_cast<_Window*>(pControlCore);
755 parentWindowBounds = pwindow->GetBoundsF();
759 pControlCore = pControlCore->GetParent();
762 return parentWindowBounds;
766 _EditTime::UpdateAccessibilityElement(void)
770 if (likely(!(_AccessibilityManager::IsActivated())))
775 if (__pAccessibilityEditTimeElement == null && __pAccessibilityHourElement == null
776 && __pAccessibilityMinuteElement == null && __pAccessibilityAmPmElement == null)
781 if (__title.IsEmpty() == false)
783 string.Append(__title);
784 string.Append(L", ");
788 int hour = GetHour();
789 int maxHour = DATETIME_HOUR_MAX_FOR_24NOTATION;
791 if (Is24HourNotationEnabled() == false && (hour > maxHour))
793 hourString.Format(10, L"%02d", hour - DATETIME_HOUR_MAX_FOR_24NOTATION);
797 hourString.Format(10, L"%02d", hour);
800 string.Append(hourString.GetPointer());
802 string.Append(GetMinute());
805 if (Is24HourNotationEnabled() == false)
807 String hintAmPmText(L"Double tap to change to ");
810 GET_STRING_CONFIG(IDS_COM_BODY_AM, amString);
811 GET_STRING_CONFIG(IDS_COM_POP_PM, pmString);
813 if (__pEditTimePresenter->GetAmEnabled() == true)
815 __pAccessibilityAmPmElement->SetLabel(amString);
816 hintAmPmText.Append(pmString.GetPointer());
817 string.Append(amString.GetPointer());
821 __pAccessibilityAmPmElement->SetLabel(pmString);
822 hintAmPmText.Append(amString.GetPointer());
823 string.Append(pmString.GetPointer());
826 __pAccessibilityAmPmElement->SetHint(hintAmPmText);
829 __pAccessibilityEditTimeElement->SetLabel(string);
831 __pAccessibilityHourElement->SetLabel(hourString);
834 string.Format(10, L"%02d", GetMinute());
835 __pAccessibilityMinuteElement->SetLabel(string);
841 _EditTime::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element)
847 _EditTime::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element)
853 _EditTime::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
859 _EditTime::OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
866 _EditTime::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element)
872 _EditTime::OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element)
878 _EditTime::OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element)
884 labelText = element.GetLabel();
886 GET_STRING_CONFIG(IDS_COM_BODY_AM, amString);
887 GET_STRING_CONFIG(IDS_COM_POP_PM, pmString);
889 if (labelText == amString || labelText == pmString)
891 labelText.Append(L" Selected");
892 _AccessibilityManager::GetInstance()->ReadContent(labelText);
899 _EditTime::OnAccessibilityValueIncreased(const _AccessibilityContainer&, const _AccessibilityElement&)
905 _EditTime::OnAccessibilityValueDecreased(const _AccessibilityContainer&, const _AccessibilityElement&)