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_PublicProgressPopupEvent.cpp
20 * @brief This is the implementation for the _PublicProgressPopupEvent class.
24 #include <FUiCtrlIProgressPopupEventListener.h>
25 #include <FBaseErrors.h>
26 #include <FBaseSysLog.h>
27 #include "FUiCtrl_PublicProgressPopupEvent.h"
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Runtime;
34 namespace Tizen { namespace Ui { namespace Controls
38 * @class _PublicProgressPopupEventArg
39 * @brief This class is used as the argument to progresspopup event listener.
42 class _OSP_EXPORT_ _PublicProgressPopupEventArg
47 _PublicProgressPopupEventArg(void);
48 virtual ~_PublicProgressPopupEventArg(void);
50 }; // _PublicProgressPopupEventArg
53 _PublicProgressPopupEventArg::_PublicProgressPopupEventArg(void)
58 _PublicProgressPopupEventArg::~_PublicProgressPopupEventArg(void)
65 _PublicProgressPopupEvent::_PublicProgressPopupEvent(const Tizen::Ui::Control& source)
68 result r = _Event::Initialize();
74 SetLastResult(E_SUCCESS);
78 _PublicProgressPopupEvent::~_PublicProgressPopupEvent(void)
83 _PublicProgressPopupEvent*
84 _PublicProgressPopupEvent::CreateInstanceN(const Control& source)
86 _PublicProgressPopupEvent* pPublicProgressPopupEvent = new (std::nothrow) _PublicProgressPopupEvent(source);
87 SysTryReturn(NID_UI_CTRL, pPublicProgressPopupEvent, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
89 if (IsFailed(GetLastResult()))
94 return pPublicProgressPopupEvent;
97 delete pPublicProgressPopupEvent;
102 _PublicProgressPopupEvent::GetSource(void) const
108 _PublicProgressPopupEvent::FireImpl(IEventListener& pListener, const IEventArg& arg)
110 // cast to IProgressPopupEventListener
111 IProgressPopupEventListener* pProgressPopupListener = dynamic_cast <IProgressPopupEventListener*>(&pListener);
112 SysTryReturnVoidResult(NID_UI_CTRL, pProgressPopupListener != null, E_INVALID_ARG,
113 "[E_INVALID_ARG] The invalid listener was given.");
115 // cast to _PublicProgressPopupEventArg
116 // const _PublicProgressPopupEventArg* pArg = dynamic_cast <const _PublicProgressPopupEventArg*>(&arg);
117 // SysTryReturn(NID_UI_CTRL, pArg != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid Event Argument was given.");
119 // call progresspopup event listener method
120 pProgressPopupListener->OnProgressPopupCanceled();
124 _PublicProgressPopupEvent::CreateProgressPopupEventArgN(void)
126 _PublicProgressPopupEventArg* pEventArg = new (std::nothrow) _PublicProgressPopupEventArg();
127 SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
132 }}} // Tizen::Ui::Controls