Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_ProgressPopupEvent.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
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.
16 //
17
18 /**
19 * @file FUiCtrl_ProgressPopupEvent.cpp
20 * @brief        This is the implementation for the ActionEvent class.
21 */
22
23 #include <new>
24 #include <FBaseErrors.h>
25 #include <FBaseSysLog.h>
26 #include "FUiCtrl_IProgressPopupEventListener.h"
27 #include "FUiCtrl_ProgressPopupEvent.h"
28
29
30 using namespace Tizen::Base;
31 using namespace Tizen::Base::Runtime;
32
33
34 namespace Tizen { namespace Ui { namespace Controls
35 {
36
37
38 class _OSP_EXPORT_ _ProgressPopupEventArg
39         : public Object
40         , public IEventArg
41 {
42 public:
43         _ProgressPopupEventArg(void);
44
45         virtual ~_ProgressPopupEventArg(void);
46
47 }; // _ProgressPopupEventArg
48
49
50 _ProgressPopupEventArg::_ProgressPopupEventArg(void)
51 {
52         // empty statement
53 }
54
55 _ProgressPopupEventArg::~_ProgressPopupEventArg(void)
56 {
57         // empty statement
58 }
59
60
61 _ProgressPopupEvent::_ProgressPopupEvent(const _Control& source)
62         : __pSource(null)
63 {
64         result r = _Event::Initialize();
65
66         // set event source
67         if (r == E_SUCCESS)
68         {
69                 __pSource = &source;
70                 SetLastResult(E_SUCCESS);
71         }
72 }
73
74 _ProgressPopupEvent::~_ProgressPopupEvent(void)
75 {
76         // empty statement
77 }
78
79 _ProgressPopupEvent*
80 _ProgressPopupEvent::CreateInstanceN(const _Control& source)
81 {
82         _ProgressPopupEvent* pProgressPopupEvent = new (std::nothrow) _ProgressPopupEvent(source);
83         SysTryReturn(NID_UI_CTRL, pProgressPopupEvent, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
84
85         if (IsFailed(GetLastResult()))
86         {
87                 goto CATCH;
88         }
89
90         return pProgressPopupEvent;
91
92 CATCH:
93         delete pProgressPopupEvent;
94         return null;
95 }
96
97 const _Control*
98 _ProgressPopupEvent::GetSource(void) const
99 {
100         return __pSource;
101 }
102
103 void
104 _ProgressPopupEvent::FireImpl(IEventListener& pListener, const IEventArg& arg)
105 {
106         // cast to _IProgressPopupEventListener
107         _IProgressPopupEventListener* pProgressPopupListener = dynamic_cast <_IProgressPopupEventListener*>(&pListener);
108         SysTryReturnVoidResult(NID_UI_CTRL, pProgressPopupListener != null, E_INVALID_ARG,
109                                 "[E_INVALID_ARG] The invalid listener was given.\n");
110
111         // call progresspopup event listener method
112         pProgressPopupListener->OnProgressPopupCanceled();
113 }
114
115 IEventArg*
116 _ProgressPopupEvent::CreateProgressPopupEventArgN(void)
117 {
118         _ProgressPopupEventArg* pEventArg = new (std::nothrow) _ProgressPopupEventArg();
119         SysTryReturn(NID_UI_CTRL, pEventArg != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage.");
120
121         return pEventArg;
122 }
123
124 }}} // Tizen::Ui::Controls