Merge "Applied sizeof operator on fixed sized array to calculate size." into tizen_2.2
[platform/framework/native/appfw.git] / src / app / inc / FApp_LaunchInfo.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_LaunchInfo.h
19  * @brief       This is the header file for the _LaunchInfo class.
20  */
21
22 #ifndef _FAPP_INTERNAL_LAUNCH_INFO_H_
23 #define _FAPP_INTERNAL_LAUNCH_INFO_H_
24
25 #include <app_service.h>
26
27 #include <FOspConfig.h>
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30 #include <FAppTypes.h>
31
32 namespace Tizen { namespace Base
33 {
34 namespace Runtime
35 {
36 class IEventListener;
37 }
38 }}
39
40 namespace Tizen { namespace App
41 {
42 class _IAppControlPluginProvider;
43 class _AppArg;
44
45 typedef result (*LaunchCbType)(void* data, _AppArg* pArg, _AppArg* pResArg, service_result_e res, int prop, int reqId);
46
47
48 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
49 // _DataControlInfo handles the launch request from this process
50 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
51 const long LAUNCH_INFO_MAGIC = 0x494C;
52
53 class _DataControlInfo
54 {
55 public:
56         _DataControlInfo(_AppArg* pArg, LaunchCbType pCb, void* pData, int prop)
57                 : magic(LAUNCH_INFO_MAGIC)
58                 , reqId(-1)
59                 , pArg(pArg)
60                 , launchCb(pCb)
61                 , pUserData(pData)
62                 , property(prop)
63         {
64         }
65
66         ~_DataControlInfo(void);
67
68 private:
69         _DataControlInfo(const _DataControlInfo& rhs);
70         _DataControlInfo& operator =(const _DataControlInfo& rhs);
71
72 public:
73         const long      magic;
74         int reqId;
75         _AppArg* pArg;
76         const LaunchCbType launchCb;
77         void* pUserData;
78         const int property;
79 }; // _DataControlInfo
80
81
82 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
83 // _InAppRequestManager manges In-process AppControl request
84 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
85 struct _InProcessInfo
86 {
87 public:
88         _InProcessInfo(const Tizen::Base::String& aId, const Tizen::Base::String& oId, int prop, bool legacy, _IAppControlPluginProvider* pProvider, Tizen::Base::Runtime::IEventListener* pListener)
89                 : reqId(-1)
90                 , providerId(aId)
91                 , operationId(oId)
92                 , property(prop)
93                 , pProvider(pProvider)
94                 , pListener(pListener)
95                 , isLegacy(legacy)
96         {
97         }
98
99         // implicit process info
100         _InProcessInfo(bool legacy, _IAppControlPluginProvider* pProvider, Tizen::Base::Runtime::IEventListener* pListener)
101                 : reqId(-1)
102                 , property(0)
103                 , pProvider(pProvider)
104                 , pListener(pListener)
105                 , isLegacy(legacy)
106         {
107         }
108
109         ~_InProcessInfo(void);
110
111 private:
112         _InProcessInfo(const _InProcessInfo& rhs);
113         _InProcessInfo& operator =(const _InProcessInfo& rhs);
114
115 public:
116         int reqId;
117         const Tizen::Base::String providerId;
118         const Tizen::Base::String operationId;
119         const int property;
120         _IAppControlPluginProvider* pProvider;
121         Tizen::Base::Runtime::IEventListener* pListener;
122         const bool isLegacy;
123 }; // _InProcessInfo
124
125
126 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
127 // _RequestManager manges out-of-process launch request and handles the return arguments
128 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
129 class _ResultInfo
130 {
131 public:
132         _ResultInfo(_AppArg& arg)
133                 : reqId(-1)
134                 , arg(arg)
135         {
136         }
137
138         ~_ResultInfo(void);
139
140 private:
141         _ResultInfo(const _ResultInfo& rhs);
142         _ResultInfo& operator =(const _ResultInfo& rhs);
143
144 public:
145         int reqId;
146         _AppArg& arg;
147 }; // _ResultInfo
148
149
150 }} // Tizen::App
151
152 #endif // _FAPP_INTERNAL_LAUNCH_INFO_H_