2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 FShellAppWidgetManager.h
20 * @brief This is the header file for the %AppWidgetManager class.
22 * This header file contains the declarations of the %AppWidgetManager class.
25 #ifndef _FSHELL_APPWIDGET_MANAGER_H_
26 #define _FSHELL_APPWIDGET_MANAGER_H_
28 #include <unique_ptr.h>
29 #include <FBaseString.h>
30 #include <FAppTypes.h>
32 namespace Tizen { namespace Base { namespace Collection { class IList; } } }
33 namespace Tizen { namespace Shell
36 class AppWidgetProviderInfo;
37 class IAppWidgetRequestListener;
40 * @class AppWidgetManager
41 * @brief This class manages static information of all the AppWidgets and provides APIs for AppWidget viewer (such as the Home screen).
45 * @final This class is not intended for extension.
47 * The %AppWidgetManager class manages static information of all the AppWidgets and deliveries request to add AppWidget.
49 class _OSP_EXPORT_ AppWidgetManager
50 : public Tizen::Base::Object
55 * Gets the AppWidget manager instance.
59 * @return A pointer to the %AppWidgetManager instance, @n
60 * else @c null if it fails
62 static AppWidgetManager* GetInstance(void);
65 * Gets a list of installed AppWidgetProviderInfo.
69 * @return A pointer to the array list that contains all AppWidgetProviderInfo of installed AppWidgetProvider, @n
70 * else @c null if an error occurs
72 * @exception E_SUCCESS The method is successful.
73 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
74 * @remarks The specific error code can be accessed using the GetLastResult() method.
76 Tizen::Base::Collection::IList* GetAppWidgetProviderInfoListN(void) const;
79 * Gets a AppWidgetProviderInfo of the specified AppWidget provider.
83 * @return A pointer to the AppWidgetProviderInfo instance of the specified AppWidgetProvider, @n
84 * else @c null if an error occurs
85 * @param[in] appId The ID of the application that provides AppWidget
86 * @param[in] providerName The name of the AppWidget provider
87 * @exception E_SUCCESS The method is successful.
88 * @exception E_APP_NOT_INSTALLED The application is not installed.
89 * @exception E_OBJ_NOT_FOUND The specified AppWidget provider is not found.
90 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
91 * @remarks The specific error code can be accessed using the GetLastResult() method.
93 AppWidgetProviderInfo* GetAppWidgetProviderInfoN(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName) const;
96 * Gets the AppWidgetProviderInfo of the default AppWidget provider in the package.
100 * @return A pointer to the AppWidgetProviderInfo instance of the default AppWidgetProvider, @n
101 * else @c null if there is no default AppWidget provider or if an error occurs
102 * @param[in] packageId The ID of the package that contains the AppWidget provider
103 * @exception E_SUCCESS The method is successful.
104 * @exception E_APP_NOT_INSTALLED The application is not installed.
105 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
106 * @remarks The specific error code can be accessed using the GetLastResult() method.
108 AppWidgetProviderInfo* GetDefaultAppWidgetProviderInfoN(const Tizen::App::PackageId& packageId) const;
111 * Sets a AppWidget request listener. @n
112 * The listener gets notified when the request is received. @n
113 * To unset the listener, pass a @c null value to the @c pListener parameter.
117 * @return An error code
118 * @param[in] pListener The pointer to the listener to receive request to add AppWidget
119 * @exception E_SUCCESS The method is successful.
120 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
121 * @remarks Platform does not have the ownership of this pointer, so caller should manage the listener object properly.
122 * @see IAppWidgetRequestListener
124 result SetAppWidgetRequestListener(IAppWidgetRequestListener* pListener);
128 // This default constructor is intentionally declared as private to implement the %Singleton semantic.
132 AppWidgetManager(void);
135 // This destructor is intentionally declared as private to implement the %Singleton semantic.
139 virtual ~AppWidgetManager(void);
142 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
146 AppWidgetManager(const AppWidgetManager& rhs);
149 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
153 AppWidgetManager& operator =(const AppWidgetManager& rhs);
156 // Constructs the instance of this class.
160 // @return An error code
161 // @exception E_SUCCESS The method is successful.
162 // @exception E_SYSTEM The method cannot proceed due to a severe system error.
164 result Construct(void);
166 static void InitSingleton(void);
167 static void DestroySingleton(void);
171 static AppWidgetManager* __pTheInstance;
172 class _AppWidgetManagerImpl* __pAppWidgetManagerImpl;
173 friend struct std::default_delete< AppWidgetManager >;
177 #endif /* _FSHELL_APPWIDGET_MANAGER_H_ */