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();
580 if (absoluteBounds.y != __absoluteBounds.y || absoluteBounds.height != __absoluteBounds.height)
582 CalculateDateTimeBarPosition();
585 return __pEditTimePresenter->OnTouchPressed(source, touchinfo);
589 _EditTime::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
591 return __pEditTimePresenter->OnTouchReleased(source, touchinfo);
595 _EditTime::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
597 return __pEditTimePresenter->OnTouchCanceled(source, touchinfo);
601 _EditTime::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
603 return __pEditTimePresenter->OnTouchMoved(source, touchinfo);
607 _EditTime::OnTouchMoveHandled(const _Control& control)
609 __pEditTimePresenter->OnTouchMoveHandled(control);
614 _EditTime::FireTimeChangeEvent(_DateTimeChangeStatus status)
616 SysTryReturn(NID_UI_CTRL, (__pTimeChangeEvent != null), E_SYSTEM, E_SYSTEM,
617 "[E_SYSTEM] A system error has occurred. The _DateTimeChangeEvent instance is null.");
619 _DateTimeChangeEventArg* pDateTimeEventArg = new (std::nothrow) _DateTimeChangeEventArg(status);
620 SysTryReturn(NID_UI_CTRL, pDateTimeEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
621 "[E_OUT_OF_MEMORY] Memory allocation failed.");
623 pDateTimeEventArg->SetTime(GetHour(), GetMinute());
625 __pTimeChangeEvent->Fire(*pDateTimeEventArg);
631 _EditTime::OnDateTimeChanged(const _Control& source, int year, int month, int day, int hour, int minute)
633 __pEditTimePresenter->Animate();
635 FireTimeChangeEvent(TIME_INTERNAL_CHANGE_SAVED);
640 _EditTime::OnDateTimeChangeCanceled(const _Control& source)
644 FireTimeChangeEvent(TIME_INTERNAL_CHANGE_CANCELED);
649 _EditTime::OnActionPerformed(const Ui::_Control& source, int actionId)
651 _DateTimeId boxId = __pEditTimePresenter->GetLastSelectedId();
653 if (boxId == DATETIME_ID_HOUR)
655 bool amEnable = true;
656 amEnable = __pEditTimePresenter->GetAmEnabled();
660 if (amEnable == false && Is24HourNotationEnabled() == false)
662 if (hour < DATETIME_HOUR_MAX_FOR_24NOTATION)
664 hour += DATETIME_HOUR_MAX_FOR_24NOTATION;
667 else if (amEnable == true && Is24HourNotationEnabled() == false)
669 if (hour == DATETIME_HOUR_MAX_FOR_24NOTATION)
671 hour = DATETIME_HOUR_MIN;
676 else if (boxId == DATETIME_ID_MINUTE)
686 _EditTime::GetDateTimeBar(void) const
688 return __pDateTimeBar;
692 _EditTime::OnFontChanged(Font* pFont)
694 __pEditTimePresenter->OnFontChanged(pFont);
700 _EditTime::OnFontInfoRequested(unsigned long& style, float& size)
702 __pEditTimePresenter->OnFontInfoRequested(style, size);
708 _EditTime::OnSettingChanged(String& key)
710 if (key.Equals(L"http://tizen.org/setting/locale.time.format.24hour", false))
712 __pEditTimePresenter->UpdateTimeFormat();
720 _EditTime::GetParentWindowBounds(void) const
723 _Window* pwindow = null;
724 _Control* pControlCore = GetParent();
726 FloatDimension dateTimeBarSize(0.0f, 0.0f);
728 GET_DIMENSION_CONFIG(DATETIMEBAR::DEFAULT_SIZE, GetOrientation(), dateTimeBarSize);
730 FloatRectangle parentWindowBounds(0.0f, 0.0f, dateTimeBarSize.width, dateTimeBarSize.height);
734 if (pControlCore == null)
736 SysLog(NID_UI_CTRL,"[E_SYSTEM] Parent window not found.");
738 return parentWindowBounds;
741 // If the parent is a Frame, then return the Form's bounds.
742 pForm = dynamic_cast<_Form*>(pControlCore);
745 parentWindowBounds = pForm->GetBoundsF();
749 pwindow = dynamic_cast<_Window*>(pControlCore);
753 parentWindowBounds = pwindow->GetBoundsF();
757 pControlCore = pControlCore->GetParent();
760 return parentWindowBounds;
764 _EditTime::UpdateAccessibilityElement(void)
768 if (likely(!(_AccessibilityManager::IsActivated())))
773 if (__pAccessibilityEditTimeElement == null && __pAccessibilityHourElement == null
774 && __pAccessibilityMinuteElement == null && __pAccessibilityAmPmElement == null)
779 if (__title.IsEmpty() == false)
781 string.Append(__title);
782 string.Append(L", ");
786 int hour = GetHour();
787 int maxHour = DATETIME_HOUR_MAX_FOR_24NOTATION;
789 if (Is24HourNotationEnabled() == false && (hour > maxHour))
791 hourString.Format(10, L"%02d", hour - DATETIME_HOUR_MAX_FOR_24NOTATION);
795 hourString.Format(10, L"%02d", hour);
798 string.Append(hourString.GetPointer());
800 string.Append(GetMinute());
803 if (Is24HourNotationEnabled() == false)
805 String hintAmPmText(L"Double tap to change to ");
808 GET_STRING_CONFIG(IDS_COM_BODY_AM, amString);
809 GET_STRING_CONFIG(IDS_COM_POP_PM, pmString);
811 if (__pEditTimePresenter->GetAmEnabled() == true)
813 __pAccessibilityAmPmElement->SetLabel(amString);
814 hintAmPmText.Append(pmString.GetPointer());
815 string.Append(amString.GetPointer());
819 __pAccessibilityAmPmElement->SetLabel(pmString);
820 hintAmPmText.Append(amString.GetPointer());
821 string.Append(pmString.GetPointer());
824 __pAccessibilityAmPmElement->SetHint(hintAmPmText);
827 __pAccessibilityEditTimeElement->SetLabel(string);
829 __pAccessibilityHourElement->SetLabel(hourString);
832 string.Format(10, L"%02d", GetMinute());
833 __pAccessibilityMinuteElement->SetLabel(string);
839 _EditTime::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element)
845 _EditTime::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element)
851 _EditTime::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
857 _EditTime::OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
864 _EditTime::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element)
870 _EditTime::OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element)
876 _EditTime::OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element)
882 labelText = element.GetLabel();
884 GET_STRING_CONFIG(IDS_COM_BODY_AM, amString);
885 GET_STRING_CONFIG(IDS_COM_POP_PM, pmString);
887 if (labelText == amString || labelText == pmString)
889 labelText.Append(L" Selected");
890 _AccessibilityManager::GetInstance()->ReadContent(labelText);
897 _EditTime::OnAccessibilityValueIncreased(const _AccessibilityContainer&, const _AccessibilityElement&)
903 _EditTime::OnAccessibilityValueDecreased(const _AccessibilityContainer&, const _AccessibilityElement&)