2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FAppAppControlProviderManager.h
19 * @brief This is the header file for the %AppControlProviderManager class.
21 * This header file contains the declarations of the %AppControlProviderManager class.
24 #ifndef _FAPP_APPCONTROL_PROVIDER_MANAGER_H_
25 #define _FAPP_APPCONTROL_PROVIDER_MANAGER_H_
27 #include <FBaseDataType.h>
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30 #include <FAppTypes.h>
33 namespace Tizen { namespace Base { namespace Collection {
38 namespace Tizen { namespace App
41 class IAppControlProviderEventListener;
44 * @class AppControlProviderManager
45 * @brief This class manages the %AppControl provider.
49 * @final This class is not intended for extension.
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.
59 class _OSP_EXPORT_ AppControlProviderManager
60 : public Tizen::Base::Object
64 * Gets a pointer to the %AppControlProviderManager instance.
68 * @return A pointer to the %AppControlProviderManager instance, @n
69 * else @c null if it fails
71 static AppControlProviderManager* GetInstance(void);
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.
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.
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()
95 result SetAppControlProviderEventListener(IAppControlProviderEventListener* pListener);
98 * Gets the application ID for the application control request.
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.
111 AppId GetClientAppId(RequestId reqId) const;
114 * Sends the result list for the application control request. @n
115 * The client receives the result by implementing the IAppControlResponseListener::OnAppControlCompleteResponseReceived() method.
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.
127 result SendAppControlResult(RequestId reqId, AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
131 * This default constructor is intentionally declared as private to implement the %Singleton semantic.
135 AppControlProviderManager(void);
138 * This destructor is intentionally declared as private to implement the %Singleton semantic.
142 virtual ~AppControlProviderManager(void);
145 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
149 AppControlProviderManager(const AppControlProviderManager& rhs);
152 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
156 AppControlProviderManager& operator=(const AppControlProviderManager& rhs);
160 class _AppControlProviderManagerImpl* __pAppControlProviderManagerImpl;
162 friend class _AppControlProviderManagerImpl;
168 #endif //_FAPP_APPCONTROL_PROVIDER_MANAGER_H_