Enable build with iniparser v 3.1
[platform/framework/native/appfw.git] / inc / FAppAppControlProviderManager.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         FAppAppControlProviderManager.h
19  * @brief       This is the header file for the %AppControlProviderManager class.
20  *
21  * This header file contains the declarations of the %AppControlProviderManager class.
22  */
23
24 #ifndef _FAPP_APPCONTROL_PROVIDER_MANAGER_H_
25 #define _FAPP_APPCONTROL_PROVIDER_MANAGER_H_
26
27 #include <FBaseDataType.h>
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30 #include <FAppTypes.h>
31
32
33 namespace Tizen { namespace Base { namespace Collection {
34 class IList;
35 class IMap;
36 }}}
37
38 namespace Tizen { namespace App
39 {
40
41 class IAppControlProviderEventListener;
42
43 /**
44  * @class       AppControlProviderManager
45  * @brief       This class manages the %AppControl provider.
46  *
47  * @since       2.0
48  *
49  * @final       This class is not intended for extension.
50  *
51  * The %AppControlProviderManager class manages the AppControl provider. @n
52  * The %AppControl provider registers or unregisters the IAppControlProviderEventListener listener
53  * for providing the %AppControl functionality, looks up for the delivered %AppControl request information,
54  * and sends the %AppControl result back to the calling application. @n
55  * The request ID is used to identify each %AppControl request and can be acquired using the
56  * IAppControlProviderEventListener::OnAppControlRequestReceived() method.
57  *
58  */
59 class _OSP_EXPORT_ AppControlProviderManager
60         : public Tizen::Base::Object
61 {
62 public:
63         /**
64          * Gets a pointer to the %AppControlProviderManager instance.
65          *
66          * @since       2.0
67          *
68          * @return      A pointer to the %AppControlProviderManager instance, @n
69          *                      else @c null if it fails
70          */
71         static AppControlProviderManager* GetInstance(void);
72
73         /**
74          * Sets the application control provider listener to the application control provider manager. @n
75          * The listener gets notified when the application control request is received from other applications.
76          * To unset the listener, pass a @c null value to the listener parameter. @n
77          * If the application does not set the listener using the %SetAppControlProviderEventListener() method,
78          * then the application is launched or moves to the foreground without invoking any listener
79          * for the application request from another application.
80          *
81          * @since       2.0
82          *
83          * @return              An error code
84          * @param[in]   pListener                       The application control provider listener
85          * @exception   E_SUCCESS                       The method is successful.
86          * @exception   E_INVALID_STATE         This instance has not been properly constructed.
87          * @exception   E_INVALID_OPERATION     The listener must be set for the valid App class.
88          * @exception   E_SYSTEM                        A system error has occurred.
89          * @remarks
90          *                      - If the application is newly launched with the AppControl request, then the %SetAppControlProviderEventListener() method must
91          *                      be set before invoking the IAppControlProviderEventListener::OnAppControlRequestReceived() method.
92          *                      - For valid %AppControl request handling, the %SetAppControlProviderEventListener() method within App::OnAppInitializing()
93          *                      must be called.
94          */
95         result SetAppControlProviderEventListener(IAppControlProviderEventListener* pListener);
96
97         /**
98          * Gets the application ID for the application control request.
99          *
100          * @since       2.0
101          *
102          * @return              The application ID, @n
103          *                              else an empty string is returned if an error occurs
104          * @param[in]   reqId                   The requestID
105          * @exception   E_SUCCESS               The method is successful.
106          * @exception   E_OBJ_NOT_FOUND The application control request has not been found.
107          * @exception   E_INVALID_STATE This instance has not been properly constructed.
108          * @exception   E_SYSTEM                A system error has occurred.
109          * @remarks     The specific error code can be accessed using the GetLastResult() method.
110          */
111         AppId GetClientAppId(RequestId reqId) const;
112
113         /**
114          * Sends the result list for the application control request. @n
115          * The client receives the result by implementing the IAppControlResponseListener::OnAppControlCompleteResponseReceived() method.
116          *
117          * @since       2.0
118          *
119          * @return              An error code
120          * @param[in]   reqId                           The application control request ID
121          * @param[in]   appControlResult        The application control result
122          * @param[in]   pExtraData                      A pointer to the extra argument map of the key and value pair, where the key is of type Tizen::Base::String and the value is of type %Tizen::Base::String or of type Tizen::Base::Collection::ArrayList of %Tizen::Base::String
123          * @exception   E_SUCCESS                       The method is successful.
124          * @exception   E_OBJ_NOT_FOUND         The application control request has not been found.
125          * @exception   E_SYSTEM                        The method cannot proceed due to a severe system error.
126          */
127         result SendAppControlResult(RequestId reqId, AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
128
129 private:
130         /**
131          * This default constructor is intentionally declared as private to implement the %Singleton semantic.
132          *
133          * @since       2.0
134          */
135         AppControlProviderManager(void);
136
137         /**
138          * This destructor is intentionally declared as private to implement the %Singleton semantic.
139          *
140          * @since       2.0
141          */
142         virtual ~AppControlProviderManager(void);
143
144         /**
145          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
146          *
147          * @since       2.0
148          */
149         AppControlProviderManager(const AppControlProviderManager& rhs);
150
151         /**
152          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
153          *
154          * @since       2.0
155          */
156         AppControlProviderManager& operator=(const AppControlProviderManager& rhs);
157
158
159 private:
160         class _AppControlProviderManagerImpl*   __pAppControlProviderManagerImpl;
161
162         friend class _AppControlProviderManagerImpl;
163 };
164
165 };
166 };      // Tizen::App
167
168 #endif //_FAPP_APPCONTROL_PROVIDER_MANAGER_H_
169