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 The 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
389 * @return An error code
390 * @param[in] appId The application ID
391 * @param[in] badgeNumber The badge number
392 * @exception E_SUCCESS The method is successful.
393 * @exception E_INVALID_ARG A specified input parameter is invalid, or
394 * the specified @c badgeNumber is less than @c 0.
395 * @exception E_APP_NOT_INSTALLED The application is not installed.
396 * @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.
397 * @exception E_SYSTEM A system error has occurred.
398 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
401 result NotifyOnBehalf(const AppId& appId, int badgeNumber);
405 * Notifies the user using a message on behalf of the specified application.
407 * @brief <i> [Deprecated] </i>
409 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
413 * @privilege http://tizen.org/privilege/notification
415 * @return An error code
416 * @param[in] appId The application ID
417 * @param[in] messageText The notification message
418 * @exception E_SUCCESS The method is successful.
419 * @exception E_INVALID_ARG A specified input parameter is invalid, or
420 * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
421 * @exception E_APP_NOT_INSTALLED The application is not installed.
422 * @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.
423 * @exception E_SYSTEM A system error has occurred.
424 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
427 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText);
431 * Notifies the user using a message and badge number on behalf of the specified application.
433 * @brief <i> [Deprecated] </i>
435 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
439 * @privilege http://tizen.org/privilege/notification
441 * @return An error code
442 * @param[in] appId The application ID
443 * @param[in] messageText The notification message
444 * @param[in] badgeNumber The badge number
445 * @exception E_SUCCESS The method is successful.
446 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
447 * - A specified input parameter is invalid. @n
448 * - The specified @c badgeNumber is less than @c 0. @n
449 * - The length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
450 * @exception E_APP_NOT_INSTALLED The application is not installed.
451 * @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.
452 * @exception E_SYSTEM A system error has occurred.
453 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
456 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, int badgeNumber);
460 * Notifies the user using a message and badge number on behalf of the specified application. @n
461 * If the user checks the message, the @c launchArguments is delivered to the application.
463 * @brief <i> [Deprecated] </i>
465 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
469 * @privilege http://tizen.org/privilege/notification
471 * @return An error code
472 * @param[in] appId The application ID
473 * @param[in] messageText The notification message
474 * @param[in] launchArguments The launch arguments for the application
475 * @exception E_SUCCESS The method is successful.
476 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
477 * - A specified input parameter is invalid. @n
478 * - The length of the specified @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
479 * - The length of the specified @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
480 * @exception E_APP_NOT_INSTALLED The application is not installed.
481 * @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.
482 * @exception E_SYSTEM A system error has occurred.
483 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
486 result NotifyOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments);
490 * Notifies the user about the ongoing activity using a message on behalf of the specified application.
492 * @brief <i> [Deprecated] </i>
494 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
498 * @privilege http://tizen.org/privilege/notification
500 * @return An error code
501 * @param[in] appId The application ID
502 * @param[in] messageText The notification message
503 * @exception E_SUCCESS The method is successful.
504 * @exception E_INVALID_ARG The specified input parameter is invalid, or
505 * the length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH.
506 * @exception E_APP_NOT_INSTALLED The application is not installed.
507 * @exception E_SYSTEM A system error has occurred.
508 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the %Tizen platform policy.
509 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
512 result NotifyOngoingActivityOnBehalf(const AppId& appId, const Tizen::Base::String& messageText);
516 * Notifies the user about the ongoing activity using a message on behalf of the specified application.
518 * @brief <i> [Deprecated] </i>
520 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
524 * @privilege http://tizen.org/privilege/notification
526 * @return An error code
527 * @param[in] appId The application ID
528 * @param[in] messageText The notification message
529 * @param[in] launchArguments The launch arguments for application
530 * @exception E_SUCCESS The method is successful.
531 * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
532 * - A specified input parameter is invalid. @n
533 * - The length of @c messageText is greater than App::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
534 * - The length of @c launchArguments is greater than App::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
535 * @exception E_APP_NOT_INSTALLED The application is not installed.
536 * @exception E_SYSTEM A system error has occurred.
537 * @exception E_INVALID_OPERATION The type of application calling this method is invalid as per the %Tizen platform policy.
538 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
541 result NotifyOngoingActivityOnBehalf(const AppId& appId, const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments);
545 * Removes the notification message for ongoing activity on behalf of the specified application.
547 * @brief <i> [Deprecated] </i>
549 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
553 * @privilege http://tizen.org/privilege/notification
555 * @return An error code
556 * @param[in] appId The application ID
557 * @exception E_SUCCESS The method is successful.
558 * @exception E_APP_NOT_INSTALLED The application is not installed.
559 * @exception E_SYSTEM A system error has occurred.
560 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
561 * @remarks Although there is no outstanding notification for the calling application, this method returns @c E_SUCCESS.
564 result RemoveOngoingActivityNotificationOnBehalf(const AppId& appId);
568 * Removes the notification message on behalf of the specified application.
570 * @brief <i> [Deprecated] </i>
572 * @deprecated This class is deprecated. Instead of using this class, use the Tizen::Shell::NotificationManager class.
576 * @privilege http://tizen.org/privilege/notification
578 * @return An error code
579 * @param[in] appId The application ID
580 * @exception E_SUCCESS The method is successful.
581 * @exception E_APP_NOT_INSTALLED The application is not installed.
582 * @exception E_SYSTEM A system error has occurred.
583 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
584 * @remarks Although there is no outstanding notification for the calling application, this method returns @c E_SUCCESS.
587 result RemoveNotificationOnBehalf(const AppId& appId);
591 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
595 NotificationManager(const NotificationManager& rhs);
598 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
602 NotificationManager& operator =(const NotificationManager& rhs);
605 class _NotificationManagerImpl * __pNotificationManagerImpl;
607 friend class _NotificationManagerImpl;
608 }; // NotificationManager
612 #endif // _FAPP_NOTIFICATION_MANAGER_H_