Merge "Remove fallback functions for timezone and locales." 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 _LibraryImpl;
37 class IEventListener;
38 }
39 }}
40
41 namespace Tizen { namespace App
42 {
43
44 class _AppArg;
45
46 typedef result (*LaunchCbType)(void* data, _AppArg* pArg, _AppArg* pResArg, service_result_e res, int prop, int reqId);
47
48
49 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
50 // _LaunchInfo handles the launch request from this process
51 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
52 const long LAUNCH_INFO_MAGIC = 0x494C;
53
54 class _LaunchInfo
55 {
56 public:
57         _LaunchInfo(_AppArg* pArg, LaunchCbType pCb, void* pData, int prop)
58                 : magic(LAUNCH_INFO_MAGIC)
59                 , reqId(-1)
60                 , pArg(pArg)
61                 , launchCb(pCb)
62                 , pUserData(pData)
63                 , property(prop)
64         {
65         }
66
67         ~_LaunchInfo(void);
68
69 private:
70         _LaunchInfo(const _LaunchInfo& rhs);
71         _LaunchInfo& operator =(const _LaunchInfo& rhs);
72
73 public:
74         const long      magic;
75         int reqId;
76         _AppArg* pArg;
77         const LaunchCbType launchCb;
78         void* pUserData;
79         const int property;
80 }; // _LaunchInfo
81
82
83 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
84 // _InAppRequestManager manges In-process AppControl request
85 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
86 struct _InProcessInfo
87 {
88 public:
89         _InProcessInfo(const Tizen::Base::String& aId, const Tizen::Base::String& oId, int prop, bool legacy, Tizen::Base::Runtime::_LibraryImpl& lib, Tizen::Base::Runtime::IEventListener* pListener)
90                 : reqId(-1)
91                 , providerId(aId)
92                 , operationId(oId)
93                 , property(prop)
94                 , pLib(&lib)
95                 , pListener(pListener)
96                 , isLegacy(legacy)
97         {
98         }
99
100         ~_InProcessInfo(void);
101
102 private:
103         _InProcessInfo(const _InProcessInfo& rhs);
104         _InProcessInfo& operator =(const _InProcessInfo& rhs);
105
106 public:
107         int reqId;
108         const Tizen::Base::String providerId;
109         const Tizen::Base::String operationId;
110         const int property;
111         Tizen::Base::Runtime::_LibraryImpl* pLib;       // non-empty
112         Tizen::Base::Runtime::IEventListener* pListener;
113         const bool isLegacy;
114 }; // _InProcessInfo
115
116
117 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
118 // _RequestManager manges out-of-process launch request and handles the return arguments
119 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
120 class _ResultInfo
121 {
122 public:
123         _ResultInfo(_AppArg& arg)
124                 : reqId(-1)
125                 , arg(arg)
126         {
127         }
128
129         ~_ResultInfo(void);
130
131 private:
132         _ResultInfo(const _ResultInfo& rhs);
133         _ResultInfo& operator =(const _ResultInfo& rhs);
134
135 public:
136         int reqId;
137         _AppArg& arg;
138 }; // _ResultInfo
139
140
141 }} // Tizen::App
142
143 #endif // _FAPP_INTERNAL_LAUNCH_INFO_H_