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 * @feature %http://tizen.org/feature/shell.appwidget
\r
61 * @return A pointer to the %AppWidgetManager instance, @n
62 * else @c null if it fails
64 * @exception E_SUCCESS The method is successful.
65 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
66 * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature.
\r
67 * For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
\r
69 * @remarks - The specific error code can be accessed using the GetLastResult() method.
70 * - Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
72 static AppWidgetManager* GetInstance(void);
75 * Gets a list of installed AppWidgetProviderInfo.
79 * @return A pointer to the array list that contains all AppWidgetProviderInfo of installed AppWidgetProvider, @n
80 * else @c null if an error occurs
82 * @exception E_SUCCESS The method is successful.
83 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
84 * @remarks The specific error code can be accessed using the GetLastResult() method.
86 Tizen::Base::Collection::IList* GetAppWidgetProviderInfoListN(void) const;
89 * Gets a AppWidgetProviderInfo of the specified AppWidget provider.
93 * @return A pointer to the AppWidgetProviderInfo instance of the specified AppWidgetProvider, @n
94 * else @c null if an error occurs
95 * @param[in] appId The ID of the application that provides AppWidget
96 * @param[in] providerName The name of the AppWidget provider
97 * @exception E_SUCCESS The method is successful.
98 * @exception E_APP_NOT_INSTALLED The application is not installed.
99 * @exception E_OBJ_NOT_FOUND The specified AppWidget provider is not found.
100 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
101 * @remarks The specific error code can be accessed using the GetLastResult() method.
103 AppWidgetProviderInfo* GetAppWidgetProviderInfoN(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName) const;
106 * Gets the AppWidgetProviderInfo of the default AppWidget provider in the package.
110 * @return A pointer to the AppWidgetProviderInfo instance of the default AppWidgetProvider, @n
111 * else @c null if there is no default AppWidget provider or if an error occurs
112 * @param[in] packageId The ID of the package that contains the AppWidget provider
113 * @exception E_SUCCESS The method is successful.
114 * @exception E_APP_NOT_INSTALLED The application is not installed.
115 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
116 * @remarks The specific error code can be accessed using the GetLastResult() method.
118 AppWidgetProviderInfo* GetDefaultAppWidgetProviderInfoN(const Tizen::App::PackageId& packageId) const;
121 * Sets a AppWidget request listener. @n
122 * The listener gets notified when the request is received. @n
123 * To unset the listener, pass a @c null value to the @c pListener parameter.
127 * @return An error code
128 * @param[in] pListener The pointer to the listener to receive request to add AppWidget
129 * @exception E_SUCCESS The method is successful.
130 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
131 * @remarks Platform does not have the ownership of this pointer, so caller should manage the listener object properly.
132 * @see IAppWidgetRequestListener
134 result SetAppWidgetRequestListener(IAppWidgetRequestListener* pListener);
138 // This default constructor is intentionally declared as private to implement the %Singleton semantic.
142 AppWidgetManager(void);
145 // This destructor is intentionally declared as private to implement the %Singleton semantic.
149 virtual ~AppWidgetManager(void);
152 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
156 AppWidgetManager(const AppWidgetManager& rhs);
159 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
163 AppWidgetManager& operator =(const AppWidgetManager& rhs);
166 // Constructs the instance of this class.
170 // @return An error code
171 // @exception E_SUCCESS The method is successful.
172 // @exception E_SYSTEM The method cannot proceed due to a severe system error.
174 result Construct(void);
176 static void InitSingleton(void);
177 static void DestroySingleton(void);
181 static AppWidgetManager* __pTheInstance;
182 class _AppWidgetManagerImpl* __pAppWidgetManagerImpl;
183 friend struct std::default_delete< AppWidgetManager >;
187 #endif /* _FSHELL_APPWIDGET_MANAGER_H_ */