Fix the boiler plate codes
[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  *
56  * The request ID is used to identify each %AppControl request and can be acquired using
57  * IAppControlProviderEventListener::OnAppControlRequestReceived().
58  *
59  */
60 class _OSP_EXPORT_ AppControlProviderManager
61         : public Tizen::Base::Object
62 {
63 public:
64         /**
65          * Gets the application control provider manager instance.
66          *
67          * @since       2.0
68          *
69          * @return      A pointer to the %AppControlProviderManager instance if it succeeds, @n
70          *                      else @c null
71          */
72         static AppControlProviderManager* GetInstance(void);
73
74         /**
75          * Sets the application control provider listener to the application control provider manager. @n
76          * The listener gets notified when the application control request is received from other applications.
77          * To unset the listener, pass a @c null value to the listener parameter. @n
78          *
79          * If the application does not set the listener using %SetAppControlProviderEventListener(),
80          * then the application is launched or moves to the foreground without invoking any listener
81          * for the application request from another application.
82          *
83          * @since       2.0
84          *
85          * @return      An error code
86          * @param[in]   pListener       The application control provider listener
87          * @exception   E_SUCCESS       The method is successful.
88          * @exception   E_INVALID_STATE This instance has not been properly constructed.
89          * @exception   E_INVALID_OPERATION     The listener must be set for the valid %App class.
90          * @exception   E_SYSTEM        A system error has occurred.
91          * @remarks     If the application is newly launched with the AppControl request, then %SetAppControlProviderEventListener() must
92          *                      be set before invoking IAppControlProviderEventListener::OnAppControlRequestReceived().
93          *                      For valid %AppControl request handling, %SetAppControlProviderEventListener() must be called within
94          *                      App::OnAppInitializing().
95          */
96         result SetAppControlProviderEventListener(IAppControlProviderEventListener* pListener);
97
98         /**
99          * Gets the application ID for the application control request.
100          *
101          * @since       2.0
102          *
103          * @return      The application ID @n
104          *                      If an error occurs, an empty string is returned.
105          * @param[in]   reqId   The requestID
106          * @exception   E_SUCCESS       The method is successful.
107          * @exception   E_OBJ_NOT_FOUND The application control request is not found.
108          * @exception   E_INVALID_STATE This instance has not been properly constructed.
109          * @exception   E_SYSTEM        A system error has occurred.
110          * @remarks     The specific error code can be accessed using the GetLastResult() method.
111          */
112         AppId GetClientAppId(RequestId reqId) const;
113
114         /**
115          * Sends the result list for the application control request. @n
116          * The client receives the result by implementing IAppControlResponseListener::OnAppControlCompleteResponseReceived().
117          *
118          * @since       2.0
119          *
120          * @return      An error code
121          * @param[in]   reqId   The application control request ID
122          * @param[in]   appControlResult        The application control result
123          * @param[in]   pExtraData      A pointer to an extra argument map of key and value pair where the key is of type Tizen::Base::String and the value is of type %Tizen::Base::String or type Tizen::Base::Collection::ArrayList of %Tizen::Base::String
124          * @exception   E_SUCCESS       The method is successful.
125          * @exception   E_OBJ_NOT_FOUND The application control request is not found.
126          * @exception   E_SYSTEM        The method cannot proceed due to a severe system error.
127          */
128         result SendAppControlResult(RequestId reqId, AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
129
130 private:
131         /**
132          * This default constructor is intentionally declared as private to implement the %Singleton semantic.
133          *
134          * @since       2.0
135          */
136         AppControlProviderManager(void);
137
138         /**
139          * This destructor is intentionally declared as private to implement the %Singleton semantic.
140          *
141          * @since       2.0
142          */
143         virtual ~AppControlProviderManager(void);
144
145         /**
146          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
147          *
148          * @since       2.0
149          */
150         AppControlProviderManager(const AppControlProviderManager& rhs);
151
152         /**
153          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
154          *
155          * @since       2.0
156          */
157         AppControlProviderManager& operator=(const AppControlProviderManager& rhs);
158
159
160 private:
161         class _AppControlProviderManagerImpl*   __pAppControlProviderManagerImpl;
162
163         friend class _AppControlProviderManagerImpl;
164 };
165
166 };
167 };      // Tizen::App
168
169 #endif //_FAPP_APPCONTROL_PROVIDER_MANAGER_H_
170