2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 FAppNotificationManager.h
20 * @brief This is the header file for the %NotificationManager class.
22 * This header file contains the declarations of the %NotificationManager class.
25 #ifndef _FAPP_NOTIFICATION_MANAGER_H_
26 #define _FAPP_NOTIFICATION_MANAGER_H_
29 #include <FAppTypes.h>
31 namespace Tizen { namespace App
36 * The maximum length of the notification message.
38 * @brief <i> [Deprecated] </i>
40 * @deprecated This variable is deprecated. Instead of using this variable, use the Tizen::Shell::MAX_NOTIFICATION_MESSAGE_LENGTH variable.
44 static const int MAX_NOTIFICATION_MESSAGE_LENGTH = 127;
48 * The maximum length of the launch arguments for the notification in bytes.
50 * @brief <i> [Deprecated] </i>
52 * @deprecated This variable is deprecated. Instead of using this variable, use the Tizen::Shell::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH variable.
56 static const int MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH = 1024;
60 * The maximum length of the notification badge number.
62 * @brief <i> [Deprecated] </i>
64 * @deprecated This variable is deprecated. Instead of using this variable, use the Tizen::Shell::MAX_NOTIFICATION_BADGE_NUMBER variable.
68 static const int MAX_NOTIFICATION_BADGE_NUMBER = 999;
72 * @class NotificationManager
73 * @brief <i> [Deprecated] </i> This class provides methods to alert the user about a notification.
75 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
78 * @final This class is not intended for extension.
80 * The %NotificationManager class provides methods to alert the user about a notification.
82 * For more information about the class features, see <a href="../org.tizen.native.appprogramming/html/guide/app/notifications.htm">Notifications</a>.
84 * The following example demonstrates how to use the %NotificationManager class.
89 * MyClass::NotificationSample(void)
92 * NotificationManager* pNotiMgr = new NotificationManager();
93 * pNotiMgr->Construct();
94 * badgeNumber = pNotiMgr->GetBadgeNumber();
96 * pNotiMgr->Notify(L"A new message has arrived.", badgeNumber);
103 class _OSP_EXPORT_ NotificationManager
104 : public Tizen::Base::Object
110 * This is the default constructor for this class.
112 * @brief <i> [Deprecated] </i>
114 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
118 NotificationManager(void);
122 * This destructor overrides Tizen::Base::Object::~Object().
124 * @brief <i> [Deprecated] </i>
126 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
130 virtual ~NotificationManager(void);
134 * Initializes this instance of %NotificationManager.
136 * @brief <i> [Deprecated] </i>
138 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
141 * @return An error code
142 * @exception E_SUCCESS The method is successful.
143 * @exception E_SYSTEM A system error has occurred.
144 * @exception E_OUT_OF_MEMORY The memory is insufficient.
147 result Construct(void);
151 * Gets the current badge number of the application icon.
153 * @brief <i> [Deprecated] </i>
155 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
157 * @privilege %http://tizen.org/privilege/notification
159 * @return The current badge number
160 * @exception E_SUCCESS The method is successful.
161 * @exception E_SYSTEM A system error has occurred.
162 * @exception E_OBJ_NOT_FOUND The application is not installed.
163 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
164 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
165 * In case of failure, this method returns @c -1.
168 int GetBadgeNumber(void);
172 * Notifies the user using a badge number.
174 * @brief <i> [Deprecated] </i>
176 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
178 * @privilege %http://tizen.org/privilege/notification
180 * @return An error code
181 * @param[in] badgeNumber The badge number
182 * @exception E_SUCCESS The method is successful.
183 * @exception E_INVALID_ARG The specified input parameter is invalid, or
184 * the specified @c badgeNumber is less than @c 0.
185 * @exception E_SYSTEM A system error has occurred.
186 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the %Tizen platform policy.
187 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
190 result Notify(int badgeNumber);
194 * Notifies the user using a message.
196 * @brief <i> [Deprecated] </i>
198 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
200 * @privilege %http://tizen.org/privilege/notification
202 * @return An error code
203 * @param[in] messageText The notification message
204 * @exception E_SUCCESS The method is successful.
205 * @exception E_INVALID_ARG The specified input parameter is invalid, or
206 * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
207 * @exception E_SYSTEM A system error has occurred.
208 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the %Tizen platform policy.
209 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
212 result Notify(const Tizen::Base::String& messageText);
216 * Notifies the user using a message and badge number.
218 * @brief <i> [Deprecated] </i>
220 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
222 * @privilege %http://tizen.org/privilege/notification
224 * @return An error code
225 * @param[in] messageText The notification message
226 * @param[in] badgeNumber The badge number
227 * @exception E_SUCCESS The method is successful.
228 * @exception E_INVALID_ARG The specified @c badgeNumber is less than @c 0, or
229 * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
230 * @exception E_SYSTEM A system error has occurred.
231 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the %Tizen platform policy.
232 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
235 result Notify(const Tizen::Base::String& messageText, int badgeNumber);
239 * Notifies the user using a message and badge number. @n
240 * If the user checks the message, @c launchArguments is delivered to the application. @n
241 * @c launchArguments is delivered as the value of the http://tizen.org/appcontrol/data/notification key
242 * for IAppControlProviderEventListener::OnAppControlRequestReceived().
244 * @brief <i> [Deprecated] </i>
246 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
248 * @privilege %http://tizen.org/privilege/notification
250 * @return An error code
251 * @param[in] messageText The notification message
252 * @param[in] badgeNumber The badge number
253 * @param[in] launchArguments The message for application
254 * @exception E_SUCCESS The method is successful.
255 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
256 * - A specified input parameter is invalid. @n
257 * - The specified @c badgeNumber is less than @c 0. @n
258 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
259 * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
260 * @exception E_SYSTEM A system error has occurred.
261 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the %Tizen platform policy.
262 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
263 * @see IAppControlProviderEventListener::OnAppControlRequestReceived()
266 result Notify(const Tizen::Base::String& messageText, int badgeNumber, const Tizen::Base::String& launchArguments);
270 * Removes the notification message.
272 * @brief <i> [Deprecated] </i>
274 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
276 * @privilege %http://tizen.org/privilege/notification
278 * @return An error code
279 * @exception E_SUCCESS The method is successful.
280 * @exception E_SYSTEM A system error has occurred.
281 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
282 * @remarks This method returns @c E_SUCCESS when there is no outstanding notification.
285 result RemoveNotification(void);
289 * Notifies the user about the ongoing activity using a message.
291 * @brief <i> [Deprecated] </i>
293 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
295 * @privilege %http://tizen.org/privilege/notification
297 * @return An error code
298 * @param[in] messageText The notification message
299 * @exception E_SUCCESS The method is successful.
300 * @exception E_INVALID_ARG The specified input parameter is invalid, or
301 * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
302 * @exception E_SYSTEM A system error has occurred.
303 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the %Tizen platform policy.
304 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
307 result NotifyOngoingActivity(const Tizen::Base::String& messageText);
311 * Notifies the user about the ongoing activity using a message. @n
312 * @c launchArguments is delivered as the value of the http://tizen.org/appcontrol/data/notification key
313 * for IAppControlProviderEventListener::OnAppControlRequestReceived().
315 * @brief <i> [Deprecated] </i>
317 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
319 * @privilege %http://tizen.org/privilege/notification
321 * @return An error code
322 * @param[in] messageText The notification message
323 * @param[in] launchArguments The launch arguments for the application
324 * @exception E_SUCCESS The method is successful.
325 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
326 * - A specified input parameter is invalid. @n
327 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
328 * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
329 * @exception E_SYSTEM A system error has occurred.
330 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the %Tizen platform policy.
331 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
334 result NotifyOngoingActivity(const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments);
338 * Removes the notification message for the ongoing activity.
340 * @brief <i> [Deprecated] </i>
342 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
344 * @privilege %http://tizen.org/privilege/notification
346 * @return An error code
347 * @exception E_SUCCESS The method is successful.
348 * @exception E_SYSTEM A system error has occurred.
349 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
350 * @remarks This method returns @c E_SUCCESS when there is no outstanding notification.
353 result RemoveOngoingActivityNotification(void);
357 * Gets the badge number of the application icon.
359 * @brief <i> [Deprecated] </i>
361 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
363 * @privilege %http://tizen.org/privilege/notification
365 * @return The current badge number
366 * @param[in] appId The application ID
367 * @exception E_SUCCESS The method is successful.
368 * @exception E_SYSTEM A system error has occurred.
369 * @exception E_OBJ_NOT_FOUND The application is not installed.
370 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
371 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
372 * In case of failure, this method returns @c -1.
375 int GetBadgeNumber(const AppId& appId);
379 * Notifies the user using a badge number on behalf of the specified application.
381 * @brief <i> [Deprecated] </i>
383 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
387 * @privilege %http://tizen.org/privilege/notification @n
388 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
390 * @return An error code
391 * @param[in] appId The application ID
392 * @param[in] badgeNumber The badge number
393 * @exception E_SUCCESS The method is successful.
394 * @exception E_INVALID_ARG A specified input parameter is invalid, or
395 * the specified @c badgeNumber is less than @c 0.
396 * @exception E_APP_NOT_INSTALLED The application is not installed.
397 * @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.
398 * @exception E_SYSTEM A system error has occurred.
399 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
402 result NotifyOnBehalf(const AppId& appId, int badgeNumber);
406 * Notifies the user using a message on behalf of the specified application.
408 * @brief <i> [Deprecated] </i>
410 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
414 * @privilege %http://tizen.org/privilege/notification @n
415 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
417 * @return An error code
418 * @param[in] appId The application ID
419 * @param[in] messageText The notification message
420 * @exception E_SUCCESS The method is successful.
421 * @exception E_INVALID_ARG A specified input parameter is invalid, or
422 * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
423 * @exception E_APP_NOT_INSTALLED The application is not installed.
424 * @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.
425 * @exception E_SYSTEM A system error has occurred.
426 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
429 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText);
433 * Notifies the user using a message and badge number on behalf of the specified application.
435 * @brief <i> [Deprecated] </i>
437 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
441 * @privilege %http://tizen.org/privilege/notification @n
442 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
444 * @return An error code
445 * @param[in] appId The application ID
446 * @param[in] messageText The notification message
447 * @param[in] badgeNumber The badge number
448 * @exception E_SUCCESS The method is successful.
449 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
450 * - A specified input parameter is invalid. @n
451 * - The specified @c badgeNumber is less than @c 0. @n
452 * - The length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
453 * @exception E_APP_NOT_INSTALLED The application is not installed.
454 * @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.
455 * @exception E_SYSTEM A system error has occurred.
456 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
459 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, int badgeNumber);
463 * Notifies the user using a message and badge number on behalf of the specified application. @n
464 * If the user checks the message, the @c launchArguments is delivered to the application.
466 * @brief <i> [Deprecated] </i>
468 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
472 * @privilege %http://tizen.org/privilege/notification @n
473 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
475 * @return An error code
476 * @param[in] appId The application ID
477 * @param[in] messageText The notification message
478 * @param[in] launchArguments The launch arguments for the application
479 * @exception E_SUCCESS The method is successful.
480 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
481 * - A specified input parameter is invalid. @n
482 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
483 * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
484 * @exception E_APP_NOT_INSTALLED The application is not installed.
485 * @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.
486 * @exception E_SYSTEM A system error has occurred.
487 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
490 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments);
494 * Notifies the user about the ongoing activity using a message on behalf of the specified application.
496 * @brief <i> [Deprecated] </i>
498 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
502 * @privilege %http://tizen.org/privilege/notification @n
503 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
505 * @return An error code
506 * @param[in] appId The application ID
507 * @param[in] messageText The notification message
508 * @exception E_SUCCESS The method is successful.
509 * @exception E_INVALID_ARG The specified input parameter is invalid, or
510 * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
511 * @exception E_APP_NOT_INSTALLED The application is not installed.
512 * @exception E_SYSTEM A system error has occurred.
513 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the %Tizen platform policy.
514 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
517 result NotifyOngoingActivityOnBehalf(const AppId& appId, const Tizen::Base::String& messageText);
521 * Notifies the user about the ongoing activity using a message on behalf of the specified application.
523 * @brief <i> [Deprecated] </i>
525 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
529 * @privilege %http://tizen.org/privilege/notification @n
530 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
532 * @return An error code
533 * @param[in] appId The application ID
534 * @param[in] messageText The notification message
535 * @param[in] launchArguments The launch arguments for application
536 * @exception E_SUCCESS The method is successful.
537 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
538 * - A specified input parameter is invalid. @n
539 * - The length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
540 * - The length of @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
541 * @exception E_APP_NOT_INSTALLED The application is not installed.
542 * @exception E_SYSTEM A system error has occurred.
543 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the %Tizen platform policy.
544 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
547 result NotifyOngoingActivityOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments);
551 * Removes the notification message for the ongoing activity on behalf of the specified application.
553 * @brief <i> [Deprecated] </i>
555 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
559 * @privilege %http://tizen.org/privilege/notification @n
560 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
562 * @return An error code
563 * @param[in] appId The application ID
564 * @exception E_SUCCESS The method is successful.
565 * @exception E_APP_NOT_INSTALLED The application is not installed.
566 * @exception E_SYSTEM A system error has occurred.
567 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
568 * @remarks Although there is no outstanding notification for the calling application, this method returns @c E_SUCCESS.
571 result RemoveOngoingActivityNotificationOnBehalf(const AppId& appId);
575 * Removes the notification message on behalf of the specified application.
577 * @brief <i> [Deprecated] </i>
579 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
583 * @privilege %http://tizen.org/privilege/notification @n
584 * (%http://tizen.org/privilege/notificationmanager is deprecated.)
586 * @return An error code
587 * @param[in] appId The application ID
588 * @exception E_SUCCESS The method is successful.
589 * @exception E_APP_NOT_INSTALLED The application is not installed.
590 * @exception E_SYSTEM A system error has occurred.
591 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
592 * @remarks Although there is no outstanding notification for the calling application, this method returns @c E_SUCCESS.
595 result RemoveNotificationOnBehalf(const AppId& appId);
599 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
603 NotificationManager(const NotificationManager& rhs);
606 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
610 NotificationManager& operator =(const NotificationManager& rhs);
613 class _NotificationManagerImpl * __pNotificationManagerImpl;
615 friend class _NotificationManagerImpl;
616 }; // NotificationManager
620 #endif // _FAPP_NOTIFICATION_MANAGER_H_