5585266fc7d1fb825a11947f811f3ba24cf31239
[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         const int __reqId;
90         _AppArg* __pArg;
91         const 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, int prop);
104
105         _NativeAppControlEventArg(int reqId, int res, const AppId& appId, const Tizen::Base::String& oId, Tizen::Base::Collection::IMap* pArgs, int prop);
106
107         virtual ~_NativeAppControlEventArg(void) {}
108
109         int GetRequestId(void) const
110         {
111                 return __reqId;
112         }
113
114         int GetResult(void) const
115         {
116                 return __result;
117         }
118
119         const Tizen::Base::Collection::IMap* GetArgs(void) const
120         {
121                 return __pArgs;
122         }
123
124         int GetProperty(void) const
125         {
126                 return __property;
127         }
128
129         AppId GetOptionalAppId(void) const
130         {
131                 return __optAppId;
132         }
133
134         Tizen::Base::String GetOptionalOperationId(void) const
135         {
136                 return __optOperationId;
137         }
138
139 private:
140         const int __reqId;
141         const int __result;
142         Tizen::Base::Collection::IMap* __pArgs;
143         const int __property;
144         AppId __optAppId;
145         Tizen::Base::String __optOperationId;
146 }; // _NativeAppControlEventArg
147
148 /**
149  * @class               _AppControlStartEventArg
150  * @brief
151  */
152 class _AppControlStartEventArg
153         : public Tizen::Base::Object
154         , public Tizen::Base::Runtime::IEventArg
155 {
156 public:
157         _AppControlStartEventArg(int reqId, const AppId& appId, const Tizen::Base::String& operationId)
158                 : __reqId(reqId)
159                 , __appId(appId)
160                 , __operationId(operationId)
161         {
162         }
163
164         virtual ~_AppControlStartEventArg(void)
165         {
166         }
167
168         int GetRequestId(void) const
169         {
170                 return __reqId;
171         }
172
173         AppId GetAppId(void) const
174         {
175                 return __appId;
176         }
177
178         Tizen::Base::String GetOperationId(void) const
179         {
180                 return __operationId;
181         }
182
183 private:
184         _AppControlStartEventArg(const _AppControlStartEventArg& rhs);
185
186         _AppControlStartEventArg& operator =(const _AppControlStartEventArg& rhs);
187
188 private:
189         int __reqId;
190         AppId __appId;
191         Tizen::Base::String __operationId;
192 }; // _AppControlStartEventArg
193
194 /**
195  * @class               _AppControlResponseEventArg
196  * @brief
197  */
198 class _AppControlResponseEventArg
199         : public Tizen::Base::Object
200         , public Tizen::Base::Runtime::IEventArg
201 {
202 public:
203         _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, bool isSubMode)
204                 : __pResponseListener(pResponseListener)
205                 , __type(type)
206                 , __appId(appId.GetPointer())
207                 , __operationId(operationId.GetPointer())
208                 , __res(res)
209                 , __appControlResult(appControlResult)
210                 , __pExtraData(pExtraData)
211                 , __reqId(reqId)
212                 , __isSubMode(isSubMode)
213         {
214         }
215
216         virtual ~_AppControlResponseEventArg(void)
217         {
218                 delete __pExtraData;
219         }
220
221         IAppControlResponseListener* GetListener(void) const
222         {
223                 return __pResponseListener;
224         }
225
226         _AppControlResponseType GetType(void) const
227         {
228                 return __type;
229         }
230
231         const AppId& GetAppId(void) const
232         {
233                 return __appId;
234         }
235
236         const Tizen::Base::String& GetOperationId(void) const
237         {
238                 return __operationId;
239         }
240
241         result GetResult(void) const
242         {
243                 return __res;
244         }
245
246         AppCtrlResult GetAppControlResult(void) const
247         {
248                 return __appControlResult;
249         }
250
251         const Tizen::Base::Collection::IMap* GetExtraData(void) const
252         {
253                 return __pExtraData;
254         }
255
256         int GetRequestId(void) const
257         {
258                 return __reqId;
259         }
260
261         bool IsSubMode(void) const
262         {
263                 return __isSubMode;
264         }
265
266 private:
267         _AppControlResponseEventArg(const _AppControlResponseEventArg& rhs);
268
269         _AppControlResponseEventArg& operator =(const _AppControlResponseEventArg& rhs);
270
271 private:
272         IAppControlResponseListener* __pResponseListener;
273         const _AppControlResponseType __type;
274         const AppId __appId;
275         const Tizen::Base::String __operationId;
276         const result __res;
277         const AppCtrlResult __appControlResult;
278         const Tizen::Base::Collection::IMap* __pExtraData;
279         const int __reqId;
280         const bool __isSubMode;
281 }; // _AppControlEventArg
282
283 } } // Tizen::App
284
285 #endif // _FAPP_INTERNAL_APP_CONTROL_EVENT_ARG_H_