2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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_ProgressPopup.cpp
20 * @brief This is the implementation file for the _ProgressPopup class.
23 #include <FBaseSysLog.h>
24 #include <FBaseErrorDefine.h>
25 #include <FGrp_BitmapImpl.h>
26 #include <FSys_SettingInfoImpl.h>
27 #include <FUiCtrlButton.h>
28 #include <FUiCtrlForm.h>
29 #include "FUi_AccessibilityContainer.h"
30 #include "FUi_AccessibilityElement.h"
31 #include "FUi_CoordinateSystemUtils.h"
32 #include "FUi_EcoreEvas.h"
33 #include "FUi_EcoreEvasMgr.h"
34 #include "FUi_ResourceManager.h"
35 #include "FUiCtrl_ButtonImpl.h"
36 #include "FUiCtrl_Button.h"
37 #include "FUiCtrl_Form.h"
38 #include "FUiCtrl_Frame.h"
39 #include "FUiCtrl_ProgressPopup.h"
40 #include "FUiCtrl_ProgressPopupPresenter.h"
41 #include "FUiCtrl_Indicator.h"
44 using namespace Tizen::Graphics;
45 using namespace Tizen::Ui;
46 using namespace Tizen::Ui::Animations;
47 using namespace Tizen::Base;
48 using namespace Tizen::System;
50 namespace Tizen { namespace Ui { namespace Controls
54 _ProgressPopup::_ProgressPopup(void)
55 : __pProgressPopupPresenter(null)
56 , __pProgressPopupEvent(null)
58 , __pComposedButtonBitmap(null)
59 , __pButtonEffectBitmap(null)
61 , __textColor(Color(0xFFFFFFFF))
62 , __animationRect(0.0f, 0.0f, 0.0f, 0.0f)
64 , __buttonState(false)
65 , __isTransparent(false)
70 _ProgressPopup::~_ProgressPopup(void)
72 delete __pProgressPopupPresenter;
73 __pProgressPopupPresenter = null;
75 if (__pProgressPopupEvent != null)
77 delete __pProgressPopupEvent;
78 __pProgressPopupEvent = null;
84 delete _pComposedBgBitmap;
85 _pComposedBgBitmap = null;
87 delete _pOutlineBitmap;
88 _pOutlineBitmap = null;
90 delete __pComposedButtonBitmap;
91 __pComposedButtonBitmap = null;
93 delete __pButtonEffectBitmap;
94 __pButtonEffectBitmap = null;
96 delete _pComposedTitleBitmap;
97 _pComposedTitleBitmap = null;
99 delete _pTitleEffectBitmap;
100 _pTitleEffectBitmap = null;
105 _SettingInfoImpl::RemoveSettingEventListenerForInternal(*this);
109 _ProgressPopup::CreateProgressPopupN(void)
111 _ProgressPopup* pProgressPopup = new (std::nothrow) _ProgressPopup();
112 SysTryReturn(NID_UI_CTRL, pProgressPopup != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
114 result r = pProgressPopup->CreateRootVisualElement(_WINDOW_TYPE_SUB);
115 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
117 // for taking touch event
118 pProgressPopup->AcquireHandle();
119 return pProgressPopup;
122 delete pProgressPopup;
128 _ProgressPopup::Initialize(bool cancelButton, bool transparent, const FloatRectangle& animationRect)
130 result r = E_SUCCESS;
132 _AccessibilityContainer* pContainer = null;
134 Bitmap* buttonBgBitmap = null;
135 Bitmap* titleBgBitmap = null;
136 Color titleBgColor(0x00000000);
137 Color buttonBgColor(0x00000000);
139 __animationRect = animationRect;
140 __buttonState = cancelButton;
141 __isTransparent = transparent;
143 _ProgressPopupPresenter* pPresenter = new (std::nothrow) _ProgressPopupPresenter();
144 SysTryReturn(NID_UI_CTRL, pPresenter != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
146 SetPresenter(*pPresenter);
148 r = pPresenter->Initialize(*this, cancelButton, transparent, animationRect);
149 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
151 GET_COLOR_CONFIG(POPUP::TITLE_TEXT_NORMAL, _titleTextColor);
152 GET_COLOR_CONFIG(MESSAGEBOX::TEXT_NORMAL, __textColor);
153 GET_COLOR_CONFIG(MESSAGEBOX::BG_TITLE, titleBgColor);
154 GET_COLOR_CONFIG(MESSAGEBOX::BG_BUTTON, buttonBgColor);
156 GET_BITMAP_CONFIG_N(POPUP::BG_OUTLINE_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, _pOutlineBitmap);
158 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
161 GET_COLOR_CONFIG(POPUP::BG_NORMAL, bgColor);
163 GET_BITMAP_CONFIG_N(POPUP::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, _pBgBitmap);
165 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
167 _pComposedBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*_pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), bgColor);
169 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
173 GET_BITMAP_CONFIG_N(MESSAGEBOX::BG_BUTTON_AREA, BITMAP_PIXEL_FORMAT_ARGB8888, buttonBgBitmap);
175 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
177 __pComposedButtonBitmap = _BitmapImpl::GetColorReplacedBitmapN(*buttonBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonBgColor);
179 SysTryCatch(NID_UI_CTRL, (__pComposedButtonBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r));
181 GET_BITMAP_CONFIG_N(MESSAGEBOX::BG_BUTTON_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pButtonEffectBitmap);
183 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
186 GET_BITMAP_CONFIG_N(MESSAGEBOX::BG_TITLE_AREA, BITMAP_PIXEL_FORMAT_ARGB8888, titleBgBitmap);
188 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
190 _pComposedTitleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*titleBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), titleBgColor);
192 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
194 GET_BITMAP_CONFIG_N(MESSAGEBOX::BG_TITLE_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, _pTitleEffectBitmap);
196 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
198 // for clearing canvas
199 if (GetVisualElement() != null)
201 GetVisualElement()->SetSurfaceOpaque(false);
204 SetDimmingEnabled(true);
206 if (__buttonState && !__isTransparent)
208 __pButton = new (std::nothrow) Button();
209 SysTryCatch(NID_UI_CTRL, __pButton != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
211 r = __pButton->Construct(pPresenter->GetButtonBounds());
212 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
216 _ControlImpl* pImpl = _ControlImpl::GetInstance(*__pButton);
217 r = AttachChild(pImpl->GetCore());
218 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
220 _Button* pButtonCore = dynamic_cast <_Button*>(&pImpl->GetCore());
221 SysTryCatch(NID_UI_CTRL, pButtonCore != null, , r, "[%s] Propagating.", GetErrorMessage(r));
223 pButtonCore->SetActionId(ID_PROGRESS_POPUP_CANCEL_BUTTON);
224 pButtonCore->AddActionEventListener(*this);
227 pContainer = GetAccessibilityContainer();
228 if(pContainer != null)
230 pContainer->Activate(true);
233 r = _SettingInfoImpl::AddSettingEventListenerForInternal(*this);
234 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
236 if (buttonBgBitmap != null)
238 delete buttonBgBitmap;
239 buttonBgBitmap = null;
242 delete titleBgBitmap;
243 titleBgBitmap = null;
249 delete titleBgBitmap;
250 titleBgBitmap = null;
255 delete _pOutlineBitmap;
256 _pOutlineBitmap = null;
258 delete _pComposedBgBitmap;
259 _pComposedBgBitmap = null;
261 if (buttonBgBitmap != null)
263 delete buttonBgBitmap;
264 buttonBgBitmap = null;
267 if (__pComposedButtonBitmap != null)
269 delete __pComposedButtonBitmap;
270 __pComposedButtonBitmap = null;
273 if (__pButtonEffectBitmap != null)
275 delete __pButtonEffectBitmap;
276 __pButtonEffectBitmap = null;
279 delete _pComposedTitleBitmap;
280 _pComposedTitleBitmap = null;
282 delete _pTitleEffectBitmap;
283 _pTitleEffectBitmap = null;
292 _ProgressPopup::SetPresenter(const _ProgressPopupPresenter& ProgressPopupPresenter)
294 __pProgressPopupPresenter = const_cast <_ProgressPopupPresenter*>(&ProgressPopupPresenter);
300 _ProgressPopup::GetPresenter(void)
302 return static_cast <_PopupPresenter*>(__pProgressPopupPresenter);
306 _ProgressPopup::DoModal(int& modalResult)
308 result r = E_SUCCESS;
310 r = __pProgressPopupPresenter->DoModal(modalResult);
311 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
317 _ProgressPopup::AddProgressPopupEventListener(const Tizen::Ui::Controls::_IProgressPopupEventListener& listener)
319 result r = E_SUCCESS;
321 if (__pProgressPopupEvent == null)
323 __pProgressPopupEvent = _ProgressPopupEvent::CreateInstanceN(*this);
325 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
328 r = __pProgressPopupEvent->AddListener(listener);
329 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
335 _ProgressPopup::SetTitleText(const String& title)
337 result r = E_SUCCESS;
342 __pProgressPopupPresenter->SetTitleTextObject();
345 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
347 if (_pTitleTextAccessibilityElement != null)
349 _pTitleTextAccessibilityElement->SetLabel(title);
361 _ProgressPopup::SetText(const String& text)
363 result r = E_SUCCESS;
368 __pProgressPopupPresenter->SetTextObject();
371 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
382 _ProgressPopup::UpdateBounds(void)
384 result r = E_SUCCESS;
386 // create button with new position
389 _ControlImpl* pImpl = null;
390 _Button* pButtonCore = null;
392 if (__pButton != null)
394 pImpl = _ControlImpl::GetInstance(*__pButton);
395 r = DetachChild(pImpl->GetCore());
396 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
402 __pButton = new (std::nothrow) Button();
403 SysTryReturn(NID_UI_CTRL, __pButton != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
405 r = __pButton->Construct(__pProgressPopupPresenter->GetButtonBounds());
406 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
410 pImpl = _ControlImpl::GetInstance(*__pButton);
411 r = AttachChild(pImpl->GetCore());
412 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
414 pButtonCore = dynamic_cast <_Button*>(&pImpl->GetCore());
416 SysTryCatch(NID_UI_CTRL, pButtonCore != null, , r, "[%s] Propagating.", GetErrorMessage(r));
418 pButtonCore->SetActionId(ID_PROGRESS_POPUP_CANCEL_BUTTON);
419 pButtonCore->AddActionEventListener(*this);
422 // update total height -> GetTotalHeight (called by Impl)
423 // update process-animation rect position -> GetAnimationRect (called by UpdateProcessAnimationVE)
424 // update process-animation VE
425 // r = __pProgressPopupPresenter->UpdateProcessAnimationVE();
426 // SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
438 _ProgressPopup::GetText(void) const
444 _ProgressPopup::GetButtonBackgroundBitmap(void)
446 return __pComposedButtonBitmap;
450 _ProgressPopup::GetButtonBackgroundEffectBitmap(void)
452 return __pButtonEffectBitmap;
456 _ProgressPopup::GetTotalHeight(void) const
458 float transTopMargin = 0.0f;
459 float transBottomMargin = 0.0f;
460 float titleHeight = 0.0f;
461 float animationTopMargin = 0.0f;
462 float animationWidth = 0.0f;
463 float textTopGap = 0.0f;
464 float textBottomGap = 0.0f;
465 float bottomHeight = 0.0f;
466 float minHeight = 0.0f;
468 _ControlOrientation orientation;
470 orientation = GetOrientation();
472 GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin);
473 GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin);
474 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth);
475 GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_TOP_MARGIN, orientation, textTopGap);
476 GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_BOTTOM_MARGIN, orientation, textBottomGap);
478 GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, orientation, bottomHeight);
479 GET_SHAPE_CONFIG(MESSAGEBOX::MIN_HEIGHT, orientation, minHeight);
484 GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
485 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WITH_TITLE_TOP_MARGIN, orientation, animationTopMargin);
489 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, animationTopMargin);
495 textBottomGap = textBottomGap * 1.5f;
504 float totalH = titleHeight
510 + __pProgressPopupPresenter->GetBodyTextObjHeight();
513 if (minHeight > totalH)
518 totalH = totalH + transTopMargin + transBottomMargin;
524 _ProgressPopup::SetTextColor(const Color& color)
532 _ProgressPopup::GetTextColor() const
538 _ProgressPopup::GetAnimationRect(void) const
540 FloatRectangle animationBounds;
542 float defaultWidth = 0.0f;
543 float titleHeight = 0.0f;
544 float animationWidth = 0.0f;
545 float animationTopMargin = 0.0f;
546 float transTopMargin = 0.0f;
548 _ControlOrientation orientation;
550 orientation = GetOrientation();
552 GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth);
554 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth);
555 GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin);
559 GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
560 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WITH_TITLE_TOP_MARGIN, orientation, animationTopMargin);
562 else if (HasText() || HasButton())
564 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, animationTopMargin);
568 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, animationTopMargin);
571 animationBounds = FloatRectangle((defaultWidth - animationWidth) / 2.0f,
572 titleHeight + animationTopMargin + transTopMargin,
573 animationWidth, animationWidth);
575 return animationBounds;
579 _ProgressPopup::HasText(void) const
585 _ProgressPopup::HasButton(void) const
587 return (__buttonState && !__isTransparent);
591 _ProgressPopup::IsTransparent(void) const
593 return __isTransparent;
597 _ProgressPopup::FireProgressPopupEvent(void)
599 if (__pProgressPopupEvent != null)
601 Tizen::Base::Runtime::IEventArg* pEventArg = _ProgressPopupEvent::CreateProgressPopupEventArgN();
602 result r = GetLastResult();
603 SysTryReturnVoidResult(NID_UI_CTRL, pEventArg != null, r, "[%s] Propagating.", GetErrorMessage(r));
605 __pProgressPopupEvent->Fire(*pEventArg);
610 _ProgressPopup::OnDraw(void)
612 __pProgressPopupPresenter->Draw();
613 if(unlikely((_AccessibilityManager::IsActivated())))
615 _AccessibilityManager::GetInstance()->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM);
620 _ProgressPopup::OnFontChanged(Font * pFont)
622 __pProgressPopupPresenter->OnFontChanged(pFont);
626 _ProgressPopup::OnFontInfoRequested(unsigned long& style, float& size)
628 __pProgressPopupPresenter->OnFontInfoRequested(style, size);
632 _ProgressPopup::OnActionPerformed(const Tizen::Ui::_Control& source, int actionId)
636 case ID_PROGRESS_POPUP_CANCEL_BUTTON:
638 FireProgressPopupEvent();
639 _Popup::SetReturnValue(POPUP_RESULT_CANCEL);
649 _ProgressPopup::OnBoundsChanged(void)
651 SetClientBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
653 if ((HasTitle() == true) && (_pTitleTextAccessibilityElement != null))
655 _pTitleTextAccessibilityElement->SetBounds(__pProgressPopupPresenter->GetTitleTextBounds());
662 _ProgressPopup::OnVisibleStateChanged(void)
664 _Window::OnVisibleStateChanged();
668 _ProgressPopup::OnActivated(void)
670 __pProgressPopupPresenter->PlayProcessAnimation();
673 if (GetVisibleState() && !__isTransparent)
675 SetTouchCapture(false, false);
678 bool showstate = false;
679 bool opacity = false;
681 _Control* pOwner = GetOwner();
684 _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
685 SysTryReturnVoidResult(NID_UI_CTRL, pFrame != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
687 _Form* pForm = pFrame->GetCurrentForm();
692 showstate = pForm->IsIndicatorVisible();
693 opacity = pForm->IsIndicatorTranslucent();
702 _Form* pForm = dynamic_cast<_Form*>(pOwner);
705 showstate = pForm->IsIndicatorVisible();
706 opacity = pForm->IsIndicatorTranslucent();
709 pOwner->LockInputEvent();
712 _Indicator* pIndicator = GetIndicator();
715 pIndicator->AddIndicatorObject(this, GetRootWindow());
717 float indicatorwidth = 0.0f;
718 float indicatorheight = 0.0f;
720 if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
722 indicatorwidth = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF().width;
723 GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
727 indicatorwidth = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF().height;
728 GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, GetOrientation(), indicatorheight);
731 pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, indicatorwidth, indicatorheight));
732 pIndicator->SetIndicatorShowState(showstate);
735 pIndicator->SetIndicatorOpacity(_INDICATOR_OPACITY_TRANSLUCENT);
739 pIndicator->SetIndicatorOpacity(_INDICATOR_OPACITY_OPAQUE);
746 _DimmingLayer* pDimmingLayer = GetDimmingLayer();
748 if (pDimmingLayer != null)
750 pDimmingLayer->SetOpacity(0.0f);
754 _Window::OnActivated();
758 _ProgressPopup::OnDeactivated(void)
760 __pProgressPopupPresenter->StopProcessAnimation();
762 _Popup::OnDeactivated();
766 _ProgressPopup::InitializeAccessibilityElement(void)
768 result r = E_SUCCESS;
770 _Popup::InitializeAccessibilityElement();
772 if (_pTitleTextAccessibilityElement != null)
774 _pTitleTextAccessibilityElement->SetName(L"ProgressPopupTitleText");
777 __pProgressPopupPresenter->InitializeAccessibilityElement();
779 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
781 if (HasButton() == true)
784 SetCancelButtonAccessibilityElement();
790 _ProgressPopup::SetCancelButtonAccessibilityElement(void)
792 _AccessibilityContainer* pContainer = GetAccessibilityContainer();
794 if (pContainer != null)
796 _ControlImpl* pImpl = null;
797 _Button* pButtonCore = null;
799 pImpl = _ControlImpl::GetInstance(*__pButton);
801 pButtonCore = dynamic_cast<_Button*>(&pImpl->GetCore());
802 result r = GetLastResult();
803 SysTryReturnVoidResult(NID_UI_CTRL, pButtonCore != null, r, "[%s] Propagating.", GetErrorMessage(r));
805 _AccessibilityContainer* pButtonContainer = pButtonCore->GetAccessibilityContainer();
807 if (pButtonContainer != null)
809 _AccessibilityElement* pButtonElement = pButtonContainer->GetChildElement(L"ButtonText");
810 if (pButtonElement != null)
812 pButtonElement->SetName(L"ProgressPopupButton1");
816 pContainer->AddChildContainer(*pButtonContainer);
821 _ProgressPopup::OnChangeLayout(_ControlOrientation orientation)
823 _Window::OnChangeLayout(orientation);
825 result r = E_SUCCESS;
827 r = __pProgressPopupPresenter->OnChangeLayout(orientation);
828 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
832 r = __pButton->SetBounds(__pProgressPopupPresenter->GetButtonBounds());
833 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
838 _ProgressPopup::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
845 return __pProgressPopupPresenter->OnTouchPressed(source, touchinfo);
849 _ProgressPopup::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
856 return __pProgressPopupPresenter->OnTouchMoved(source, touchinfo);
860 _ProgressPopup::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
867 return __pProgressPopupPresenter->OnTouchReleased(source, touchinfo);
871 _ProgressPopup::OnSettingChanged(String& key)
873 const wchar_t* LOCALE_LANGUAGE = L"http://tizen.org/setting/locale.language";
875 if ((key == LOCALE_LANGUAGE) && (__pButton != null))
882 _ProgressPopup::SetButtonText(void)
886 GET_STRING_CONFIG(IDS_TPLATFORM_BUTTON_CANCEL_ABB, buttonText);
888 __pButton->SetText(buttonText);
891 }}} // Tizen::Ui::Controls