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.
18 * @file FUiCtrl_PublicProgressPopupEvent.cpp
19 * @brief This is the implementation for the _PublicProgressPopupEvent class.
23 #include <FUiCtrlIProgressPopupEventListener.h>
24 #include <FBaseErrors.h>
25 #include <FBaseSysLog.h>
26 #include "FUiCtrl_PublicProgressPopupEvent.h"
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Runtime;
33 namespace Tizen { namespace Ui { namespace Controls
37 * @class _PublicProgressPopupEventArg
38 * @brief This class is used as the argument to progresspopup event listener.
41 class _OSP_EXPORT_ _PublicProgressPopupEventArg
46 _PublicProgressPopupEventArg(void);
47 virtual ~_PublicProgressPopupEventArg(void);
49 }; // _PublicProgressPopupEventArg
52 _PublicProgressPopupEventArg::_PublicProgressPopupEventArg(void)
57 _PublicProgressPopupEventArg::~_PublicProgressPopupEventArg(void)
64 _PublicProgressPopupEvent::_PublicProgressPopupEvent(const Tizen::Ui::Control& source)
67 result r = _Event::Initialize();
73 SetLastResult(E_SUCCESS);
77 _PublicProgressPopupEvent::~_PublicProgressPopupEvent(void)
82 _PublicProgressPopupEvent*
83 _PublicProgressPopupEvent::CreateInstanceN(const Control& source)
85 _PublicProgressPopupEvent* pPublicProgressPopupEvent = new (std::nothrow) _PublicProgressPopupEvent(source);
86 SysTryReturn(NID_UI_CTRL, pPublicProgressPopupEvent, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
88 if (IsFailed(GetLastResult()))
93 return pPublicProgressPopupEvent;
96 delete pPublicProgressPopupEvent;
101 _PublicProgressPopupEvent::GetSource(void) const
107 _PublicProgressPopupEvent::FireImpl(IEventListener& pListener, const IEventArg& arg)
109 // cast to IProgressPopupEventListener
110 IProgressPopupEventListener* pProgressPopupListener = dynamic_cast <IProgressPopupEventListener*>(&pListener);
111 SysTryReturnVoidResult(NID_UI_CTRL, pProgressPopupListener != null, E_INVALID_ARG,
112 "[E_INVALID_ARG] The invalid listener was given.");
114 // cast to _PublicProgressPopupEventArg
115 // const _PublicProgressPopupEventArg* pArg = dynamic_cast <const _PublicProgressPopupEventArg*>(&arg);
116 // SysTryReturn(NID_UI_CTRL, pArg != null, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The invalid Event Argument was given.");
118 // call progresspopup event listener method
119 pProgressPopupListener->OnProgressPopupCanceled();
123 _PublicProgressPopupEvent::CreateProgressPopupEventArgN(void)
125 _PublicProgressPopupEventArg* pEventArg = new (std::nothrow) _PublicProgressPopupEventArg();
126 SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
131 }}} // Tizen::Ui::Controls