2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FAppAppControlProviderManager.h
20 * @brief This is the header file for the %AppControlProviderManager class.
22 * This header file contains the declarations of the %AppControlProviderManager class.
25 #ifndef _FAPP_APPCONTROL_PROVIDER_MANAGER_H_
26 #define _FAPP_APPCONTROL_PROVIDER_MANAGER_H_
28 #include <FBaseDataType.h>
29 #include <FBaseObject.h>
30 #include <FBaseString.h>
31 #include <FAppTypes.h>
34 namespace Tizen { namespace Base { namespace Collection {
39 namespace Tizen { namespace App
42 class IAppControlProviderEventListener;
45 * @class AppControlProviderManager
46 * @brief This class manages the AppControl provider.
50 * @final This class is not intended for extension.
52 * The %AppControlProviderManager class manages the AppControl provider. @n
53 * The %AppControl provider registers or unregisters the IAppControlProviderEventListener listener
54 * for providing the %AppControl functionality, looks up for the delivered %AppControl request information,
55 * and sends the %AppControl result back to the calling application. @n
57 * The request ID is used to identify each %AppControl request and can be acquired using
58 * IAppControlProviderEventListener::OnAppControlRequestReceived().
61 class _OSP_EXPORT_ AppControlProviderManager
62 : public Tizen::Base::Object
66 * Gets the application control provider manager instance.
70 * @return A pointer to the %AppControlProviderManager instance if it succeeds, @n
73 static AppControlProviderManager* GetInstance(void);
76 * Sets the application control provider listener to the application control provider manager. @n
77 * The listener gets notified when the application control request is received from other applications.
78 * To unset the listener, pass a @c null value to the listener parameter. @n
80 * If the application does not set the listener using %SetAppControlProviderEventListener(),
81 * then the application is launched or moves to the foreground without invoking any listener
82 * for the application request from another application.
86 * @return An error code
87 * @param[in] pListener The application control provider listener
88 * @exception E_SUCCESS The method is successful.
89 * @exception E_INVALID_STATE This instance has not been properly constructed.
90 * @exception E_INVALID_OPERATION The listener must be set for the valid %App class.
91 * @exception E_SYSTEM A system error has occurred.
92 * @remarks If the application is newly launched with the AppControl request, then %SetAppControlProviderEventListener() must
93 * be set before invoking IAppControlProviderEventListener::OnAppControlRequestReceived().
94 * For valid %AppControl request handling, %SetAppControlProviderEventListener() must be called within
95 * App::OnAppInitializing().
97 result SetAppControlProviderEventListener(IAppControlProviderEventListener* pListener);
100 * Gets the application ID for the application control request.
104 * @return The application ID @n
105 * If an error occurs, an empty string is returned.
106 * @param[in] reqId The requestID
107 * @exception E_SUCCESS The method is successful.
108 * @exception E_OBJ_NOT_FOUND The application control request is not found.
109 * @exception E_INVALID_STATE This instance has not been properly constructed.
110 * @exception E_SYSTEM A system error has occurred.
111 * @remarks The specific error code can be accessed using the GetLastResult() method.
113 AppId GetClientAppId(RequestId reqId) const;
116 * Sends the result list for the application control request. @n
117 * The client receives the result by implementing IAppControlResponseListener::OnAppControlCompleteResponseReceived().
121 * @return An error code
122 * @param[in] reqId The application control request ID
123 * @param[in] appControlResult The application control result
124 * @param[in] pExtraData A pointer to an extra argument map of key and value pair where the key is of type String and the value is of type String or type ArrayList of String
125 * @exception E_SUCCESS The method is successful.
126 * @exception E_OBJ_NOT_FOUND The application control request is not found.
127 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
129 result SendAppControlResult(RequestId reqId, AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
133 * This default constructor is intentionally declared as private to implement the %Singleton semantic.
137 AppControlProviderManager(void);
140 * This destructor is intentionally declared as private to implement the %Singleton semantic.
144 virtual ~AppControlProviderManager(void);
147 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
151 AppControlProviderManager(const AppControlProviderManager& rhs);
154 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
158 AppControlProviderManager& operator=(const AppControlProviderManager& rhs);
162 class _AppControlProviderManagerImpl* __pAppControlProviderManagerImpl;
164 friend class _AppControlProviderManagerImpl;
170 #endif //_FAPP_APPCONTROL_PROVIDER_MANAGER_H_