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 FUiCtrlProgressPopup.cpp
20 * @brief This file contains implementation of ProgressPopup class
23 #include <FUiCtrlProgressPopup.h>
24 #include <FBaseSysLog.h>
25 #include "FUiCtrl_ProgressPopupImpl.h"
28 using namespace Tizen::Base;
29 using namespace Tizen::Graphics;
30 using namespace Tizen::App;
33 namespace Tizen { namespace Ui { namespace Controls
37 ProgressPopup::ProgressPopup(void)
42 ProgressPopup::~ProgressPopup(void)
48 ProgressPopup::Construct(bool cancelButton, bool transparent)
52 _ProgressPopupImpl* pProgressPopupImpl = _ProgressPopupImpl::GetInstance(*this);
53 SysAssertf(pProgressPopupImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
55 pProgressPopupImpl = _ProgressPopupImpl::CreateProgressPopupImplN(this);
57 SysTryReturn(NID_UI_CTRL, pProgressPopupImpl != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
59 //Set _ProgressPopupImpl
60 _pControlImpl = pProgressPopupImpl;
62 r = pProgressPopupImpl->Initialize(cancelButton, transparent);
63 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
68 delete pProgressPopupImpl;
76 ProgressPopup::AddProgressPopupEventListener(Tizen::Ui::IProgressPopupEventListener& listener)
78 _ProgressPopupImpl* pProgressPopupImpl = _ProgressPopupImpl::GetInstance(*this);
79 SysAssertf(pProgressPopupImpl != null, "Not-yet constructed. Construct() should be called before use.");
81 result r = pProgressPopupImpl->AddProgressPopupEventListener(listener);
82 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
88 ProgressPopup::RemoveProgressPopupEventListener(Tizen::Ui::IProgressPopupEventListener& listener)
90 _ProgressPopupImpl* pProgressPopupImpl = _ProgressPopupImpl::GetInstance(*this);
91 SysAssertf(pProgressPopupImpl != null, "Not-yet constructed. Construct() should be called before use.");
93 result r = pProgressPopupImpl->RemoveProgressPopupEventListener(listener);
94 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
100 ProgressPopup::SetText(const String& text)
102 _ProgressPopupImpl* pProgressPopupImpl = _ProgressPopupImpl::GetInstance(*this);
103 SysAssertf(pProgressPopupImpl != null, "Not-yet constructed. Construct() should be called before use.");
105 result r = pProgressPopupImpl->SetText(text);
106 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
112 ProgressPopup::GetText(void) const
114 const _ProgressPopupImpl* pProgressPopupImpl = _ProgressPopupImpl::GetInstance(*this);
115 SysAssertf(pProgressPopupImpl != null, "Not-yet constructed. Construct() should be called before use.");
117 return pProgressPopupImpl->GetText();
121 ProgressPopup::SetTextColor(const Color& color)
123 _ProgressPopupImpl* pProgressPopupImpl = _ProgressPopupImpl::GetInstance(*this);
124 SysAssertf(pProgressPopupImpl != null, "Not-yet constructed. Construct() should be called before use.");
126 pProgressPopupImpl->SetTextColor(color);
130 ProgressPopup::GetTextColor(void) const
132 const _ProgressPopupImpl* pProgressPopupImpl = _ProgressPopupImpl::GetInstance(*this);
133 SysAssertf(pProgressPopupImpl != null, "Not-yet constructed. Construct() should be called before use.");
135 return pProgressPopupImpl->GetTextColor();
139 }}} // Tizen::Ui::Controls