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_DateTimeUtils.h"
34 #include "FUiCtrl_DateTimeDefine.h"
36 using namespace Tizen::Graphics;
37 using namespace Tizen::Base::Runtime;
38 using namespace Tizen::Base;
39 using namespace Tizen::System;
41 namespace Tizen { namespace Ui { namespace Controls
44 IMPLEMENT_PROPERTY(_EditTime);
46 _EditTime::_EditTime(void)
47 : __pEditTimePresenter(null)
48 , __pTimeChangeEvent(null)
49 , __pDateTimeBar(null)
50 , __absoluteBounds(FloatRectangle())
52 , __pAccessibilityEditTimeElement(null)
53 , __pAccessibilityHourElement(null)
54 , __pAccessibilityMinuteElement(null)
55 , __pAccessibilityAmPmElement(null)
59 _EditTime::~_EditTime(void)
61 SettingInfo::RemoveSettingEventListener(*this);
63 delete __pDateTimeBar;
64 __pDateTimeBar = null;
66 delete __pEditTimePresenter;
67 __pEditTimePresenter = null;
69 if (__pTimeChangeEvent != null)
71 delete __pTimeChangeEvent;
72 __pTimeChangeEvent = null;
75 if (__pAccessibilityEditTimeElement)
77 __pAccessibilityEditTimeElement->Activate(false);
78 __pAccessibilityEditTimeElement = null;
80 if (__pAccessibilityHourElement)
82 __pAccessibilityHourElement->Activate(false);
83 __pAccessibilityHourElement = null;
85 if (__pAccessibilityMinuteElement)
87 __pAccessibilityMinuteElement->Activate(false);
88 __pAccessibilityMinuteElement = null;
90 if (__pAccessibilityAmPmElement)
92 __pAccessibilityAmPmElement->Activate(false);
93 __pAccessibilityAmPmElement = null;
98 _EditTime::CreateEditTimeN(const String& title)
100 result r = E_SUCCESS;
102 _AccessibilityContainer* pContainer = null;
104 _EditTime* pEditTime = new (std::nothrow) _EditTime;
105 SysTryReturn(NID_UI_CTRL, pEditTime, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
107 pEditTime->GetVisualElement()->SetSurfaceOpaque(false);
109 pEditTime->__pEditTimePresenter = _EditTimePresenter::CreateInstanceN(*pEditTime, title);
111 SysTryCatch(NID_UI_CTRL, pEditTime->__pEditTimePresenter, , r, "[%s] Propagating.", GetErrorMessage(r));
113 r = pEditTime->CreateDateTimeBar();
114 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
116 pEditTime->__pEditTimePresenter->Initialize();
118 SysTryCatch(NID_UI_CTRL, pEditTime->__pEditTimePresenter, , r, "[%s] Propagating.", GetErrorMessage(r));
120 pEditTime->__pEditTimePresenter->SetCurrentTime();
122 if (title.IsEmpty() != true)
124 pEditTime->__title = title;
127 pContainer = pEditTime->GetAccessibilityContainer();
130 pContainer->Activate(true);
131 pEditTime->CreateAccessibilityElement();
134 pEditTime->AcquireHandle();
144 _EditTime::CreateDateTimeBar(void)
146 result r = E_SUCCESS;
148 __pDateTimeBar = _DateTimeBar::CreateDateTimeBarN(*this);
150 SysTryReturn(NID_UI_CTRL, (__pDateTimeBar != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
152 r = __pDateTimeBar->AddActionEventListener(*this);
153 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
155 r = __pDateTimeBar->AddDateTimeChangeEventListener(*this);
156 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
158 r = SettingInfo::AddSettingEventListener(*this);
159 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
164 delete __pDateTimeBar;
169 _EditTime::AddTimeChangeEventListener(const _IDateTimeChangeEventListener& listener)
171 if (__pTimeChangeEvent == null)
173 __pTimeChangeEvent = new (std::nothrow) _DateTimeChangeEvent(*this);
174 SysTryReturn(NID_UI_CTRL, (__pTimeChangeEvent != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
175 "[E_OUT_OF_MEMORY] Memory allocation failed.");
178 result r = __pTimeChangeEvent->AddListener(listener);
179 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
185 _EditTime::RemoveTimeChangeEventListener(const _IDateTimeChangeEventListener& listener)
187 result r = E_OBJ_NOT_FOUND;
189 if (__pTimeChangeEvent)
191 r = __pTimeChangeEvent->RemoveListener(listener);
194 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
200 _EditTime::SetTime(const DateTime& time)
202 SetProperty("time", Variant(time));
207 _EditTime::SetPropertyTime(const Variant& time)
209 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), E_SYSTEM, E_SYSTEM,
210 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
212 __pEditTimePresenter->SetTime(time.ToDateTime());
214 UpdateAccessibilityElement();
219 _EditTime::GetTime(void) const
221 Variant time = GetProperty("time");
223 return time.ToDateTime();
227 _EditTime::GetPropertyTime(void) const
231 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), Variant(), E_SYSTEM,
232 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
234 time = __pEditTimePresenter->GetTime();
236 return Variant(time);
240 _EditTime::SetHour(int hour)
242 result r = E_SUCCESS;
244 SetProperty("hour", Variant(hour));
252 _EditTime::SetPropertyHour(const Variant& hour)
254 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), E_SYSTEM, E_SYSTEM,
255 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
257 result r = E_SUCCESS;
259 r = __pEditTimePresenter->SetHour(hour.ToInt());
260 SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
262 UpdateAccessibilityElement();
268 _EditTime::GetHour(void) const
270 Variant hour = GetProperty("hour");
276 _EditTime::GetPropertyHour(void) const
280 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), Variant(), E_SYSTEM,
281 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
283 hour = __pEditTimePresenter->GetHour();
285 return Variant(hour);
289 _EditTime::SetMinute(int minute)
291 result r = E_SUCCESS;
293 SetProperty("minute", Variant(minute));
301 _EditTime::SetPropertyMinute(const Variant& minute)
303 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), E_SYSTEM, E_SYSTEM,
304 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
306 result r = E_SUCCESS;
308 r = __pEditTimePresenter->SetMinute(minute.ToInt());
309 SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
311 UpdateAccessibilityElement();
317 _EditTime::GetMinute(void) const
319 Variant minute = GetProperty("minute");
321 return minute.ToInt();
325 _EditTime::GetPropertyMinute(void) const
329 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), Variant(), E_SYSTEM,
330 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
332 minute = __pEditTimePresenter->GetMinute();
334 return Variant(minute);
338 _EditTime::SetCurrentTime(void)
340 SysTryReturnVoidResult(NID_UI_CTRL, (__pEditTimePresenter != null), E_SYSTEM,
341 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
343 __pEditTimePresenter->SetCurrentTime();
345 UpdateAccessibilityElement();
351 _EditTime::SetTimePickerEnabled(bool enable)
353 SetProperty("timePickerEnabled", Variant(enable));
358 _EditTime::SetPropertyTimePickerEnabled(const Variant& enable)
360 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), E_SYSTEM, E_SYSTEM,
361 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
363 __pEditTimePresenter->SetTimePickerEnabled(enable.ToBool());
369 _EditTime::IsTimePickerEnabled(void) const
371 Variant enable = GetProperty("timePickerEnabled");
373 return enable.ToBool();
377 _EditTime::GetPropertyTimePickerEnabled(void) const
381 SysTryReturn(NID_UI_CTRL, (__pEditTimePresenter != null), Variant(), E_SYSTEM,
382 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
384 enable = __pEditTimePresenter->IsTimePickerEnabled();
386 return Variant(enable);
390 _EditTime::Set24HourNotationEnabled(bool enable)
392 SysTryReturnVoidResult(NID_UI_CTRL, (__pEditTimePresenter != null), E_SYSTEM,
393 "[E_SYSTEM] A system error has occurred. The _EditDatePresenter instance is null.");
395 __pEditTimePresenter->Set24HourNotationEnabled(enable);
400 _EditTime::Is24HourNotationEnabled(void) const
402 SysAssertf((__pEditTimePresenter != null), "The _EditDatePresenter instance is null.");
404 return __pEditTimePresenter->Is24HourNotationEnabled();
408 _EditTime::CalculateDateTimeBarPosition(void)
410 result r = E_SUCCESS;
412 float dateTimeBarHeight = 0.0f;
413 float arrowHeight = 0.0f;
414 float timeHeight = 0.0f;
415 float timeBarMargin = 0.0f;
416 float textHeight = 0.0f;
417 float titleTimeMargin = 0.0f;
418 float bottomPosition = 0.0f;
421 FloatRectangle absoluteBounds;
422 FloatRectangle frameBounds;
423 FloatRectangle parentWindowBounds;
424 FloatRectangle titleBounds;
426 _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
427 SysTryReturn(NID_UI_CTRL, (pFrame != null), E_SYSTEM, E_SYSTEM,
428 "[E_SYSTEM] A system error has occurred. Failed to get frame instance.");
430 frameBounds = pFrame->GetAbsoluteBoundsF();
431 absoluteBounds = GetAbsoluteBoundsF();
432 parentWindowBounds = GetParentWindowBounds();
433 titleBounds = __pEditTimePresenter->GetTitleBounds();
435 GET_SHAPE_CONFIG(DATETIMEBAR::ITEM_HEIGHT, GetOrientation(), dateTimeBarHeight);
436 GET_SHAPE_CONFIG(DATETIMEBAR::ARROW_HEIGHT, GetOrientation(), arrowHeight);
437 GET_SHAPE_CONFIG(EDITTIME::TIME_HEIGHT, GetOrientation(), timeHeight);
438 GET_SHAPE_CONFIG(EDITTIME::TIME_BAR_MARGIN, GetOrientation(), timeBarMargin);
439 GET_SHAPE_CONFIG(EDITTIME::TITLE_HEIGHT, GetOrientation(), textHeight);
440 GET_SHAPE_CONFIG(EDITTIME::TITLE_TIME_MARGIN, GetOrientation(), titleTimeMargin);
442 if (!__title.IsEmpty()) //with title
444 timeY = titleBounds.y + textHeight + titleTimeMargin ;
448 timeY = (absoluteBounds.height - timeHeight) / 2.0f ;
451 bottomPosition = absoluteBounds.y + timeY + timeHeight + timeBarMargin + arrowHeight + dateTimeBarHeight;
453 GetDateTimeBar()->SetParentWindowBounds(parentWindowBounds);
455 if (bottomPosition > frameBounds.y + parentWindowBounds.y + parentWindowBounds.height) //ALIGN_UP
457 r = GetDateTimeBar()->SetPositionAndAlignment(FloatPoint(parentWindowBounds.x, absoluteBounds.y + timeY - timeBarMargin - arrowHeight), DATETIME_BAR_ALIGN_UP);
458 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
462 r = GetDateTimeBar()->SetPositionAndAlignment(FloatPoint(parentWindowBounds.x, absoluteBounds.y + timeY + timeHeight + timeBarMargin + arrowHeight), DATETIME_BAR_ALIGN_DOWN);
463 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
466 __absoluteBounds = absoluteBounds;
472 _EditTime::OnDraw(void)
474 if (GetDateTimeBar() != null && GetDateTimeBar()->IsActivated())
476 CalculateDateTimeBarPosition();
479 __pEditTimePresenter->Draw();
481 UpdateAccessibilityElement();
486 _EditTime::CreateAccessibilityElement(void)
488 _AccessibilityContainer* pContainer = GetAccessibilityContainer();
489 FloatRectangle hourBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR);
490 FloatRectangle minuteBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE);
491 FloatRectangle ampmBounds = __pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
493 pContainer->AddListener(*this);
494 if (__pAccessibilityEditTimeElement == null)
496 __pAccessibilityEditTimeElement = new _AccessibilityElement(true);
497 __pAccessibilityEditTimeElement->SetBounds(GetClientBounds());
498 __pAccessibilityEditTimeElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
499 __pAccessibilityEditTimeElement->SetName(L"EditTimeText");
500 pContainer->AddElement(*__pAccessibilityEditTimeElement);
503 if (__pAccessibilityHourElement == null && __pAccessibilityMinuteElement == null)
505 String hintText(L"Double tap to edit");
507 __pAccessibilityHourElement = new _AccessibilityElement(true);
508 __pAccessibilityHourElement->SetBounds(hourBounds);
509 __pAccessibilityHourElement->SetTrait(ACCESSIBILITY_TRAITS_HOUR);
510 __pAccessibilityHourElement->SetHint(hintText);
511 pContainer->AddElement(*__pAccessibilityHourElement);
513 __pAccessibilityMinuteElement = new _AccessibilityElement(true);
514 __pAccessibilityMinuteElement->SetBounds(minuteBounds);
515 __pAccessibilityMinuteElement->SetTrait(ACCESSIBILITY_TRAITS_MINUTE);
516 __pAccessibilityMinuteElement->SetHint(hintText);
517 pContainer->AddElement(*__pAccessibilityMinuteElement);
519 if (Is24HourNotationEnabled() == false)
521 __pAccessibilityAmPmElement = new _AccessibilityElement(true);
522 __pAccessibilityAmPmElement->SetBounds(ampmBounds);
523 __pAccessibilityAmPmElement->SetTrait(ACCESSIBILITY_TRAITS_BUTTON);
524 pContainer->AddElement(*__pAccessibilityAmPmElement);
530 _EditTime::OnBoundsChanged(void)
532 __pEditTimePresenter->Initialize();
534 if (__pAccessibilityEditTimeElement)
536 __pAccessibilityEditTimeElement->SetBounds(__pEditTimePresenter->GetTitleBounds());
538 if (__pAccessibilityHourElement)
540 __pAccessibilityHourElement->SetBounds(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR));
542 if (__pAccessibilityMinuteElement)
544 __pAccessibilityMinuteElement->SetBounds(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE));
546 if (__pAccessibilityAmPmElement)
548 __pAccessibilityAmPmElement->SetBounds(__pEditTimePresenter->GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM));
555 _EditTime::OnChangeLayout(_ControlOrientation orientation)
559 GET_SHAPE_CONFIG(EDITTIME::WIDTH, GetOrientation(), dim.width);
560 GET_SHAPE_CONFIG(EDITTIME::HEIGHT, GetOrientation(), dim.height);
564 __pEditTimePresenter->Initialize();
565 __pEditTimePresenter->SetLastSelectedId(DATETIME_ID_NONE);
567 if (GetDateTimeBar() != null)
569 GetDateTimeBar()->SetVisibleState(false);
570 GetDateTimeBar()->Close();
577 _EditTime::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
581 return __pEditTimePresenter->OnTouchPressed(source, touchinfo);
585 _EditTime::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
587 FloatRectangle absoluteBounds = GetAbsoluteBoundsF();
589 if (absoluteBounds.y != __absoluteBounds.y || absoluteBounds.height != __absoluteBounds.height)
591 CalculateDateTimeBarPosition();
594 return __pEditTimePresenter->OnTouchReleased(source, touchinfo);
598 _EditTime::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
600 return __pEditTimePresenter->OnTouchCanceled(source, touchinfo);
604 _EditTime::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
606 return __pEditTimePresenter->OnTouchMoved(source, touchinfo);
610 _EditTime::OnTouchMoveHandled(const _Control& control)
612 __pEditTimePresenter->OnTouchMoveHandled(control);
617 _EditTime::FireTimeChangeEvent(_DateTimeChangeStatus status)
619 SysTryReturn(NID_UI_CTRL, (__pTimeChangeEvent != null), E_SYSTEM, E_SYSTEM,
620 "[E_SYSTEM] A system error has occurred. The _DateTimeChangeEvent instance is null.");
622 _DateTimeChangeEventArg* pDateTimeEventArg = new (std::nothrow) _DateTimeChangeEventArg(status);
623 SysTryReturn(NID_UI_CTRL, pDateTimeEventArg, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
624 "[E_OUT_OF_MEMORY] Memory allocation failed.");
626 pDateTimeEventArg->SetTime(GetHour(), GetMinute());
628 __pTimeChangeEvent->Fire(*pDateTimeEventArg);
634 _EditTime::OnDateTimeChanged(const _Control& source, int year, int month, int day, int hour, int minute)
636 __pEditTimePresenter->Animate();
637 __pEditTimePresenter->SetLastSelectedId(DATETIME_ID_NONE);
639 FireTimeChangeEvent(TIME_INTERNAL_CHANGE_SAVED);
644 _EditTime::OnDateTimeChangeCanceled(const _Control& source)
646 __pEditTimePresenter->SetLastSelectedId(DATETIME_ID_NONE);
648 FireTimeChangeEvent(TIME_INTERNAL_CHANGE_CANCELED);
653 _EditTime::OnActionPerformed(const Ui::_Control& source, int actionId)
655 _DateTimeId boxId = __pEditTimePresenter->GetLastSelectedId();
657 if (boxId == DATETIME_ID_HOUR)
659 bool amEnable = true;
660 amEnable = __pEditTimePresenter->GetAmEnabled();
664 if (amEnable == false && Is24HourNotationEnabled() == false)
666 if (hour < DATETIME_HOUR_MAX_FOR_24NOTATION)
668 hour += DATETIME_HOUR_MAX_FOR_24NOTATION;
671 else if (amEnable == true && Is24HourNotationEnabled() == false)
673 if (hour == DATETIME_HOUR_MAX_FOR_24NOTATION)
675 hour = DATETIME_HOUR_MIN;
680 else if (boxId == DATETIME_ID_MINUTE)
690 _EditTime::GetDateTimeBar(void) const
692 return __pDateTimeBar;
696 _EditTime::OnFontChanged(Font* pFont)
698 __pEditTimePresenter->OnFontChanged(pFont);
704 _EditTime::OnFontInfoRequested(unsigned long& style, float& size)
706 __pEditTimePresenter->OnFontInfoRequested(style, size);
712 _EditTime::OnSettingChanged(String& key)
714 if (key.Equals(L"http://tizen.org/setting/locale.time.format.24hour", false))
716 __pEditTimePresenter->UpdateTimeFormat();
724 _EditTime::GetParentWindowBounds(void) const
727 _Window* pwindow = null;
728 _Control* pControlCore = GetParent();
730 FloatDimension dateTimeBarSize(0.0f, 0.0f);
732 GET_DIMENSION_CONFIG(DATETIMEBAR::DEFAULT_SIZE, GetOrientation(), dateTimeBarSize);
734 FloatRectangle parentWindowBounds(0.0f, 0.0f, dateTimeBarSize.width, dateTimeBarSize.height);
738 if (pControlCore == null)
740 SysLog(NID_UI_CTRL,"[E_SYSTEM] Parent window not found.");
742 return parentWindowBounds;
745 // If the parent is a Frame, then return the Form's bounds.
746 pForm = dynamic_cast<_Form*>(pControlCore);
749 parentWindowBounds = pForm->GetBoundsF();
753 pwindow = dynamic_cast<_Window*>(pControlCore);
757 parentWindowBounds = pwindow->GetBoundsF();
761 pControlCore = pControlCore->GetParent();
764 return parentWindowBounds;
768 _EditTime::UpdateAccessibilityElement(void)
772 if (likely(!(_AccessibilityManager::IsActivated())))
777 if (__pAccessibilityEditTimeElement == null && __pAccessibilityHourElement == null
778 && __pAccessibilityMinuteElement == null && __pAccessibilityAmPmElement == null)
783 if (__title.IsEmpty() == false)
785 string.Append(__title);
786 string.Append(L", ");
790 int hour = GetHour();
791 int maxHour = DATETIME_HOUR_MAX_FOR_24NOTATION;
793 if (Is24HourNotationEnabled() == false && (hour > maxHour))
795 hourString.Format(10, L"%02d", hour - DATETIME_HOUR_MAX_FOR_24NOTATION);
799 hourString.Format(10, L"%02d", hour);
802 string.Append(hourString.GetPointer());
804 string.Append(GetMinute());
807 if (Is24HourNotationEnabled() == false)
809 String hintAmPmText(L"Double tap to change to ");
813 _DateTimeUtils dateTimeUtils;
814 dateTimeUtils.GetAmPm(amString, AM_TYPE);
815 dateTimeUtils.GetAmPm(pmString, PM_TYPE);
817 if (__pEditTimePresenter->GetAmEnabled() == true)
819 __pAccessibilityAmPmElement->SetLabel(amString);
820 hintAmPmText.Append(pmString.GetPointer());
821 string.Append(amString.GetPointer());
825 __pAccessibilityAmPmElement->SetLabel(pmString);
826 hintAmPmText.Append(amString.GetPointer());
827 string.Append(pmString.GetPointer());
830 __pAccessibilityAmPmElement->SetHint(hintAmPmText);
833 __pAccessibilityEditTimeElement->SetLabel(string);
835 __pAccessibilityHourElement->SetLabel(hourString);
838 string.Format(10, L"%02d", GetMinute());
839 __pAccessibilityMinuteElement->SetLabel(string);
845 _EditTime::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element)
851 _EditTime::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element)
857 _EditTime::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
863 _EditTime::OnAccessibilityReadedElement(const _AccessibilityContainer& control, const _AccessibilityElement& element)
870 _EditTime::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element)
876 _EditTime::OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element)
882 _EditTime::OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element)
888 labelText = element.GetLabel();
890 _DateTimeUtils dateTimeUtils;
891 dateTimeUtils.GetAmPm(amString, AM_TYPE);
892 dateTimeUtils.GetAmPm(pmString, PM_TYPE);
894 if (labelText == amString || labelText == pmString)
896 labelText.Append(L" Selected");
897 _AccessibilityManager::GetInstance()->ReadContent(labelText);
904 _EditTime::OnAccessibilityValueIncreased(const _AccessibilityContainer&, const _AccessibilityElement&)
910 _EditTime::OnAccessibilityValueDecreased(const _AccessibilityContainer&, const _AccessibilityElement&)