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 FApp_NotificationManagerImpl.h
19 * @brief This is the header file for the %_NotificationManagerImpl class.
22 #ifndef _FAPP_INTERNAL_NOTIFICATION_MANAGER_IMPL_H_
23 #define _FAPP_INTERNAL_NOTIFICATION_MANAGER_IMPL_H_
25 #include <FBaseObject.h>
26 #include <FAppTypes.h>
27 #include <FOspConfig.h>
29 #include <FBaseRt_LibraryImpl.h>
32 namespace Tizen { namespace App
35 class _INotificationManagerImpl;
37 class _NotificationManagerImpl
42 * This is the default constructor for this class.
46 _NotificationManagerImpl(void);
49 * This is the destructor for this class.
53 ~_NotificationManagerImpl(void);
56 * Initializes this instance of %_NotificationManagerImpl.
59 * @return An error code
60 * @exception E_SUCCESS The method is successful.
61 * @exception E_SYSTEM A system error has occurred.
62 * @exception E_OUT_OF_MEMORY The memory is insufficient.
64 result Construct(void);
67 * Gets the badge number of the application icon.
71 * @return The current badge number
72 * @exception E_SUCCESS The method is successful.
73 * @exception E_SYSTEM A system error has occurred.
74 * @exception E_OBJ_NOT_FOUND The application is not installed.
75 * @exception E_INVALID_STATE This instance is in an invalid state. @n
76 * The Construct() method is not called.
77 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
78 * In case of failure, this method returns @c -1.
80 int GetBadgeNumber(void) const;
83 * Notifies the user using a badge number.
87 * @return An error code
88 * @param[in] badgeNumber The badge number
89 * @exception E_SUCCESS The method is successful.
90 * @exception E_INVALID_ARG The specified input parameter is invalid, or
91 * the specified @c badgeNumber is less than @c 0.
92 * @exception E_SYSTEM A system error has occurred.
93 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
94 * @exception E_INVALID_STATE This instance is in an invalid state. @n
95 * The Construct() method is not called.
97 result Notify(int badgeNumber) const;
100 * Notifies the user using a message.
104 * @return An error code
105 * @param[in] messageText The notification message
106 * @exception E_SUCCESS The method is successful.
107 * @exception E_INVALID_ARG The specified input parameter is invalid, or
108 * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
109 * @exception E_SYSTEM A system error has occurred.
110 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
111 * @exception E_INVALID_STATE This instance is in an invalid state. @n
112 * The Construct() method is not called.
114 result Notify(const Tizen::Base::String& messageText) const;
117 * Notifies the user using a message and badge number.
121 * @return An error code
122 * @param[in] messageText The notification message
123 * @param[in] badgeNumber The badge number
124 * @exception E_SUCCESS The method is successful.
125 * @exception E_INVALID_ARG The specified @c badgeNumber is less than @c 0, or
126 * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
127 * @exception E_SYSTEM A system error has occurred.
128 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
129 * @exception E_INVALID_STATE This instance is in an invalid state. @n
130 * The Construct() method is not called.
132 result Notify(const Tizen::Base::String& messageText, int badgeNumber) const;
135 * Notifies the user using a message and badge number. @n
136 * If the user checks the message, @c launchArguments is delivered to the application. @n
137 * @c launchArguments is specified as input parameter for Application::OnUserEventReceivedN() or can be obtained by
138 * invoking Application::GetAppArgumentListN(), especially within Application::OnAppInitializing().
142 * @return An error code
143 * @param[in] messageText The notification message
144 * @param[in] badgeNumber The badge number
145 * @param[in] launchArguments The message for application
146 * @exception E_SUCCESS The method is successful.
147 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
148 * - A specified input parameter is invalid. @n
149 * - The specified @c badgeNumber is less than @c 0. @n
150 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
151 * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
152 * @exception E_SYSTEM A system error has occurred.
153 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
154 * @exception E_INVALID_STATE This instance is in an invalid state. @n
155 * The Construct() method is not called.
156 * @see Application::OnUserEventReceivedN(), Application::GetAppArgumentListN()
158 result Notify(const Tizen::Base::String& messageText, int badgeNumber, const Tizen::Base::String& launchArguments) const;
161 * Removes the notification message.
165 * @return An error code
166 * @exception E_SUCCESS The method was successful.
167 * @exception E_SYSTEM A system error occurred.
168 * @exception E_INVALID_STATE This instance is in an invalid state: @n
169 * - The Construct() method is not called. @n
170 * @remarks The method returns E_SUCCESS when there is no outstanding notification.
172 result RemoveNotification(void);
175 * Notifies the user about the ongoing activity using a message.
179 * @return An error code
180 * @param[in] messageText The notification message
181 * @exception E_SUCCESS The method is successful.
182 * @exception E_INVALID_ARG The specified input parameter is invalid, or
183 * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
184 * @exception E_SYSTEM A system error has occurred.
185 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
186 * @exception E_INVALID_STATE This instance is in an invalid state. @n
187 * The Construct() method is not called.
189 result NotifyOngoingActivity(const Tizen::Base::String& messageText) const;
192 * Notifies the user about the ongoing activity using a message. @n
193 * @c launchArguments is specified as input parameter for Application::OnUserEventReceivedN() or can be obtained by
194 * invoking Application::GetAppArgumentListN(), especially within Application::OnAppInitializing().
198 * @return An error code
199 * @param[in] messageText The notification message
200 * @param[in] launchArguments The launch arguments for the application
201 * @exception E_SUCCESS The method is successful.
202 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
203 * - A specified input parameter is invalid. @n
204 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
205 * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
206 * @exception E_SYSTEM A system error has occurred.
207 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
208 * @exception E_INVALID_STATE This instance is in an invalid state. @n
209 * The Construct() method is not called.
210 * @see Application::OnUserEventReceivedN(), Application::GetAppArgumentListN()
212 result NotifyOngoingActivity(const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments) const;
215 * Removes the notification message for the ongoing activity.
219 * @return An error code
220 * @exception E_SUCCESS The method is successful.
221 * @exception E_SYSTEM A system error has occurred.
222 * @exception E_INVALID_STATE This instance is in an invalid state. @n
223 * The Construct() method is not called.
224 * @remarks The method returns E_SUCCESS when there is no outstanding notification.
226 result RemoveOngoingActivityNotification(void);
229 * Gets the badge number of the application icon.
233 * @return The current badge number
234 * @param[in] appId The application ID
235 * @exception E_SUCCESS The method is successful.
236 * @exception E_SYSTEM A system error has occurred.
237 * @exception E_OBJ_NOT_FOUND The application is not installed.
238 * @exception E_INVALID_STATE This instance is in an invalid state. @n
239 * The Construct() method is not called.
240 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
241 * In case of failure, this method returns @c -1.
243 int GetBadgeNumber(const AppId& appId) const;
246 * Notifies the user using a badge number on behalf of the specified application.
250 * @return An error code
251 * @param[in] appId The application ID
252 * @param[in] badgeNumber The badge number
253 * @exception E_SUCCESS The method is successful.
254 * @exception E_INVALID_ARG A specified input parameter is invalid, or
255 * the specified @c badgeNumber is less than @c 0.
256 * @exception E_APP_NOT_INSTALLED The application is not installed.
257 * @exception E_INVALID_OPERATION The target application with the specified application ID is not permitted to get any notification as per the Tizen platform policy.
258 * @exception E_SYSTEM A system error has occurred.
259 * @exception E_INVALID_STATE This instance is in an invalid state. @n
260 * The Construct() method is not called.
262 result NotifyOnBehalf(const AppId& appId, int badgeNumber) const;
265 * Notifies the user using a message on behalf of the specified application.
269 * @return An error code
270 * @param[in] appId The application ID
271 * @param[in] messageText The notification message
272 * @exception E_SUCCESS The method is successful.
273 * @exception E_INVALID_ARG A specified input parameter is invalid, or
274 * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
275 * @exception E_APP_NOT_INSTALLED The application is not installed.
276 * @exception E_INVALID_OPERATION The target application with the specified application ID is not permitted to receive any notification as per the Tizen platform policy.
277 * @exception E_SYSTEM A system error has occurred.
278 * @exception E_INVALID_STATE This instance is in an invalid state. @n
279 * The Construct() method is not called.
281 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText) const;
284 * Notifies the user using a message and badge number on behalf of the specified application.
288 * @return An error code
289 * @param[in] appId The application ID
290 * @param[in] messageText The notification message
291 * @param[in] badgeNumber The badge number
292 * @exception E_SUCCESS The method is successful.
293 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
294 * - A specified input parameter is invalid. @n
295 * - The specified @c badgeNumber is less than @c 0. @n
296 * - The length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
297 * @exception E_APP_NOT_INSTALLED The application is not installed.
298 * @exception E_INVALID_OPERATION The target application with the specified application ID is not permitted to receive any notification as per the Tizen platform policy.
299 * @exception E_SYSTEM A system error has occurred.
300 * @exception E_INVALID_STATE This instance is in an invalid state. @n
301 * The Construct() method is not called.
303 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, int badgeNumber) const;
306 * Notifies the user using a message and badge number on behalf of the specified application. @n
307 * If the user checks the message, the @c launchArguments is delivered to the application.
311 * @return An error code
312 * @param[in] appId The application ID
313 * @param[in] messageText The notification message
314 * @param[in] launchArguments The launch arguments for the application
315 * @exception E_SUCCESS The method is successful.
316 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
317 * - A specified input parameter is invalid. @n
318 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
319 * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
320 * @exception E_APP_NOT_INSTALLED The application is not installed.
321 * @exception E_INVALID_OPERATION The target application with the specified application ID is not permitted to receive any notification as per the Tizen platform policy.
322 * @exception E_SYSTEM A system error has occurred.
323 * @exception E_INVALID_STATE This instance is in an invalid state. @n
324 * The Construct() method is not called.
326 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments) const;
329 * Notifies the user using a message and badge number on behalf of the specified application. @n
330 * If the user checks the message, the @c launchArguments is delivered to the application.
334 * @return An error code
335 * @param[in] appId The application ID
336 * @param[in] messageText The notification message
337 * @param[in] badgeNumber The badge number
338 * @param[in] launchArguments The launch arguments for the application
339 * @exception E_SUCCESS The method is successful.
340 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
341 * - A specified input parameter is invalid. @n
342 * - The specified @c badgeNumber is less than 0. @n
343 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
344 * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
345 * @exception E_APP_NOT_INSTALLED The application is not installed.
346 * @exception E_INVALID_OPERATION The target application with the specified application ID is not permitted to receive any notification as per the Tizen platform policy.
347 * @exception E_SYSTEM A system error has occurred.
348 * @exception E_INVALID_STATE This instance is in an invalid state. @n
349 * The Construct() method is not called.
351 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, int badgeNumber, const Tizen::Base::String& launchArguments) const;
354 * Notifies the user about the ongoing activity using a message on behalf of the specified application.
358 * @return An error code
359 * @param[in] appId The application ID
360 * @param[in] messageText The notification message
361 * @exception E_SUCCESS The method is successful.
362 * @exception E_INVALID_ARG The specified input parameter is invalid, or
363 * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
364 * @exception E_APP_NOT_INSTALLED The application is not installed.
365 * @exception E_SYSTEM A system error has occurred.
366 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
367 * @exception E_INVALID_STATE This instance is in an invalid state. @n
368 * The Construct() method is not called.
370 result NotifyOngoingActivityOnBehalf(const AppId& appId, const Tizen::Base::String& messageText) const;
373 * Notifies the user about the ongoing activity using a message on behalf of the specified application.
377 * @return An error code
378 * @param[in] appId The application ID
379 * @param[in] messageText The notification message
380 * @param[in] launchArguments The launch arguments for application
381 * @exception E_SUCCESS The method is successful.
382 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
383 * - A specified input parameter is invalid. @n
384 * - The length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
385 * - The length of @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
386 * @exception E_APP_NOT_INSTALLED The application is not installed.
387 * @exception E_SYSTEM A system error has occurred.
388 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
389 * @exception E_INVALID_STATE This instance is in an invalid state. @n
390 * The Construct() method is not called.
392 result NotifyOngoingActivityOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments) const;
395 * Removes the notification message for ongoing activity on behalf of the specified application.
399 * @return An error code
400 * @param[in] appId The application ID
401 * @exception E_SUCCESS The method is successful.
402 * @exception E_APP_NOT_INSTALLED The application is not installed.
403 * @exception E_SYSTEM A system error has occurred.
404 * @exception E_INVALID_STATE This instance is in an invalid state. @n
405 * The Construct() method is not called.
406 * @remarks Although there is no outstanding notification for the calling application, this method returns E_SUCCESS.
408 result RemoveOngoingActivityNotificationOnBehalf(const AppId& appId);
411 * Removes the notification message on behalf of the specified application.
415 * @return An error code
416 * @param[in] appId The application ID
417 * @exception E_SUCCESS The method was successful.
418 * @exception E_APP_NOT_INSTALLED The application is not installed.
419 * @exception E_SYSTEM A system error occurred.
420 * @exception E_INVALID_STATE This instance is in an invalid state: @n
421 * - The Construct() method is not called. @n
422 * @remarks Although there is no outstanding notification for the calling application, this method returns E_SUCCESS.
424 result RemoveNotificationOnBehalf(const AppId& appId);
427 _NotificationManagerImpl(const _NotificationManagerImpl& rhs);
429 _NotificationManagerImpl& operator =(const _NotificationManagerImpl& rhs);
432 _INotificationManagerImpl* __pNotiImpl;
433 Tizen::Base::Runtime::_LibraryImpl __lib;
434 }; //_NotificationManagerImpl
438 #endif // _FAPP_INTERNAL_NOTIFICATION_MANAGER_IMPL_H_