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