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.
19 * @file FAppNotificationManager.h
20 * @brief This is the header file for the %NotificationManager class.
22 * This header file contains the declarations of the %NotificationManager class.
26 #ifndef _FAPP_NOTIFICATION_MANAGER_H_
27 #define _FAPP_NOTIFICATION_MANAGER_H_
30 #include <FAppTypes.h>
32 namespace Tizen { namespace App
37 * The maximum length of the notification message.
39 * @brief <i> [Deprecated] </i>
41 * @deprecated This variable is deprecated. Instead of using this variable, use the Tizen::Shell::MAX_NOTIFICATION_MESSAGE_LENGTH variable.
45 static const int MAX_NOTIFICATION_MESSAGE_LENGTH = 127;
49 * The maximum length of the launch arguments for the notification in bytes.
51 * @brief <i> [Deprecated] </i>
53 * @deprecated This variable is deprecated. Instead of using this variable, use the Tizen::Shell::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH variable.
57 static const int MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH = 1024;
61 * The maximum length of the notification badge number.
63 * @brief <i> [Deprecated] </i>
65 * @deprecated This variable is deprecated. Instead of using this variable, use the Tizen::Shell::MAX_NOTIFICATION_BADGE_NUMBER variable.
69 static const int MAX_NOTIFICATION_BADGE_NUMBER = 999;
73 * @class NotificationManager
74 * @brief <i> [Deprecated] </i> This class provides methods to alert the user about a notification.
76 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
79 * @final This class is not intended for extension.
81 * The %NotificationManager class provides methods to alert the user about a notification.
83 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/shell/notifications.htm">Notifications</a>.
85 * The following example demonstrates how to use the %NotificationManager class.
90 * MyClass::NotificationSample(void)
93 * NotificationManager* pNotiMgr = new NotificationManager();
94 * pNotiMgr->Construct();
95 * badgeNumber = pNotiMgr->GetBadgeNumber();
97 * pNotiMgr->Notify(L"A new message has arrived.", badgeNumber);
104 class _OSP_EXPORT_ NotificationManager
105 : public Tizen::Base::Object
111 * This is the default constructor for this class.
113 * @brief <i> [Deprecated] </i>
115 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
119 NotificationManager(void);
123 * This destructor overrides Tizen::Base::Object::~Object().
125 * @brief <i> [Deprecated] </i>
127 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
131 virtual ~NotificationManager(void);
135 * Initializes this instance of %NotificationManager.
137 * @brief <i> [Deprecated] </i>
139 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
142 * @return An error code
143 * @exception E_SUCCESS The method is successful.
144 * @exception E_SYSTEM A system error has occurred.
145 * @exception E_OUT_OF_MEMORY The memory is insufficient.
148 result Construct(void);
152 * Gets the current badge number of the application icon.
154 * @brief <i> [Deprecated] </i>
156 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
158 * @privilege %http://tizen.org/privilege/notification
160 * @return The current badge number, @n
161 * else @c -1 if it fails
162 * @exception E_SUCCESS The method is successful.
163 * @exception E_SYSTEM A system error has occurred.
164 * @exception E_OBJ_NOT_FOUND The application has not been installed.
165 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
166 * @remarks The specific error code can be accessed using the GetLastResult() method.
169 int GetBadgeNumber(void);
173 * Notifies the user using a badge number.
175 * @brief <i> [Deprecated] </i>
177 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
179 * @privilege %http://tizen.org/privilege/notification
181 * @return An error code
182 * @param[in] badgeNumber The badge number
183 * @exception E_SUCCESS The method is successful.
184 * @exception E_INVALID_ARG Either of the following conditions has occurred:
185 * - The specified input parameter is invalid.
186 * - The specified @c badgeNumber is less than @c 0.
187 * @exception E_SYSTEM A system error has occurred.
188 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
189 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
192 result Notify(int badgeNumber);
196 * Notifies the user using a message.
198 * @brief <i> [Deprecated] </i>
200 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
202 * @privilege %http://tizen.org/privilege/notification
204 * @return An error code
205 * @param[in] messageText The notification message
206 * @exception E_SUCCESS The method is successful.
207 * @exception E_INVALID_ARG Either of the following conditions has occurred:
208 * - The specified input parameter is invalid.
209 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
210 * @exception E_SYSTEM A system error has occurred.
211 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
212 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
215 result Notify(const Tizen::Base::String& messageText);
219 * Notifies the user using a message and a badge number.
221 * @brief <i> [Deprecated] </i>
223 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
225 * @privilege %http://tizen.org/privilege/notification
227 * @return An error code
228 * @param[in] messageText The notification message
229 * @param[in] badgeNumber The badge number
230 * @exception E_SUCCESS The method is successful.
231 * @exception E_INVALID_ARG Either of the following conditions has occurred:
232 * - The specified @c badgeNumber is less than @c 0.
233 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
234 * @exception E_SYSTEM A system error has occurred.
235 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
236 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
239 result Notify(const Tizen::Base::String& messageText, int badgeNumber);
243 * Notifies the user using a message and a badge number. @n
244 * If the user checks the message, @c launchArguments is delivered to the application. @n
245 * @c launchArguments is delivered as the value of the %http://tizen.org/appcontrol/data/notification key
246 * for the IAppControlProviderEventListener::OnAppControlRequestReceived() method.
248 * @brief <i> [Deprecated] </i>
250 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
252 * @privilege %http://tizen.org/privilege/notification
254 * @return An error code
255 * @param[in] messageText The notification message
256 * @param[in] badgeNumber The badge number
257 * @param[in] launchArguments The message for the application
258 * @exception E_SUCCESS The method is successful.
259 * @exception E_INVALID_ARG Either of the following conditions has occurred:
260 * - A specified input parameter is invalid.
261 * - The specified @c badgeNumber is less than @c 0.
262 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
263 * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
264 * @exception E_SYSTEM A system error has occurred.
265 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
266 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
269 result Notify(const Tizen::Base::String& messageText, int badgeNumber, const Tizen::Base::String& launchArguments);
273 * Removes the notification message.
275 * @brief <i> [Deprecated] </i>
277 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
279 * @privilege %http://tizen.org/privilege/notification
281 * @return An error code
282 * @exception E_SUCCESS The method is successful.
283 * @exception E_SYSTEM A system error has occurred.
284 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
285 * @remarks This method returns @c E_SUCCESS when there is no outstanding notification.
288 result RemoveNotification(void);
292 * Notifies the user about the ongoing activity using a message.
294 * @brief <i> [Deprecated] </i>
296 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
298 * @privilege %http://tizen.org/privilege/notification
300 * @return An error code
301 * @param[in] messageText The notification message
302 * @exception E_SUCCESS The method is successful.
303 * @exception E_INVALID_ARG Either of the following conditions has occurred:
304 * - The specified input parameter is invalid.
305 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
306 * @exception E_SYSTEM A system error has occurred.
307 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
308 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
311 result NotifyOngoingActivity(const Tizen::Base::String& messageText);
315 * Notifies the user about the ongoing activity using a message. @n
316 * @c launchArguments is delivered as the value of the %http://tizen.org/appcontrol/data/notification key
317 * for the IAppControlProviderEventListener::OnAppControlRequestReceived() method.
319 * @brief <i> [Deprecated] </i>
321 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
323 * @privilege %http://tizen.org/privilege/notification
325 * @return An error code
326 * @param[in] messageText The notification message
327 * @param[in] launchArguments The launch arguments for the application
328 * @exception E_SUCCESS The method is successful.
329 * @exception E_INVALID_ARG Either of the following conditions has occurred:
330 * - A specified input parameter is invalid.
331 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
332 * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
333 * @exception E_SYSTEM A system error has occurred.
334 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
335 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
338 result NotifyOngoingActivity(const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments);
342 * Removes the notification message for the ongoing activity.
344 * @brief <i> [Deprecated] </i>
346 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
348 * @privilege %http://tizen.org/privilege/notification
350 * @return An error code
351 * @exception E_SUCCESS The method is successful.
352 * @exception E_SYSTEM A system error has occurred.
353 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
354 * @remarks This method returns @c E_SUCCESS when there is no outstanding notification.
357 result RemoveOngoingActivityNotification(void);
361 * Gets the badge number of the application icon.
363 * @brief <i> [Deprecated] </i>
365 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
367 * @privilege %http://tizen.org/privilege/notification
369 * @return The current badge number, @n
370 * else @c -1 if it fails
371 * @param[in] appId The application ID
372 * @exception E_SUCCESS The method is successful.
373 * @exception E_SYSTEM A system error has occurred.
374 * @exception E_OBJ_NOT_FOUND The application has not been installed.
375 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
376 * @remarks The specific error code can be accessed using the GetLastResult() method.
379 int GetBadgeNumber(const AppId& appId);
383 * Notifies the user using a badge number on behalf of the specified application.
385 * @brief <i> [Deprecated] </i>
387 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
391 * @privilege %http://tizen.org/privilege/notification @n
392 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
394 * @return An error code
395 * @param[in] appId The application ID
396 * @param[in] badgeNumber The badge number
397 * @exception E_SUCCESS The method is successful.
398 * @exception E_INVALID_ARG Either of the following conditions has occurred:
399 * - A specified input parameter is invalid.
400 * - The specified @c badgeNumber is less than @c 0.
401 * @exception E_APP_NOT_INSTALLED The application has not been installed.
402 * @exception E_INVALID_OPERATION The target application with the specified @c appId is not permitted to receive any notification as per the Tizen platform policy.
403 * @exception E_SYSTEM A system error has occurred.
404 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
407 result NotifyOnBehalf(const AppId& appId, int badgeNumber);
411 * Notifies the user using a message on behalf of the specified application.
413 * @brief <i> [Deprecated] </i>
415 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
419 * @privilege %http://tizen.org/privilege/notification @n
420 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
422 * @return An error code
423 * @param[in] appId The application ID
424 * @param[in] messageText The notification message
425 * @exception E_SUCCESS The method is successful.
426 * @exception E_INVALID_ARG Either of the following conditions has occurred:
427 * - A specified input parameter is invalid.
428 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
429 * @exception E_APP_NOT_INSTALLED The application has not been installed.
430 * @exception E_INVALID_OPERATION The target application with the specified @c appId is not permitted to receive any notification as per the Tizen platform policy.
431 * @exception E_SYSTEM A system error has occurred.
432 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
435 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText);
439 * Notifies the user using a message and a badge number on behalf of the specified application.
441 * @brief <i> [Deprecated] </i>
443 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
447 * @privilege %http://tizen.org/privilege/notification @n
448 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
450 * @return An error code
451 * @param[in] appId The application ID
452 * @param[in] messageText The notification message
453 * @param[in] badgeNumber The badge number
454 * @exception E_SUCCESS The method is successful.
455 * @exception E_INVALID_ARG Either of the following conditions has occurred:
456 * - A specified input parameter is invalid.
457 * - The specified @c badgeNumber is less than @c 0.
458 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
459 * @exception E_APP_NOT_INSTALLED The application has not been installed.
460 * @exception E_INVALID_OPERATION The target application with the specified @c appId is not permitted to receive any notification as per the Tizen platform policy.
461 * @exception E_SYSTEM A system error has occurred.
462 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
465 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, int badgeNumber);
469 * Notifies the user using a message and a badge number on behalf of the specified application. @n
470 * If the user checks the message, @c launchArguments is delivered to the application.
472 * @brief <i> [Deprecated] </i>
474 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
478 * @privilege %http://tizen.org/privilege/notification @n
479 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
481 * @return An error code
482 * @param[in] appId The application ID
483 * @param[in] messageText The notification message
484 * @param[in] launchArguments The launch arguments for the application
485 * @exception E_SUCCESS The method is successful.
486 * @exception E_INVALID_ARG Either of the following conditions has occurred:
487 * - A specified input parameter is invalid.
488 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
489 * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
490 * @exception E_APP_NOT_INSTALLED The application has not been installed.
491 * @exception E_INVALID_OPERATION The target application with the specified @c appId is not permitted to receive any notification as per the Tizen platform policy.
492 * @exception E_SYSTEM A system error has occurred.
493 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
496 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments);
500 * Notifies the user about the ongoing activity using a message on behalf of the specified application.
502 * @brief <i> [Deprecated] </i>
504 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
508 * @privilege %http://tizen.org/privilege/notification @n
509 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
511 * @return An error code
512 * @param[in] appId The application ID
513 * @param[in] messageText The notification message
514 * @exception E_SUCCESS The method is successful.
515 * @exception E_INVALID_ARG Either of the following conditions has occurred:
516 * - The specified input parameter is invalid.
517 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
518 * @exception E_APP_NOT_INSTALLED The application has not been installed.
519 * @exception E_SYSTEM A system error has occurred.
520 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
521 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
524 result NotifyOngoingActivityOnBehalf(const AppId& appId, const Tizen::Base::String& messageText);
528 * Notifies the user about the ongoing activity using a message on behalf of the specified application.
530 * @brief <i> [Deprecated] </i>
532 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
536 * @privilege %http://tizen.org/privilege/notification @n
537 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
539 * @return An error code
540 * @param[in] appId The application ID
541 * @param[in] messageText The notification message
542 * @param[in] launchArguments The launch arguments for the application
543 * @exception E_SUCCESS The method is successful.
544 * @exception E_INVALID_ARG Either of the following conditions has occurred:
545 * - A specified input parameter is invalid.
546 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
547 * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
548 * @exception E_APP_NOT_INSTALLED The application has not been installed.
549 * @exception E_SYSTEM A system error has occurred.
550 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
551 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
554 result NotifyOngoingActivityOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments);
558 * Removes the notification message for the ongoing activity on behalf of the specified application.
560 * @brief <i> [Deprecated] </i>
562 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
566 * @privilege %http://tizen.org/privilege/notification @n
567 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
569 * @return An error code
570 * @param[in] appId The application ID
571 * @exception E_SUCCESS The method is successful.
572 * @exception E_APP_NOT_INSTALLED The application has not been installed.
573 * @exception E_SYSTEM A system error has occurred.
574 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
575 * @remarks Even if there is no outstanding notification for the calling application, this method returns @c E_SUCCESS.
578 result RemoveOngoingActivityNotificationOnBehalf(const AppId& appId);
582 * Removes the notification message on behalf of the specified application.
584 * @brief <i> [Deprecated] </i>
586 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
590 * @privilege %http://tizen.org/privilege/notification @n
591 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
593 * @return An error code
594 * @param[in] appId The application ID
595 * @exception E_SUCCESS The method is successful.
596 * @exception E_APP_NOT_INSTALLED The application has not been installed.
597 * @exception E_SYSTEM A system error has occurred.
598 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
599 * @remarks Even if there is no outstanding notification for the calling application, this method returns @c E_SUCCESS.
602 result RemoveNotificationOnBehalf(const AppId& appId);
606 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
610 NotificationManager(const NotificationManager& rhs);
613 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
617 NotificationManager& operator =(const NotificationManager& rhs);
620 class _NotificationManagerImpl * __pNotificationManagerImpl;
622 friend class _NotificationManagerImpl;
623 }; // NotificationManager
627 #endif // _FAPP_NOTIFICATION_MANAGER_H_