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_EditTimePresenter.cpp
20 * @brief This is the implementation file for the _EditTimePresenter class.
23 #include <FGrp_BitmapImpl.h>
24 #include <FGrp_TextTextObject.h>
25 #include <FGrp_TextTextSimple.h>
26 #include <FGrp_FontImpl.h>
27 #include "FUi_ResourceManager.h"
28 #include "FUiCtrl_EditTimePresenter.h"
29 #include "FUiCtrl_EditTime.h"
30 #include "FUiCtrl_DateTimeModel.h"
31 #include "FUiCtrl_DateTimeUtils.h"
32 #include "FUiAnim_VisualElement.h"
33 #include "FUiAnimVisualElementPropertyAnimation.h"
34 #include "FGrpColor.h"
36 using namespace Tizen::Graphics;
37 using namespace Tizen::Base;
38 using namespace Tizen::Graphics::_Text;
39 using namespace Tizen::Ui::Animations;
41 namespace Tizen { namespace Ui { namespace Controls
43 _EditTimePresenter::_EditTimePresenter(const String& title)
44 : __pEditDateTimeModel(null)
46 , __bounds(Rectangle())
47 , __titleBounds(Rectangle())
48 , __ampmString(String())
49 , __hourString(String())
50 , __minuteString(String())
54 , __timePickerEnabled(true)
55 , __selectedId(DATETIME_ID_NONE)
56 , __lastSelectedId(DATETIME_ID_NONE)
57 , __touchMoveHandled(false)
58 , __pAmPmBgNormalColorReplacementBitmap(null)
59 , __pAmPmBgDisabledColorReplacementBitmap(null)
60 , __pAmPmBgPressedColorReplacementBitmap(null)
61 , __pAmPmBgEffectNomralBitmap(null)
62 , __pAmPmBgEffectPressedBitmap(null)
63 , __pAmPmBgEffectDisabledBitmap(null)
64 , __pColonColorReplacementBitmap(null)
65 , __pColonDisabledColorReplacementBitmap(null)
66 , __pContentProvider(null)
73 , __isAnimating(false)
74 , __isEditTimeInitialized(false)
78 _EditTimePresenter::~_EditTimePresenter(void)
80 __textObject.RemoveAll();
81 __titleObject.RemoveAll();
83 delete __pEditDateTimeModel;
84 __pEditDateTimeModel = null;
86 delete __pAmPmBgNormalColorReplacementBitmap;
87 __pAmPmBgNormalColorReplacementBitmap = null;
89 delete __pAmPmBgDisabledColorReplacementBitmap;
90 __pAmPmBgDisabledColorReplacementBitmap = null;
92 delete __pAmPmBgPressedColorReplacementBitmap;
93 __pAmPmBgPressedColorReplacementBitmap = null;
95 delete __pAmPmBgEffectNomralBitmap;
96 __pAmPmBgEffectNomralBitmap = null;
98 delete __pAmPmBgEffectPressedBitmap;
99 __pAmPmBgEffectPressedBitmap = null;
101 delete __pAmPmBgEffectDisabledBitmap;
102 __pAmPmBgEffectDisabledBitmap = null;
104 delete __pColonColorReplacementBitmap;
105 __pColonColorReplacementBitmap = null;
107 delete __pColonDisabledColorReplacementBitmap;
108 __pColonDisabledColorReplacementBitmap = null;
112 _EditTimePresenter::CreateInstanceN(const _EditTime& editTime, const String& title)
114 _EditTimePresenter* pEditTimePresenter = new (std::nothrow) _EditTimePresenter(title);
115 SysTryReturn(NID_UI_CTRL, pEditTimePresenter, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
117 pEditTimePresenter->__pEditTime = const_cast <_EditTime*>(&editTime);
119 pEditTimePresenter->__pEditDateTimeModel = new (std::nothrow) _DateTimeModel;
120 SysTryCatch(NID_UI_CTRL, pEditTimePresenter->__pEditDateTimeModel, , E_OUT_OF_MEMORY,
121 "[E_OUT_OF_MEMORY] Memory allocation failed.");
123 return pEditTimePresenter;
126 delete pEditTimePresenter;
131 _EditTimePresenter::GetTime(void) const
134 time.SetValue(DATETIME_YEAR_MIN, DATETIME_MONTH_MIN, DATETIME_DAY_MIN, GetHour(), GetMinute(), 0);
140 _EditTimePresenter::GetHour(void) const
142 return __pEditDateTimeModel->GetHour();
146 _EditTimePresenter::GetMinute(void) const
148 return __pEditDateTimeModel->GetMinute();
152 _EditTimePresenter::SetTime(const DateTime& time)
154 __pEditDateTimeModel->SetDateTime(time);
158 _EditTimePresenter::SetCurrentTime(void)
160 __pEditDateTimeModel->SetCurrentDateTime();
165 _EditTimePresenter::SetHour(int hour)
167 return __pEditDateTimeModel->SetHour(hour);
171 _EditTimePresenter::SetMinute(int minute)
173 return __pEditDateTimeModel->SetMinute(minute);
177 _EditTimePresenter::SetTimePickerEnabled(bool enable)
179 __timePickerEnabled = enable;
184 _EditTimePresenter::IsTimePickerEnabled(void) const
186 return __timePickerEnabled;
190 _EditTimePresenter::Set24HourNotationEnabled(bool enable)
197 _EditTimePresenter::Is24HourNotationEnabled(void) const
203 _EditTimePresenter::SetTimeConversion(void)
205 int hour = GetHour();
206 int minute = GetMinute();
208 if (__24hours == false)
210 int max = DATETIME_HOUR_MAX_FOR_24NOTATION;
214 __hourString.Format(10, L"%02d", hour - max);
216 else if (hour == DATETIME_HOUR_MIN)
218 __hourString.Format(10, L"%02d", hour + DATETIME_HOUR_MAX_FOR_24NOTATION);
222 __hourString.Format(10, L"%02d", hour);
225 __minuteString.Format(10, L"%02d", minute);
229 __hourString.Format(10, L"%02d", hour);
230 __minuteString.Format(10, L"%02d", minute);
237 _EditTimePresenter::SetAmEnabled(bool amEnable)
242 GET_STRING_CONFIG(IDS_COM_BODY_AM, textAm);
243 GET_STRING_CONFIG(IDS_COM_POP_PM, textPm);
245 __amEnable = amEnable;
246 int hour = GetHour();
248 if (__amEnable == true)
250 __ampmString = textAm;
251 if (hour >= DATETIME_HOUR_MAX_FOR_24NOTATION)
253 SetHour(hour - DATETIME_HOUR_MAX_FOR_24NOTATION);
258 __ampmString = textPm;
259 if (hour < DATETIME_HOUR_MAX_FOR_24NOTATION)
261 SetHour(hour + DATETIME_HOUR_MAX_FOR_24NOTATION);
269 _EditTimePresenter::GetAmEnabled(void) const
275 _EditTimePresenter::GetDisplayAreaBoundsFromHoursStyle(_DateTimeId displayBoxId) const
277 SysTryReturn(NID_UI_CTRL, displayBoxId >= DATETIME_ID_HOUR && displayBoxId <= DATETIME_ID_AMPM, Rectangle(),
278 E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] displayBoxId is out of range.");
280 Rectangle bounds(0, 0, 0, 0);
286 int timeElementWidth = 0;
289 int titleTimeMargin = 0;
292 GET_SHAPE_CONFIG(EDITTIME::TIME_WIDTH, __pEditTime->GetOrientation(), width);
293 GET_SHAPE_CONFIG(EDITTIME::HEIGHT, __pEditTime->GetOrientation(), bounds.height);
294 GET_SHAPE_CONFIG(EDITTIME::COLON_WIDTH, __pEditTime->GetOrientation(), colonWidth);
295 GET_SHAPE_CONFIG(EDITTIME::TIME_AMPM_MARGIN, __pEditTime->GetOrientation(), margin);
296 GET_SHAPE_CONFIG(EDITTIME::TIME_TEXT_LEFT_MARGIN, __pEditTime->GetOrientation(), leftMargin);
297 GET_SHAPE_CONFIG(EDITTIME::COLON_MARGIN, __pEditTime->GetOrientation(), colonMargin);
298 GET_SHAPE_CONFIG(EDITTIME::HOUR_MINUTE_WIDTH, __pEditTime->GetOrientation(), timeElementWidth);
299 GET_SHAPE_CONFIG(EDITTIME::AMPM_HEIGHT, __pEditTime->GetOrientation(), amPmHeight);
300 GET_SHAPE_CONFIG(EDITTIME::TITLE_TIME_MARGIN, __pEditTime->GetOrientation(), titleTimeMargin);
301 GET_SHAPE_CONFIG(EDITTIME::TIME_HEIGHT, __pEditTime->GetOrientation(), timeHeight);
303 if (__pEditTime->GetBounds().height > bounds.height)
305 bounds.height = __pEditTime->GetBounds().height;
308 if (!__title.IsEmpty())
310 if (displayBoxId == DATETIME_ID_AMPM)
312 bounds.y = __titleBounds.y + __titleBounds.height;
316 bounds.y = __titleBounds.y + __titleBounds.height + titleTimeMargin;
317 bounds.height = timeHeight;
321 bounds.x = leftMargin + ((width - (2 * timeElementWidth + colonWidth + 2 * colonMargin)) / 2);
323 if (displayBoxId == DATETIME_ID_HOUR)
325 bounds.width = timeElementWidth;
327 else if (displayBoxId == DATETIME_ID_MINUTE)
329 bounds.x = bounds.x + timeElementWidth + colonWidth + 2 * colonMargin;
330 bounds.width = timeElementWidth;
332 else if (displayBoxId == DATETIME_ID_AMPM)
334 bounds.x = leftMargin + width + margin;
336 if (__title.IsEmpty())
338 bounds.y = bounds.y + (bounds.height - amPmHeight) / 2;
341 GET_SHAPE_CONFIG(EDITTIME::AMPM_WIDTH, __pEditTime->GetOrientation(), bounds.width);
342 bounds.height = amPmHeight;
349 _EditTimePresenter::SetTitleBounds(void)
351 GET_SHAPE_CONFIG(EDITTIME::TIME_TEXT_LEFT_MARGIN, __pEditTime->GetOrientation(), __titleBounds.x);
352 GET_SHAPE_CONFIG(EDITTIME::WIDTH, __pEditTime->GetOrientation(), __titleBounds.width);
353 GET_SHAPE_CONFIG(EDITTIME::TEXT_HEIGHT, __pEditTime->GetOrientation(), __titleBounds.height);
359 _EditTimePresenter::GetTitleBounds(void) const
361 return __titleBounds;
365 _EditTimePresenter::LoadResource(void)
367 result r = E_SUCCESS;
369 Color buttonNormalBgColor;
370 Color buttonDisabledBgColor;
371 Color buttonNormalPressedColor;
372 Color colonTextColor;
373 Color colonTextDisabledColor;
374 Bitmap* pTempBitmap = null;
376 GET_COLOR_CONFIG(EDITTIME::BUTTON_BG_NORMAL, buttonNormalBgColor);
377 GET_COLOR_CONFIG(EDITTIME::BUTTON_BG_PRESSED, buttonNormalPressedColor);
378 GET_COLOR_CONFIG(EDITTIME::BUTTON_BG_DISABLED, buttonDisabledBgColor);
379 GET_COLOR_CONFIG(EDITTIME::TEXT_NORMAL, colonTextColor);
380 GET_COLOR_CONFIG(EDITTIME::TEXT_DISABLED, colonTextDisabledColor);
382 GET_SHAPE_CONFIG(EDITTIME::AMPM_FONT_SIZE, __pEditTime->GetOrientation(), __amPmTextSize);
384 r = GET_BITMAP_CONFIG_N(EDITTIME::COLON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
385 SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
387 __pColonColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_WHITE),
389 SysTryCatch(NID_UI_CTRL, (__pColonColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(),
390 "[%s] Propagating.", GetErrorMessage(GetLastResult()));
392 __pColonDisabledColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_WHITE),
393 colonTextDisabledColor);
394 SysTryCatch(NID_UI_CTRL, (__pColonDisabledColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(),
395 "[%s] Propagating.", GetErrorMessage(GetLastResult()));
400 r = GET_BITMAP_CONFIG_N(EDITTIME::BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap);
401 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
403 __pAmPmBgNormalColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonNormalBgColor);
404 SysTryCatch(NID_UI_CTRL, (__pAmPmBgNormalColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(),
405 "[%s] Propagating.", GetErrorMessage(GetLastResult()));
407 __pAmPmBgDisabledColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonDisabledBgColor);
408 SysTryCatch(NID_UI_CTRL, (__pAmPmBgDisabledColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(),
409 "[%s] Propagating.", GetErrorMessage(GetLastResult()));
411 __pAmPmBgPressedColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonNormalPressedColor);
412 SysTryCatch(NID_UI_CTRL, (__pAmPmBgPressedColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(),
413 "[%s] Propagating.", GetErrorMessage(GetLastResult()));
415 r = GET_BITMAP_CONFIG_N(EDITTIME::BUTTON_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pAmPmBgEffectNomralBitmap);
416 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
418 r = GET_BITMAP_CONFIG_N(EDITTIME::BUTTON_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pAmPmBgEffectPressedBitmap);
419 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
421 r = GET_BITMAP_CONFIG_N(EDITTIME::BUTTON_BG_EFFECT_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pAmPmBgEffectDisabledBitmap);
422 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
434 delete __pAmPmBgNormalColorReplacementBitmap;
435 __pAmPmBgNormalColorReplacementBitmap = null;
437 delete __pAmPmBgPressedColorReplacementBitmap;
438 __pAmPmBgPressedColorReplacementBitmap = null;
440 delete __pAmPmBgEffectNomralBitmap;
441 __pAmPmBgEffectNomralBitmap = null;
443 delete __pAmPmBgEffectPressedBitmap;
444 __pAmPmBgEffectPressedBitmap = null;
446 delete __pColonColorReplacementBitmap;
447 __pColonColorReplacementBitmap = null;
453 _EditTimePresenter::DrawResourceBitmap(Canvas& canvas, const Rectangle& bounds, Bitmap* pBitmap)
455 result r = E_SUCCESS;
462 if (pBitmap->IsNinePatchedBitmap())
464 r = canvas.DrawNinePatchedBitmap(bounds, *pBitmap);
465 SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
469 r = canvas.DrawBitmap(bounds, *pBitmap);
470 SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
477 _EditTimePresenter::InitializeTitleObject(void)
479 result r = E_SUCCESS;
481 Color titleNormalColor;
483 GET_COLOR_CONFIG(EDITTIME::TITLE_TEXT_NORMAL, titleNormalColor);
485 r = __titleObject.Construct();
486 SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
488 TextSimple* pSimpleText = null;
490 pSimpleText = new (std::nothrow)TextSimple((const_cast <wchar_t*>(__title.GetPointer())), __title.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
491 SysTryReturn(NID_UI_CTRL, (pSimpleText != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
493 __titleObject.AppendElement(*pSimpleText);
495 __titleObject.SetForegroundColor(titleNormalColor, 0, __titleObject.GetTextLength());
496 __titleObject.SetFont(__pFont, 0, __titleObject.GetTextLength());
497 __titleObject.SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_MIDDLE);
498 __titleObject.SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
499 __titleObject.SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
505 _EditTimePresenter::InitializeTextObject(void)
507 result r = E_SUCCESS;
509 r = __textObject.Construct();
510 SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
512 TextSimple* pSimpleText = new (std::nothrow)TextSimple(null, 0, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
513 SysTryReturn(NID_UI_CTRL, (pSimpleText != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
514 "[E_OUT_OF_MEMORY] Memory allocation failed.");
516 __textObject.AppendElement(*pSimpleText);
518 __textObject.SetFont(__pFont, 0, __textObject.GetTextLength());
519 __textObject.SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE);
520 __textObject.SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
521 __textObject.SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
527 _EditTimePresenter::Draw(void)
529 result r = E_SUCCESS;
536 Canvas* pCanvas = __pEditTime->GetCanvasN();
537 SysAssertf((pCanvas != null), "Failed to get canvas.");
539 Rectangle colonBounds;
544 pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
547 Rectangle hourBounds(0, 0, 0, 0);
548 Rectangle minuteBounds(0, 0, 0, 0);
549 Rectangle ampmBounds(0, 0, 0, 0);
551 hourBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR);
552 minuteBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE);
554 if (__24hours == false)
556 ampmBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
559 if (__24hours == false)
561 if (!__pEditTime->IsEnabled())
563 r = DrawResourceBitmap(*pCanvas, ampmBounds, __pAmPmBgDisabledColorReplacementBitmap);
564 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
566 r = DrawResourceBitmap(*pCanvas, ampmBounds, __pAmPmBgEffectDisabledBitmap);
567 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
569 else if (__selectedId != DATETIME_ID_AMPM)
571 r = DrawResourceBitmap(*pCanvas, ampmBounds, __pAmPmBgNormalColorReplacementBitmap);
572 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
574 r = DrawResourceBitmap(*pCanvas, ampmBounds, __pAmPmBgEffectNomralBitmap);
575 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
579 r = DrawResourceBitmap(*pCanvas, ampmBounds, __pAmPmBgPressedColorReplacementBitmap);
580 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
582 r = DrawResourceBitmap(*pCanvas, ampmBounds, __pAmPmBgEffectPressedBitmap);
583 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
587 if (GetHour() >= DATETIME_HOUR_MAX_FOR_24NOTATION)
598 GET_SHAPE_CONFIG(EDITTIME::COLON_WIDTH, __pEditTime->GetOrientation(), colonBounds.width);
599 GET_SHAPE_CONFIG(EDITTIME::COLON_MARGIN, __pEditTime->GetOrientation(), colonMargin);
600 GET_SHAPE_CONFIG(EDITTIME::AMPM_HEIGHT, __pEditTime->GetOrientation(), colonBounds.height);
602 colonBounds.x = hourBounds.x + hourBounds.width + colonMargin;
603 colonBounds.y = hourBounds.y + (hourBounds.height - colonBounds.height) / 2;
605 if (__title.IsEmpty() == false)
607 r = DrawTitle(*pCanvas);
608 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
611 r = DrawText(*pCanvas, hourBounds, __hourString);
612 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
614 r = DrawText(*pCanvas, minuteBounds, __minuteString);
615 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
617 if (__24hours == false)
619 r = DrawText(*pCanvas, ampmBounds, __ampmString, __amPmTextSize);
620 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
623 r = DrawColon(*pCanvas, colonBounds);
624 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
633 _EditTimePresenter::DrawColon(Canvas& canvas, const Rectangle& bounds)
635 result r = E_SUCCESS;
637 if (!__pEditTime->IsEnabled())
639 r = DrawResourceBitmap(canvas, bounds, __pColonDisabledColorReplacementBitmap);
643 r = DrawResourceBitmap(canvas, bounds, __pColonColorReplacementBitmap);
648 r = DrawText(canvas, bounds, L":");
649 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
656 _EditTimePresenter::DrawTitle(Canvas& canvas)
658 if (!__pEditTime->IsEnabled())
660 Color titleDisabledColor;
661 GET_COLOR_CONFIG(EDITTIME::TITLE_TEXT_DISABLED, titleDisabledColor);
662 __titleObject.SetForegroundColor(titleDisabledColor, 0, __titleObject.GetTextLength());
665 (_FontImpl::GetInstance(*__pFont))->SetSize(__titleFontSize);
666 __titleObject.SetFont(__pFont, 0, __titleObject.GetTextLength());
668 __titleObject.Draw(*_CanvasImpl::GetInstance(canvas));
674 _EditTimePresenter::DrawText(Canvas& canvas, const Rectangle& bounds, const String& text, int textSize)
676 result r = E_SUCCESS;
681 _DateTimeId boxId = DATETIME_ID_NONE;
682 boxId = GetBoxIdFromPosition(Point(bounds.x + 1, bounds.y));
684 if (!__pEditTime->IsEnabled())
686 if (boxId == DATETIME_ID_AMPM)
688 GET_COLOR_CONFIG(EDITTIME::BUTTON_TEXT_DISABLED, textColor);
692 GET_COLOR_CONFIG(EDITTIME::TEXT_DISABLED, textColor);
697 GET_COLOR_CONFIG(EDITTIME::TEXT_NORMAL, textColor);
699 if (boxId == DATETIME_ID_AMPM)
701 GET_COLOR_CONFIG(EDITTIME::BUTTON_TEXT_NORMAL, textColor);
704 if (boxId > -1 && boxId == __selectedId)
706 if (boxId == DATETIME_ID_AMPM)
708 GET_COLOR_CONFIG(EDITTIME::BUTTON_TEXT_PRESSED, textColor);
712 GET_COLOR_CONFIG(EDITTIME::TEXT_PRESSED, textColor);
717 Rectangle drawAreaBounds(0, 0, 0, 0);
718 drawAreaBounds = bounds;
720 TextSimple* pSimpleText = null;
721 pSimpleText = new (std::nothrow)TextSimple((const_cast <wchar_t*>(text.GetPointer())), text.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
722 SysTryReturn(NID_UI_CTRL, (pSimpleText != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
724 __textObject.RemoveAll();
726 (_FontImpl::GetInstance(*__pFont))->SetSize(__timeFontSize);
728 __textObject.AppendElement(*pSimpleText);
730 if (boxId == DATETIME_ID_AMPM)
732 (_FontImpl::GetInstance(*__pFont))->SetSize(textSize);
733 __textObject.SetFont(__pFont, 0, __textObject.GetTextLength());
737 __textObject.SetFont(__pFont, 0, __textObject.GetTextLength());
740 __textObject.SetForegroundColor(textColor, 0, __textObject.GetTextLength());
741 __textObject.SetBounds(drawAreaBounds);
742 __textObject.Draw(*_CanvasImpl::GetInstance(canvas));
748 _EditTimePresenter::GetBoxIdFromPosition(const Point& point) const
750 _DateTimeId displayBoxId = DATETIME_ID_NONE;
752 Rectangle hourBounds;
753 Rectangle minuteBounds;
754 Rectangle ampmBounds;
756 hourBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR);
757 minuteBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE);
759 if (__24hours == false)
761 ampmBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
764 if (point.y < hourBounds.y || point.y > hourBounds.y + hourBounds.height)
769 if (hourBounds.Contains(point) == true)
771 displayBoxId = DATETIME_ID_HOUR;
773 else if (minuteBounds.Contains(point) == true)
775 displayBoxId = DATETIME_ID_MINUTE;
777 else if (ampmBounds.Contains(point) == true)
779 displayBoxId = DATETIME_ID_AMPM;
786 _EditTimePresenter::SetLastSelectedId(_DateTimeId boxId)
788 __lastSelectedId = boxId;
793 _EditTimePresenter::GetLastSelectedId(void) const
795 return __lastSelectedId;
799 _EditTimePresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
801 SysTryReturn(NID_UI_CTRL, IsTimePickerEnabled() == true, true, E_SYSTEM, "[E_SYSTEM] A system error has occurred. EditTime instance is disabled.");
803 if (&source != __pEditTime)
808 __touchMoveHandled = false;
810 Rectangle hourBounds(0, 0, 0, 0);
811 Rectangle minuteBounds(0, 0, 0, 0);
812 Rectangle ampmBounds(0, 0, 0, 0);
814 hourBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR);
815 minuteBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE);
817 if (__24hours == false)
819 ampmBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
822 Point point = touchinfo.GetCurrentPosition();
824 _DateTimeId boxId = GetBoxIdFromPosition(point);
828 int displayValue = -1;
830 if (boxId == DATETIME_ID_HOUR)
832 if (__pEditTime->GetDateTimeBar() != null)
834 if (__24hours == false)
838 minValue = DATETIME_HOUR_MIN + 1;
839 maxValue = DATETIME_HOUR_MAX_FOR_24NOTATION;
840 displayValue = DATETIME_HOUR_MAX_FOR_24NOTATION;
842 else if (GetHour() > DATETIME_HOUR_MAX_FOR_24NOTATION)
844 minValue = DATETIME_HOUR_MIN + 1;
845 maxValue = DATETIME_HOUR_MAX_FOR_24NOTATION;
846 displayValue = GetHour() - DATETIME_HOUR_MAX_FOR_24NOTATION;
850 minValue = DATETIME_HOUR_MIN + 1;
851 maxValue = DATETIME_HOUR_MAX_FOR_24NOTATION;
852 displayValue = GetHour();
857 minValue = DATETIME_HOUR_MIN;
858 maxValue = DATETIME_HOUR_MAX;
859 displayValue = GetHour();
862 if (__pEditTime->GetDateTimeBar()->GetItemCount() > 0)
864 __pEditTime->GetDateTimeBar()->RemoveAllItems();
867 __pEditTime->GetDateTimeBar()->SetInitialValue(minValue, maxValue, displayValue, boxId);
870 __bounds = hourBounds;
872 else if (boxId == DATETIME_ID_MINUTE)
874 if (__pEditTime->GetDateTimeBar() != null)
876 minValue = DATETIME_MINUTE_MIN;
877 maxValue = DATETIME_MINUTE_MAX;
878 displayValue = GetMinute();
880 if (__pEditTime->GetDateTimeBar()->GetItemCount() > 0)
882 __pEditTime->GetDateTimeBar()->RemoveAllItems();
885 __pEditTime->GetDateTimeBar()->SetInitialValue(minValue, maxValue, displayValue, boxId);
888 __bounds = minuteBounds;
890 else if (boxId == DATETIME_ID_AMPM)
892 __bounds = ampmBounds;
896 __selectedId = DATETIME_ID_NONE;
899 __selectedId = boxId;
907 _EditTimePresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
909 SysTryReturn(NID_UI_CTRL, IsTimePickerEnabled() == true, true, E_SYSTEM, "[E_SYSTEM] A system error has occurred. EditTime instance is disabled.");
911 if (&source != __pEditTime)
916 Rectangle bounds = __pEditTime->GetBounds();
918 Point startPoint(0, 0);
919 GET_SHAPE_CONFIG(EDITTIME::TEXT_HEIGHT, __pEditTime->GetOrientation(), startPoint.y);
921 __bounds = Rectangle(startPoint.x, startPoint.y, bounds.width, bounds.height);
923 Point point = touchinfo.GetCurrentPosition();
925 _DateTimeId boxId = GetBoxIdFromPosition(point);
929 __selectedId = DATETIME_ID_NONE;
932 if (boxId != __selectedId)
934 __selectedId = DATETIME_ID_NONE;
937 SetLastSelectedId(__selectedId);
938 __selectedId = DATETIME_ID_NONE;
940 __lastSelectedValue = "";
941 _DateTimeUtils dateTimeUtils;
942 if (GetLastSelectedId() == DATETIME_ID_HOUR)
944 int hours = GetHour();
946 if (!Is24HourNotationEnabled())
950 if (hours == DATETIME_HOUR_MIN)
952 hours = hours + DATETIME_HOUR_MAX_FOR_24NOTATION;
955 __lastSelectedValue.Format(10, L"%02d", hours);
957 else if (GetLastSelectedId() == DATETIME_ID_MINUTE)
959 __lastSelectedValue.Format(10, L"%02d", GetMinute());
962 if (GetLastSelectedId() == DATETIME_ID_AMPM)
964 SetAmEnabled(!GetAmEnabled());
965 __pEditTime->FireTimeChangeEvent(TIME_INTERNAL_CHANGE_SAVED);
966 __pEditTime->UpdateAccessibilityElement();
971 if (__pEditTime->GetDateTimeBar() != null && boxId != DATETIME_ID_AMPM && GetLastSelectedId() != DATETIME_ID_NONE)
973 Rectangle bounds(0, 0, 0, 0);
974 bounds = GetDisplayAreaBoundsFromHoursStyle(GetLastSelectedId());
975 Rectangle absoluteBounds = Rectangle(0, 0, 0, 0);
976 absoluteBounds = __pEditTime->GetAbsoluteBounds();
977 bounds.x += absoluteBounds.x;
979 __pEditTime->GetDateTimeBar()->CalculateArrowBounds(bounds);
980 __pEditTime->GetDateTimeBar()->SetVisibleState(true);
981 __pEditTime->GetDateTimeBar()->Open();
988 _EditTimePresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
990 if (&source != __pEditTime)
995 __selectedId = DATETIME_ID_NONE;
1003 _EditTimePresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
1005 if (&source != __pEditTime)
1010 Point touchPoint = touchinfo.GetCurrentPosition();
1012 if (GetBoxIdFromPosition(touchPoint) != __selectedId)
1014 __selectedId = DATETIME_ID_NONE;
1017 __pEditTime->Invalidate();
1022 _EditTimePresenter::OnTouchMoveHandled(const _Control& control)
1024 __touchMoveHandled = true;
1025 __selectedId = DATETIME_ID_NONE;
1026 __pEditTime->Invalidate();
1031 _EditTimePresenter::OnFontChanged(Font* pFont)
1035 if (__pEditTime->GetDateTimeBar() != null)
1037 __pEditTime->GetDateTimeBar()->SetFont(*pFont);
1044 _EditTimePresenter::OnFontInfoRequested(unsigned long& style, int& size)
1046 style = FONT_STYLE_PLAIN;
1047 size = __timeFontSize;
1053 _EditTimePresenter::OnChangeLayout(_ControlOrientation orientation)
1055 Dimension editTimeSize;
1057 result r = E_SUCCESS;
1059 r = GET_DIMENSION_CONFIG(EDITTIME::DEFAULT_SIZE, orientation, editTimeSize);
1061 if (r == E_SUCCESS && editTimeSize != __pEditTime->GetSize())
1063 __pEditTime->SetResizable(true);
1064 __pEditTime->SetSize(editTimeSize);
1065 __pEditTime->SetResizable(false);
1072 _EditTimePresenter::Initialize(void)
1074 result r = E_SUCCESS;
1076 int titleTimeMargin = 0;
1078 int editTimeHeight = 0;
1080 GET_SHAPE_CONFIG(EDITTIME::TEXT_FONT_SIZE, __pEditTime->GetOrientation(), __titleFontSize);
1081 GET_SHAPE_CONFIG(EDITTIME::TIME_FONT_SIZE, __pEditTime->GetOrientation(), __timeFontSize);
1082 GET_SHAPE_CONFIG(EDITTIME::TITLE_TIME_MARGIN, __pEditTime->GetOrientation(), titleTimeMargin);
1083 GET_SHAPE_CONFIG(EDITTIME::TIME_HEIGHT, __pEditTime->GetOrientation(), timeHeight);
1084 GET_SHAPE_CONFIG(EDITTIME::HEIGHT, __pEditTime->GetOrientation(), editTimeHeight);
1086 if (__pEditTime->GetBounds().height > editTimeHeight)
1088 editTimeHeight = __pEditTime->GetBounds().height;
1091 if (__title.IsEmpty() == false)
1094 if (!__isEditTimeInitialized)
1096 r = InitializeTitleObject();
1097 SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
1100 __titleBounds.y = (editTimeHeight - (__titleBounds.height + titleTimeMargin + timeHeight)) / 2;
1101 __titleObject.SetBounds(__titleBounds);
1104 __pFont = __pEditTime->GetFallbackFont();
1105 r = GetLastResult();
1106 SysTryReturn(NID_UI_CTRL, __pFont != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
1108 if (!__isEditTimeInitialized)
1111 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1113 r = InitializeTextObject();
1114 SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
1117 __isEditTimeInitialized = true;
1122 _EditTimePresenter::Animate(void)
1124 SysAssertf((__pFont != null), "Font instance must not be null.");
1126 (_FontImpl::GetInstance(*__pFont))->SetSize(__timeFontSize);
1128 result r = E_SUCCESS;
1131 String minuteString;
1134 _DateTimeUtils dateTimeUtils;
1135 int hours = GetHour();
1136 if (!Is24HourNotationEnabled())
1140 if (hours == DATETIME_HOUR_MIN)
1142 hours = hours + DATETIME_HOUR_MAX_FOR_24NOTATION;
1145 hourString.Format(10, L"%02d", hours);
1146 minuteString.Format(10, L"%02d", GetMinute());
1148 if (GetLastSelectedId() == DATETIME_ID_HOUR)
1150 SysTryReturnVoidResult(NID_UI_CTRL, (__lastSelectedValue.Equals(hourString) == false), E_SUCCESS, "[E_SUCCESS] Hour string matched.");
1152 newValue = hourString;
1153 rect = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR);
1155 else if (GetLastSelectedId() == DATETIME_ID_MINUTE)
1157 SysTryReturnVoidResult(NID_UI_CTRL, (__lastSelectedValue.Equals(minuteString) == false), E_SUCCESS, "[E_SUCCESS] Minute string matched.");
1159 newValue = minuteString;
1160 rect = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE);
1163 Dimension newTextDim;
1164 Dimension oldTextDim;
1166 VisualElement* pNewVisualElement = null;
1167 VisualElement* pOldVisualElement = null;
1168 VisualElement* pEditTimeElement = null;
1169 VisualElementPropertyAnimation* pNewBoundsAnimation = null;
1170 VisualElementPropertyAnimation* pOldBoundsAnimation = null;
1171 Canvas *pCanvas = null;
1173 __pFont->GetTextExtent(newValue, newValue.GetLength(), newTextDim);
1174 __pFont->GetTextExtent(__lastSelectedValue, __lastSelectedValue.GetLength(), oldTextDim);
1176 if (newTextDim.width > oldTextDim.width)
1178 textPoint.x = (rect.width - newTextDim.width) / 2;
1182 textPoint.x = (rect.width - oldTextDim.width) / 2;
1185 SysTryReturnVoidResult(NID_UI_CTRL, (rect.x + textPoint.x < __pEditTime->GetBounds().width), E_SUCCESS, "Rolling animation cann't be played.");
1187 __isAnimating = true;
1189 __pContentProvider = new (std::nothrow) VisualElement();
1190 SysTryReturnVoidResult(NID_UI_CTRL, (__pContentProvider != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
1192 r = __pContentProvider->Construct();
1193 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
1195 __pContentProvider->SetShowState(true);
1196 __pContentProvider->SetClipChildrenEnabled(true);
1197 __pContentProvider->SetImplicitAnimationEnabled(false);
1199 pEditTimeElement = __pEditTime->GetVisualElement();
1200 r = GetLastResult();
1201 SysTryCatch(NID_UI_CTRL, (pEditTimeElement != null), , r, "[%s] Propagating.", GetErrorMessage(r));
1203 pNewVisualElement = new (std::nothrow) VisualElement();
1204 SysTryCatch(NID_UI_CTRL, (pNewVisualElement != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
1206 r = pNewVisualElement->Construct();
1209 pNewVisualElement->Destroy();
1211 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
1213 pNewVisualElement->SetShowState(true);
1215 pOldVisualElement = new (std::nothrow) VisualElement();
1216 if (pOldVisualElement == null)
1218 pNewVisualElement->Destroy();
1220 SysTryCatch(NID_UI_CTRL, (pOldVisualElement != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
1222 r = pOldVisualElement->Construct();
1225 pNewVisualElement->Destroy();
1226 pOldVisualElement->Destroy();
1228 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
1230 pOldVisualElement->SetShowState(true);
1232 if (newTextDim.width > oldTextDim.width)
1234 textPoint.x = (rect.width - newTextDim.width) / 2;
1235 textPoint.y = (rect.height - newTextDim.height) / 2;
1236 __pContentProvider->SetBounds(FloatRectangle((rect.x + textPoint.x) * 1.0f, (rect.y + textPoint.y) * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f));
1237 pNewVisualElement->SetBounds(FloatRectangle(0.0f, newTextDim.height * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f));
1239 rect.x = static_cast<int>(__pContentProvider->GetBounds().x);
1240 rect.y = static_cast<int>(__pContentProvider->GetBounds().y);
1241 rect.width = static_cast<int>(__pContentProvider->GetBounds().width);
1242 rect.height = static_cast<int>(__pContentProvider->GetBounds().height);
1244 textPoint.x = (rect.width - oldTextDim.width) / 2;
1245 textPoint.y = (rect.height - oldTextDim.height) / 2;
1247 pOldVisualElement->SetBounds(FloatRectangle(textPoint.x * 1.0f, 0.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f));
1251 textPoint.x = (rect.width - oldTextDim.width) / 2;
1252 textPoint.y = (rect.height - oldTextDim.height) / 2;
1253 __pContentProvider->SetBounds(FloatRectangle((rect.x + textPoint.x) * 1.0f, (rect.y + textPoint.y) * 1.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f));
1254 pOldVisualElement->SetBounds(FloatRectangle(0.0f, 0.0f, oldTextDim.width * 1.0f, oldTextDim.height * 1.0f));
1256 rect.x = static_cast<int>(__pContentProvider->GetBounds().x);
1257 rect.y = static_cast<int>(__pContentProvider->GetBounds().y);
1258 rect.width = static_cast<int>(__pContentProvider->GetBounds().width);
1259 rect.height = static_cast<int>(__pContentProvider->GetBounds().height);
1261 textPoint.x = (rect.width - newTextDim.width) / 2;
1262 textPoint.y = (rect.height - newTextDim.height) / 2;
1264 pNewVisualElement->SetBounds(FloatRectangle(textPoint.x * 1.0f, newTextDim.height * 1.0f, newTextDim.width * 1.0f, newTextDim.height * 1.0f));
1267 pCanvas = pEditTimeElement->GetCanvasN(rect);
1268 pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
1272 pEditTimeElement->AttachChild(*__pContentProvider);
1274 __pContentProvider->AttachChild(*pOldVisualElement);
1275 __pContentProvider->AttachChild(*pNewVisualElement);
1277 pNewBoundsAnimation = new (std::nothrow) VisualElementPropertyAnimation();
1278 SysTryCatch(NID_UI_CTRL, (pNewBoundsAnimation != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
1280 pNewBoundsAnimation->SetDuration(300);
1281 pNewBoundsAnimation->SetPropertyName("bounds.position");
1282 pNewBoundsAnimation->SetStartValue(Variant(FloatPoint(pNewVisualElement->GetBounds().x * 1.0f, newTextDim.height * 1.0f)));
1283 pNewBoundsAnimation->SetEndValue(Variant(FloatPoint(pNewVisualElement->GetBounds().x * 1.0f, 0.0f)));
1284 pNewBoundsAnimation->SetVisualElementAnimationStatusEventListener(this);
1286 pOldBoundsAnimation = new (std::nothrow) VisualElementPropertyAnimation();
1287 SysTryCatch(NID_UI_CTRL, (pOldBoundsAnimation != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
1289 pOldBoundsAnimation->SetDuration(300);
1290 pOldBoundsAnimation->SetPropertyName("bounds.position");
1291 pOldBoundsAnimation->SetStartValue(Variant(FloatPoint(pOldVisualElement->GetBounds().x * 1.0f, 0.0f)));
1292 pOldBoundsAnimation->SetEndValue(Variant(FloatPoint(pOldVisualElement->GetBounds().x * 1.0f, oldTextDim.height * -1.0f)));
1293 pOldBoundsAnimation->SetVisualElementAnimationStatusEventListener(this);
1295 pCanvas = pOldVisualElement->GetCanvasN();
1296 r = GetLastResult();
1297 SysTryCatch(NID_UI_CTRL, (pCanvas != null), , r, "[%s] Propagating.", GetErrorMessage(r));
1299 pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
1301 pCanvas->SetFont(*__pFont);
1302 pCanvas->DrawText(Point(0,0),__lastSelectedValue);
1307 pCanvas = pNewVisualElement->GetCanvasN();
1308 r = GetLastResult();
1309 SysTryCatch(NID_UI_CTRL, (pCanvas != null), , r, "[%s] Propagating.", GetErrorMessage(r));
1311 pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
1313 pCanvas->SetFont(*__pFont);
1314 pCanvas->DrawText(Point(0,0),newValue);
1319 pOldVisualElement->SetImplicitAnimationEnabled(false);
1320 pOldVisualElement->AddAnimation(*pOldBoundsAnimation);
1322 pNewVisualElement->SetImplicitAnimationEnabled(false);
1323 pNewVisualElement->AddAnimation(*pNewBoundsAnimation);
1325 delete pOldBoundsAnimation;
1326 delete pNewBoundsAnimation;
1331 __isAnimating = false;
1332 __pContentProvider->Destroy();
1334 delete pNewBoundsAnimation;
1335 pNewBoundsAnimation = null;
1337 delete pOldBoundsAnimation;
1338 pOldBoundsAnimation = null;
1347 _EditTimePresenter::OnVisualElementAnimationFinished (const VisualElementAnimation &animation, const String &keyName, VisualElement &target, bool completedNormally)
1349 result r = E_SUCCESS;
1350 __isAnimating = false;
1352 VisualElement* pEditTimeElement = __pEditTime->GetVisualElement();
1353 r = GetLastResult();
1354 SysTryReturnVoidResult(NID_UI_CTRL, (pEditTimeElement != null), r, "[%s] Propagating.", GetErrorMessage(r));
1356 pEditTimeElement->DetachChild(*__pContentProvider);
1357 __pContentProvider->Destroy();
1363 }}} // Tizen::Ui::Controls