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_ProgressPopupPresenter.cpp
20 * @brief This is the implementation file for the _ProgressPopupPresenter class.
24 #include <FBaseErrorDefine.h>
25 #include <FBaseSysLog.h>
26 #include <FGrp_BitmapImpl.h>
27 #include <FGrp_CanvasImpl.h>
28 #include <FGrp_TextTextSimple.h>
29 #include "FUi_AccessibilityContainer.h"
30 #include "FUi_AccessibilityElement.h"
31 #include "FUi_CoordinateSystemUtils.h"
32 #include "FUi_ResourceManager.h"
33 #include "FUi_UiTouchEvent.h"
34 #include "FUiCtrl_Label.h"
35 #include "FUiCtrl_ScrollPanel.h"
36 #include "FUiCtrl_ProgressPopupPresenter.h"
37 #include "FUiCtrl_ProgressPopup.h"
40 using namespace Tizen::Base;
41 using namespace Tizen::Base::Collection;
42 using namespace Tizen::Base::Runtime;
43 using namespace Tizen::Graphics;
44 using namespace Tizen::Graphics::_Text;
45 using namespace Tizen::Ui;
46 using namespace Tizen::Ui::Animations;
49 namespace Tizen { namespace Ui { namespace Controls
53 _ProgressPopupPresenter::_ProgressPopupPresenter(void)
54 : __pProgressPopup(null)
55 , __pBodyTextObject(null)
56 , __textBounds(0.0f, 0.0f, 0.0f, 0.0f)
57 , __titleBgBounds(0.0f, 0.0f, 0.0f, 0.0f)
58 , __buttonBgBounds(0.0f, 0.0f, 0.0f, 0.0f)
60 , __pScrollPanel(null)
62 , __pAnimationFrameList(null)
63 , __textObjectHeight(0.0f)
65 , __buttonPressState(false)
66 , __cancelButton(false)
67 , __transparent(false)
71 _ProgressPopupPresenter::~_ProgressPopupPresenter(void)
73 if (__pBodyTextObject != null)
75 __pBodyTextObject->RemoveAll();
76 delete __pBodyTextObject;
77 __pBodyTextObject = null;
82 __pScrollPanel->DetachChild(*__pLabel);
87 if (__pScrollPanel != null)
89 __pProgressPopup->DetachChild(*__pScrollPanel);
90 delete __pScrollPanel;
91 __pScrollPanel = null;
94 if (__pAnimationFrameList != null)
96 delete __pAnimationFrameList;
97 __pAnimationFrameList = null;
100 if (__pAnimation != null)
109 _ProgressPopupPresenter::Initialize(_ProgressPopup& ProgressPopup, bool cancelButton, bool transparent, const FloatRectangle& animationRect)
111 result r = E_SUCCESS;
113 __cancelButton = cancelButton;
114 __transparent = transparent;
115 __pProgressPopup = &ProgressPopup;
121 _ProgressPopupPresenter::SetTitleTextObject(void)
123 result r = E_SUCCESS;
125 TextSimple* pSimpleTextForTitleText = null;
127 float titleTextSize = 0.0f;
128 float minTitleTextSize = 0.0f;
129 float defaultWidth = 0.0f;
130 float titleHeight = 0.0f;
131 float titleTopMargin = 0.0f;
132 float titleLeftMargin = 0.0f;
133 float titleRightMargin = 0.0f;
135 float transTopMargin = 0.0f;
136 float transLeftMargin = 0.0f;
137 float transRightMargin = 0.0f;
139 _ControlOrientation orientation;
141 orientation = __pProgressPopup->GetOrientation();
143 GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, orientation, titleTextSize);
144 GET_SHAPE_CONFIG(POPUP::MIN_TITLE_TEXT_SIZE, orientation, minTitleTextSize);
145 GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth);
146 GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
147 GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_TOP_MARGIN, orientation, titleTopMargin);
148 GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, orientation, titleLeftMargin);
149 GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, orientation, titleRightMargin);
151 GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin);
152 GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin);
153 GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin);
155 if (_pTitleTextObject == null)
157 _pTitleTextObject = new (std::nothrow) TextObject();
158 SysTryReturnVoidResult(NID_UI_CTRL, _pTitleTextObject != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
160 r = _pTitleTextObject->Construct();
161 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
165 r = _pTitleTextObject->RemoveAll();
166 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
169 pSimpleTextForTitleText = new (std::nothrow) TextSimple(const_cast <wchar_t*>(__pProgressPopup->GetTitleText().GetPointer()),
170 __pProgressPopup->GetTitleText().GetLength(),
171 TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
172 SysTryCatch(NID_UI_CTRL, pSimpleTextForTitleText != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
174 _pTitleTextObject->AppendElement(*pSimpleTextForTitleText);
175 _pTitleTextObject->SetForegroundColor(__pProgressPopup->GetTitleTextColor(), 0, _pTitleTextObject->GetTextLength());
176 _pTitleTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
177 _pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
178 _pTitleTextObject->SetTextObjectEllipsisType(TEXT_OBJECT_ELLIPSIS_TYPE_TAIL);
180 _pTitleTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT);
182 _pTitleTextObject->SetBounds(FloatRectangle(titleLeftMargin + transLeftMargin,
183 titleTopMargin + transTopMargin,
184 defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin),
185 titleHeight - titleTopMargin));
187 r = CalculateTitleTextSize(titleTextSize, minTitleTextSize);
188 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
190 _titleBounds = FloatRectangle(titleLeftMargin + transLeftMargin,
191 titleTopMargin + transTopMargin,
192 defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin),
193 titleHeight - titleTopMargin);
195 __titleBgBounds.SetBounds(transLeftMargin, transTopMargin,
196 defaultWidth - (transLeftMargin + transRightMargin), titleHeight);
198 SetLastResult(E_SUCCESS);
201 delete _pTitleTextObject;
202 _pTitleTextObject = null;
208 _ProgressPopupPresenter::SetTextObject(void)
210 result r = E_SUCCESS;
212 TextSimple* pSimpleTextForBodyText = null;
214 float bodyTextSize = 0.0f;
215 float defaultWidth = 0.0f;
216 float titleHeight = 0.0f;
217 float maxHeight = 0.0f;
218 float textLeftMargin = 0.0f;
219 float textRightMargin = 0.0f;
220 float bottomHeight = 0.0f;
221 float transTopMargin = 0.0f;
222 float transLeftMargin = 0.0f;
223 float transRightMargin = 0.0f;
224 float animationWidth = 0.0f;
225 float textTopMargin = 0.0f;
226 float animationTopMargin = 0.0f;
228 _ControlOrientation orientation;
230 orientation = __pProgressPopup->GetOrientation();
232 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth);
234 GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin);
235 GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin);
236 GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin);
238 GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_TOP_MARGIN, orientation, textTopMargin);
239 GET_SHAPE_CONFIG(POPUP::BODY_TEXT_HEIGHT, orientation, __textObjectHeight);
240 GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_LEFT_MARGIN, orientation, textLeftMargin);
241 GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_RIGHT_MARGIN, orientation, textRightMargin);
242 GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_SIZE, orientation, bodyTextSize);
244 GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, maxHeight);
245 GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth);
246 GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, orientation, bottomHeight);
248 if (__pProgressPopup->HasTitle())
250 GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
251 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WITH_TITLE_TOP_MARGIN, orientation, animationTopMargin);
255 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, animationTopMargin);
258 if (__pBodyTextObject == null)
260 __pBodyTextObject = new (std::nothrow) TextObject();
261 SysTryReturnVoidResult(NID_UI_CTRL, __pBodyTextObject != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
263 r = __pBodyTextObject->Construct();
264 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
266 __pLabel = _Label::CreateLabelN();
267 SysTryCatch(NID_UI_CTRL, __pLabel != null, , E_OUT_OF_MEMORY, "[E_SYSTEM] Failed to create the scroll.");
271 r = __pBodyTextObject->RemoveAll();
272 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
275 pSimpleTextForBodyText = new (std::nothrow) TextSimple(const_cast <wchar_t*>(__pProgressPopup->GetText().GetPointer()),
276 __pProgressPopup->GetText().GetLength(),
277 TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
278 SysTryCatch(NID_UI_CTRL, pSimpleTextForBodyText != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
280 __pBodyTextObject->AppendElement(*pSimpleTextForBodyText);
281 __pBodyTextObject->SetForegroundColor(__pProgressPopup->GetTextColor(), 0, __pBodyTextObject->GetTextLength());
282 __pBodyTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
284 r = SetFontInfo(FONT_STYLE_PLAIN, bodyTextSize);
285 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set font.", GetErrorMessage(r));
287 __pBodyTextObject->SetFont(_pFont, 0, __pBodyTextObject->GetTextLength());
288 __pBodyTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT);
290 if (__pProgressPopup->HasButton())
292 GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, orientation, bottomHeight);
295 // Calculate Text bounds
296 __textBounds.SetBounds(textLeftMargin + transLeftMargin,
297 titleHeight + textTopMargin + transTopMargin + animationWidth + animationTopMargin,
298 defaultWidth - (textLeftMargin + textRightMargin + transLeftMargin + transRightMargin),
299 maxHeight - titleHeight - bottomHeight - animationWidth);
301 __pBodyTextObject->SetBounds(__textBounds);
303 if (__pProgressPopup->GetText().GetLength() > 0)
305 __pBodyTextObject->Compose();
306 __textObjectHeight = __pBodyTextObject->GetLineHeightAtF(0) * 3.0;
307 __textBounds.height = __textObjectHeight;
310 if (__pBodyTextObject->GetTotalHeightF() < __textObjectHeight)
312 __pLabel->SetBounds(FloatRectangle(0.0f, (__textObjectHeight - __pBodyTextObject->GetTotalHeightF())/2.0f, __textBounds.width, __pBodyTextObject->GetTotalHeightF()));
316 __pLabel->SetBounds(FloatRectangle(0.0f, 0.0f, __textBounds.width, __pBodyTextObject->GetTotalHeightF()));
319 __pLabel->SetText(__pProgressPopup->GetText());
320 __pLabel->SetTextConfig(bodyTextSize, LABEL_TEXT_STYLE_NORMAL);
321 __pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
322 __pLabel->SetMargin(0.0f, 0.0f, 0.0f, 0.0f);
324 if (__pScrollPanel == null)
326 __pScrollPanel = _ScrollPanel::CreateScrollPanelN(__textBounds, SCROLL_PANEL_SCROLL_DIRECTION_VERTICAL, true);
327 SysTryCatch(NID_UI_CTRL, __pScrollPanel != null, , E_OUT_OF_MEMORY, "[E_SYSTEM] Failed to create the scroll.");
329 __pScrollPanel->SetBounds(__textBounds);
330 __pScrollPanel->AttachChild(*__pLabel);
331 __pProgressPopup->AttachChild(*__pScrollPanel);
335 __pScrollPanel->SetBounds(__textBounds);
338 SetLastResult(E_SUCCESS);
342 delete __pBodyTextObject;
343 __pBodyTextObject = null;
348 delete __pScrollPanel;
349 __pScrollPanel = null;
355 _ProgressPopupPresenter::PlayProcessAnimation(void)
357 if (__pAnimation != null)
359 if (__pAnimation->GetStatus() == ANIMATION_PLAYING)
366 SetProcessAnimation();
369 if (__pAnimation != null)
371 __pAnimation->Play();
379 _ProgressPopupPresenter::StopProcessAnimation(void)
381 if (__pAnimation != null)
383 __pAnimation->Stop();
385 __pProgressPopup->DetachChild(*__pAnimation);
395 _ProgressPopupPresenter::SetProcessAnimation(void)
397 result r = E_SUCCESS;
399 if (__pAnimation != null)
401 if (__pAnimation->GetStatus() == ANIMATION_PLAYING)
407 if (__pAnimationFrameList)
409 __pAnimationFrameList->RemoveAll(true);
410 delete __pAnimationFrameList;
411 __pAnimationFrameList = null;
414 r = GET_ANIMATION_CONFIG_N(POPUP::PROCESSING_ANIMATION, __pAnimationFrameList);
415 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM,"System error is occured.");
420 __pAnimation = _Animation::CreateAnimationN();
424 if (__pAnimationFrameList)
426 __pAnimation->SetAnimationFrames(*__pAnimationFrameList);
427 __pAnimation->SetImageCount(__pAnimationFrameList->GetCount());
430 __pAnimation->SetRepeatCount(ANIMATION_REPEAT_COUNT);
431 __pAnimation->AddAnimationEventListener(*this);
433 FloatRectangle animationBounds = __pProgressPopup->GetAnimationRect();
437 __pAnimation->GetVisualElement()->SetOpacity(0.6f);
438 __pAnimation->SetBounds(FloatRectangle(0.0f, 0.0f, animationBounds.width, animationBounds.height));
442 __pAnimation->SetBounds(FloatRectangle(animationBounds.x, animationBounds.y, animationBounds.width, animationBounds.height));
445 __pProgressPopup->AttachChild(*__pAnimation);
452 _ProgressPopupPresenter::OnAnimationStopped(const _Control & source)
454 if (&source == __pAnimation)
456 __pAnimation->Play();
461 _ProgressPopupPresenter::Draw(void)
463 result r = E_SUCCESS;
465 float titleTextSize = 0.0f;
466 float bodyTextSize = 0.0f;
467 float defaultWidth = 0.0f;
469 bool isCustomBitmap = false;
471 _ControlOrientation orientation;
473 isCustomBitmap = IS_CUSTOM_BITMAP(POPUP::BG_NORMAL);
475 orientation = __pProgressPopup->GetOrientation();
477 Canvas* pCanvas = __pProgressPopup->GetCanvasN();
478 SysTryReturnVoidResult(NID_UI_CTRL, (pCanvas != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create canvas.");
480 pCanvas->SetBackgroundColor(Color(0x00000000));
488 GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, orientation, titleTextSize);
489 GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_SIZE, orientation, bodyTextSize);
491 GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth);
493 float totalH = __pProgressPopup->GetTotalHeight();
495 const Bitmap* pBackgroundBitmap = __pProgressPopup->GetBackgroundBitmap();
496 const Bitmap* pOutlineBitmap = __pProgressPopup->GetOutlineBitmap();
498 FloatRectangle bgBounds(0.0f, 0.0f, defaultWidth, totalH);
501 if (pBackgroundBitmap != null)
503 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBackgroundBitmap))
505 pCanvas->DrawNinePatchedBitmap(bgBounds, *pBackgroundBitmap);
509 pCanvas->DrawBitmap(bgBounds, *pBackgroundBitmap);
514 if (!isCustomBitmap && pOutlineBitmap != null)
516 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pOutlineBitmap))
518 pCanvas->DrawNinePatchedBitmap(bgBounds, *pOutlineBitmap);
522 pCanvas->DrawBitmap(bgBounds, *pOutlineBitmap);
526 const Bitmap* pTitleBitmap = __pProgressPopup->GetTitleBackgroundBitmap();
527 const Bitmap* pTitleEffectBitmap = __pProgressPopup->GetTitleBackgroundEffectBitmap();
530 if (_pTitleTextObject != null)
532 isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BG_TITLE_AREA);
534 if(pTitleBitmap != null)
536 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pTitleBitmap))
538 pCanvas->DrawNinePatchedBitmap(__titleBgBounds, *pTitleBitmap);
542 pCanvas->DrawBitmap(__titleBgBounds, *pTitleBitmap);
546 //DrawEffectTitleBitmap
547 if (!isCustomBitmap && pTitleEffectBitmap != null)
549 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pTitleEffectBitmap))
551 pCanvas->DrawNinePatchedBitmap(__titleBgBounds, *pTitleEffectBitmap);
555 pCanvas->DrawBitmap(__titleBgBounds, *pTitleEffectBitmap);
559 r = SetFontInfo(FONT_STYLE_PLAIN, _titleTextSize);
560 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
562 _pTitleTextObject->SetFont(_pFont, 0, _pTitleTextObject->GetTextLength());
563 _pTitleTextObject->SetBounds(_titleBounds);
564 _pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas));
569 const Bitmap* pButtonBitmap = __pProgressPopup->GetButtonBackgroundBitmap();
570 const Bitmap* pButtonEffectBitmap = __pProgressPopup->GetButtonBackgroundEffectBitmap();
571 isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BG_BUTTON_AREA);
574 if(pButtonBitmap != null)
576 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pButtonBitmap))
578 pCanvas->DrawNinePatchedBitmap(__buttonBgBounds, *pButtonBitmap);
582 pCanvas->DrawBitmap(__buttonBgBounds, *pButtonBitmap);
586 //DrawEffectButtonBitmap
587 if (!isCustomBitmap && pButtonEffectBitmap != null)
589 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pButtonEffectBitmap))
591 pCanvas->DrawNinePatchedBitmap(__buttonBgBounds, *pButtonEffectBitmap);
595 pCanvas->DrawBitmap(__buttonBgBounds, *pButtonEffectBitmap);
600 if (__pLabel != null)
602 __pLabel->SetTextColor(__pProgressPopup->GetTextColor());
613 _ProgressPopupPresenter::DoModal(int& modalResult)
615 __pProgressPopup->Open();
619 __pProgressPopup->Close();
621 modalResult = __pProgressPopup->GetPopupReturnValue();
627 _ProgressPopupPresenter::GetBodyTextObjHeight(void) const
629 return (__pBodyTextObject == null) ? 0.0f : __textObjectHeight;
632 _ProgressPopupPresenter::GetBodyTextHeight(void) const
634 return (__pBodyTextObject == null) ? 0.0f : __pBodyTextObject->GetTotalHeightF();
638 _ProgressPopupPresenter::GetTextBounds(void) const
644 _ProgressPopupPresenter::GetButtonBounds(void)
651 float defaultWidth = 0.0f;
652 float titleHeight = 0.0f;
653 float btnHeight = 0.0f;
654 float btnSideMargin1 = 0.0f;
655 float transTopMargin = 0.0f;
656 float transLeftMargin = 0.0f;
657 float transRightMargin = 0.0f;
658 float animationWidth = 0.0f;
659 float animationTopMargin = 0.0f;
660 float textTopMargin = 0.0f;
661 float textBottomMargin = 0.0f;
662 float buttonBgHeight = 0.0f;
663 _ControlOrientation orientation;
665 orientation = __pProgressPopup->GetOrientation();
667 GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin);
668 GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin);
669 GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin);
670 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WIDTH, orientation, animationWidth);
671 GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_TOP_MARGIN, orientation, textTopMargin);
672 GET_SHAPE_CONFIG(POPUP::PROCESS_TEXT_BOTTOM_MARGIN, orientation, textBottomMargin);
675 GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth);
676 GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, btnHeight);
677 GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_01, orientation, btnSideMargin1);
678 GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, orientation, buttonBgHeight);
680 if (!__pProgressPopup->HasButton())
682 return FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f);
685 if (__pProgressPopup->HasTitle())
687 GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
688 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_WITH_TITLE_TOP_MARGIN, orientation, animationTopMargin);
692 GET_SHAPE_CONFIG(POPUP::PROCESS_ANIMATION_NO_TITLE_TOP_MARGIN, orientation, animationTopMargin);
695 if (!__pProgressPopup->HasText())
697 textTopMargin = 0.0f;
698 textBottomMargin = textBottomMargin * 1.5f;
701 width = defaultWidth - (btnSideMargin1 * 2.0f);
711 + GetBodyTextObjHeight();
713 __buttonBgBounds.SetBounds(transLeftMargin, y , (defaultWidth - (transLeftMargin + transRightMargin)) , buttonBgHeight);
715 return FloatRectangle(x, y + ((buttonBgHeight - height) / 2), width, height);
719 _ProgressPopupPresenter::InitializeAccessibilityElement(void)
721 _AccessibilityContainer* pContainer = __pProgressPopup->GetAccessibilityContainer();
723 if (pContainer == null)
728 if (__pLabel != null)
730 _AccessibilityContainer* pLabelContainer = __pLabel->GetAccessibilityContainer();
731 if (pLabelContainer != null)
733 _AccessibilityElement* pLabelElement = pLabelContainer->GetChildElement(L"LabelText");
734 if (pLabelElement != null)
736 pLabelElement->SetName(L"ProgressPopupText");
737 pLabelElement->SetTrait(L"Popup body text");
741 pContainer->AddChildContainer(*pLabelContainer);
748 _ProgressPopupPresenter::GetCore(void)
750 return static_cast <_Popup*>(__pProgressPopup);
754 _ProgressPopupPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
756 __buttonPressState = true;
762 _ProgressPopupPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
764 __buttonPressState = false;
770 _ProgressPopupPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
772 Point touchPoint = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition());
778 _ProgressPopupPresenter::OnChangeLayout(_ControlOrientation orientation)
780 FloatRectangle animationBounds = __pProgressPopup->GetAnimationRect();
782 if (__pAnimation != null)
784 __pAnimation->SetBounds(FloatRectangle(animationBounds.x, animationBounds.y, animationBounds.width, animationBounds.height));
787 if (__pProgressPopup->HasTitle())
789 SetTitleTextObject();
792 if (__pProgressPopup->HasText())
800 }}} // Tizen::Ui::Controls