task manager -> task switcher
[platform/framework/native/appfw.git] / src / app / FApp_AppControlEventArg.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file        FApp_AppControlEventArg.h
19  * @brief       This is the header file of _AppControlEventArg class.
20  */
21
22 #ifndef _FAPP_INTERNAL_APP_CONTROL_EVENT_ARG_H_
23 #define _FAPP_INTERNAL_APP_CONTROL_EVENT_ARG_H_
24
25 #include <FBaseObject.h>
26 #include <FOspConfig.h>
27 #include <FAppTypes.h>
28 #include <FBaseRtIEventArg.h>
29
30 namespace Tizen { namespace Base { namespace Collection {
31 class IList;
32 class IMap;
33 }}}
34
35 namespace Tizen { namespace App
36 {
37
38 class _AppArg;
39 class IAppControlResponseListener;
40
41 /**
42  * @enum        AppControlResposeType
43  */
44 enum _AppControlResponseType
45 {
46         _APPCONTROL_RESPONSETYPE_START,
47         _APPCONTROL_RESPONSETYPE_COMPLETE
48 };
49
50 /**
51  * @class               _AppControlEventArg
52  * @brief
53  */
54 class _AppControlEventArg
55         : public Tizen::Base::Object
56         , public Tizen::Base::Runtime::IEventArg
57 {
58 public:
59         _AppControlEventArg(int reqId, _AppArg* p, int res)
60                 : __reqId(reqId)
61                 , __pArg(p)
62                 , __result(res)
63         {
64         }
65
66         virtual ~_AppControlEventArg(void);
67
68         int GetRequestId(void) const
69         {
70                 return __reqId;
71         }
72
73         _AppArg* GetAppArg(void) const
74         {
75                 return __pArg;
76         }
77
78         int GetResult(void) const
79         {
80                 return __result;
81         }
82
83 private:
84         _AppControlEventArg(const _AppControlEventArg& rhs);
85
86         _AppControlEventArg& operator =(const _AppControlEventArg& rhs);
87
88 private:
89         int __reqId;
90         _AppArg* __pArg;
91         int __result;
92 }; // _AppControlEventArg
93
94 /**
95  * @class               _NativeAppControlEventArg
96  * @brief
97  */
98 class _NativeAppControlEventArg
99         : public Tizen::Base::Object
100         , public Tizen::Base::Runtime::IEventArg
101 {
102 public:
103         _NativeAppControlEventArg(int reqId, int res, Tizen::Base::Collection::IMap* pArgs);
104
105         virtual ~_NativeAppControlEventArg(void);
106
107         int GetRequestId(void) const
108         {
109                 return __reqId;
110         }
111
112         int GetResult(void) const
113         {
114                 return __result;
115         }
116
117         const Tizen::Base::Collection::IMap* GetArgs(void) const
118         {
119                 return __pArgs;
120         }
121
122 private:
123         int __reqId;
124         int __result;
125         Tizen::Base::Collection::IMap* __pArgs;
126 }; // _NativeAppControlEventArg
127
128 /**
129  * @class               _AppControlStartEventArg
130  * @brief
131  */
132 class _AppControlStartEventArg
133         : public Tizen::Base::Object
134         , public Tizen::Base::Runtime::IEventArg
135 {
136 public:
137         _AppControlStartEventArg(int reqId, const AppId& appId, const Tizen::Base::String& operationId)
138                 : __reqId(reqId)
139                 , __appId(appId)
140                 , __operationId(operationId)
141         {
142         }
143
144         virtual ~_AppControlStartEventArg(void)
145         {
146         }
147
148         int GetRequestId(void) const
149         {
150                 return __reqId;
151         }
152
153         AppId GetAppId(void) const
154         {
155                 return __appId;
156         }
157
158         Tizen::Base::String GetOperationId(void) const
159         {
160                 return __operationId;
161         }
162
163 private:
164         _AppControlStartEventArg(const _AppControlStartEventArg& rhs);
165
166         _AppControlStartEventArg& operator =(const _AppControlStartEventArg& rhs);
167
168 private:
169         int __reqId;
170         AppId __appId;
171         Tizen::Base::String __operationId;
172 }; // _AppControlStartEventArg
173
174 /**
175  * @class               _AppControlResponseEventArg
176  * @brief
177  */
178 class _AppControlResponseEventArg
179         : public Tizen::Base::Object
180         , public Tizen::Base::Runtime::IEventArg
181 {
182 public:
183         _AppControlResponseEventArg(IAppControlResponseListener* pResponseListener, _AppControlResponseType type, const AppId& appId, const Tizen::Base::String& operationId, result res, AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData, int reqId)
184                 : __pResponseListener(pResponseListener)
185                 , __type(type)
186                 , __appId(appId.GetPointer())
187                 , __operationId(operationId.GetPointer())
188                 , __res(res)
189                 , __appControlResult(appControlResult)
190                 , __pExtraData(pExtraData)
191                 , __reqId(reqId)
192         {
193         }
194
195         virtual ~_AppControlResponseEventArg(void)
196         {
197                 delete __pExtraData;
198         }
199
200         IAppControlResponseListener* GetListener(void) const
201         {
202                 return __pResponseListener;
203         }
204
205         _AppControlResponseType GetType(void) const
206         {
207                 return __type;
208         }
209
210         const AppId& GetAppId(void) const
211         {
212                 return __appId;
213         }
214
215         const Tizen::Base::String& GetOperationId(void) const
216         {
217                 return __operationId;
218         }
219
220         result GetResult(void) const
221         {
222                 return __res;
223         }
224
225         AppCtrlResult GetAppControlResult(void) const
226         {
227                 return __appControlResult;
228         }
229
230         const Tizen::Base::Collection::IMap* GetExtraData(void) const
231         {
232                 return __pExtraData;
233         }
234
235         int GetRequestId(void) const
236         {
237                 return __reqId;
238         }
239
240 private:
241         _AppControlResponseEventArg(const _AppControlResponseEventArg& rhs);
242
243         _AppControlResponseEventArg& operator =(const _AppControlResponseEventArg& rhs);
244
245 private:
246         IAppControlResponseListener* __pResponseListener;
247         _AppControlResponseType __type;
248         const AppId __appId;
249         const Tizen::Base::String __operationId;
250         result __res;
251         AppCtrlResult __appControlResult;
252         const Tizen::Base::Collection::IMap* __pExtraData;
253         int __reqId;
254 }; // _AppControlEventArg
255
256 } } // Tizen::App
257
258 #endif // _FAPP_INTERNAL_APP_CONTROL_EVENT_ARG_H_