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
56 * The request ID is used to identify each %AppControl request and can be acquired using
57 * IAppControlProviderEventListener::OnAppControlRequestReceived().
60 class _OSP_EXPORT_ AppControlProviderManager
61 : public Tizen::Base::Object
65 * Gets the application control provider manager instance.
69 * @return A pointer to the %AppControlProviderManager instance if it succeeds, @n
72 static AppControlProviderManager* GetInstance(void);
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
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.
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().
96 result SetAppControlProviderEventListener(IAppControlProviderEventListener* pListener);
99 * Gets the application ID for the application control request.
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.
112 AppId GetClientAppId(RequestId reqId) const;
115 * Sends the result list for the application control request. @n
116 * The client receives the result by implementing IAppControlResponseListener::OnAppControlCompleteResponseReceived().
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.
128 result SendAppControlResult(RequestId reqId, AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
132 * This default constructor is intentionally declared as private to implement the %Singleton semantic.
136 AppControlProviderManager(void);
139 * This destructor is intentionally declared as private to implement the %Singleton semantic.
143 virtual ~AppControlProviderManager(void);
146 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
150 AppControlProviderManager(const AppControlProviderManager& rhs);
153 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
157 AppControlProviderManager& operator=(const AppControlProviderManager& rhs);
161 class _AppControlProviderManagerImpl* __pAppControlProviderManagerImpl;
163 friend class _AppControlProviderManagerImpl;
169 #endif //_FAPP_APPCONTROL_PROVIDER_MANAGER_H_