2 * Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
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.
17 #ifndef __NOTIFICATION_H__
18 #define __NOTIFICATION_H__
24 #include <notification_error.h>
25 #include <notification_type.h>
26 #include <notification_status.h>
33 * @file notification.h
34 * @brief This file contains the notification API.
38 * @addtogroup NOTIFICATION_MODULE
43 * @brief Sets an absolute path for an image file to display on the notification view.
44 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
45 * @param[in] noti The notification handle
46 * @param[in] type The notification image type
47 * @param[in] image_path The image file full path
48 * @return #NOTIFICATION_ERROR_NONE on success,
49 * otherwise any other value on failure
50 * @retval #NOTIFICATION_ERROR_NONE Success
51 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
52 * @pre Notification handle should be created by notification_create().
53 * @see #notification_image_type_e
54 * @see notification_create()
57 #include <notification.h>
60 notification_h noti = NULL;
61 int noti_err = NOTIFICATION_ERROR_NONE;
63 noti = notification_create(NOTIFICATION_TYPE_NOTI);
68 noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, APP_IMAGE_FULL_PATH);
69 if (noti_err != NOTIFICATION_ERROR_NONE) {
70 notification_free(noti);
76 int notification_set_image(notification_h noti, notification_image_type_e type,
77 const char *image_path);
80 * @brief Gets the absolute path of an image file.
81 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
82 * @remarks Do not free @a image_path. It will be freed when notification_free() is called.
83 * @param[in] noti Notification handle
84 * @param[in] type Notification image type
85 * @param[out] image_path image file full path
86 * @return NOTIFICATION_ERROR_NONE on success, other value on failure
87 * @retval NOTIFICATION_ERROR_NONE Success
88 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
89 * @pre Notification handle should be created by notification_create().
90 * @see #notification_image_type_e
91 * @see notification_create()
94 #include <notification.h>
97 char *image_path = NULL;
98 int noti_err = NOTIFICATION_ERROR_NONE;
100 noti_err = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &image_path);
101 if (noti_err != NOTIFICATION_ERROR_NONE) {
107 int notification_get_image(notification_h noti, notification_image_type_e type,
111 * @brief Sets a timestamp.
112 * @details If input_time is @c 0, time information is taken from the current time.
113 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
114 * @param[in] noti The notification handle
115 * @param[in] input_time The input time. If you want the time stamp is not be shown, set this as NOTIFICATION_DO_NOT_SHOW_TIME_STAMP
116 * @return #NOTIFICATION_ERROR_NONE on success,
117 * otherwise any other value on failure
118 * @retval #NOTIFICATION_ERROR_NONE Success
119 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
120 * @pre Notification handle should be created by notification_create().
121 * @see notification_create()
122 * @see NOTIFICATION_DO_NOT_SHOW_TIME_STAMP
125 #include <notification.h>
128 notification_h noti = NULL;
129 int noti_err = NOTIFICATION_ERROR_NONE;
131 noti = notification_create(NOTIFICATION_TYPE_NOTI);
136 noti_err = notification_set_time(noti, time(NULL));
137 if (noti_err != NOTIFICATION_ERROR_NONE) {
138 notification_free(noti);
144 int notification_set_time(notification_h noti, time_t input_time);
147 * @brief Gets a timestamp.
148 * @details If ret_time is @c 0, time information is not set before.
149 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
150 * @param[in] noti The notification handle
151 * @param[out] ret_time The return time value
152 * @return #NOTIFICATION_ERROR_NONE on success,
153 * otherwise any other value on failure
154 * @retval #NOTIFICATION_ERROR_NONE Success
155 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
156 * @pre Notification handle should be created by notification_create().
157 * @see notification_create()
160 #include <notification.h>
164 int noti_err = NOTIFICATION_ERROR_NONE;
166 noti_err = notification_get_time(noti, &ret_time);
167 if (noti_err != NOTIFICATION_ERROR_NONE) {
173 int notification_get_time(notification_h noti, time_t *ret_time);
176 * @brief Gets an insertion timestamp of the notification.
177 * @details If ret_time is @c 0, this notification data is not inserted before.
178 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
179 * @param[in] noti The notification handle
180 * @param[out] ret_time The return time value
181 * @return #NOTIFICATION_ERROR_NONE on success,
182 * otherwise any other value on failure
183 * @retval #NOTIFICATION_ERROR_NONE Success
184 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
187 #include <notification.h>
191 int noti_err = NOTIFICATION_ERROR_NONE;
193 noti_err = notification_get_insert_time(noti, &ret_time);
194 if (noti_err != NOTIFICATION_ERROR_NONE) {
200 int notification_get_insert_time(notification_h noti, time_t *ret_time);
203 * @brief Sets the text to display on the notification view.
204 * @details Sets title, content string. If the text is formatted data (only %d, %f, %s are supported), type - value pair should be set.
205 * If %d, the type #NOTIFICATION_VARIABLE_TYPE_INT and the value is an integer.
206 * If %f, the type #NOTIFICATION_VARIABLE_TYPE_DOUBLE and the value is a double.
207 * If %s, the type #NOTIFICATION_VARIABLE_TYPE_STRING and the value is a string.
208 * If the type is #NOTIFICATION_VARIABLE_TYPE_COUNT, notification count is displaying with text.
209 * If the value is #NOTIFICATION_COUNT_POS_LEFT, count is displayed at the left of the text.
210 * If the value is #NOTIFICATION_COUNT_POS_IN, count is displayed in the text when text has %d format.
211 * If the value is #NOTIFICATION_COUNT_POS_RIGHT, count is displayed at the right of the text.
212 * Variable parameters should be terminated #NOTIFICATION_VARIABLE_TYPE_NONE.
213 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
214 * @param[in] noti The notification handle
215 * @param[in] type The notification text type
216 * @param[in] text The basic text
217 * @param[in] key The text key for localization
218 * @param[in] args_type The variable parameter that type - value pair
219 * @return #NOTIFICATION_ERROR_NONE on success,
220 * otherwise any other value on failure
221 * @retval #NOTIFICATION_ERROR_NONE Success
222 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
223 * @pre notification handle should be created by notification_create().
226 #include <notification.h>
229 notification_h noti = NULL;
230 int noti_err = NOTIFICATION_ERROR_NONE;
232 noti = notification_create(NOTIFICATION_TYPE_NOTI);
237 noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, "I'm Title", "IDS_APP_BODY_IM_TITLE", NOTIFICATION_VARIABLE_TYPE_NONE);
238 if (noti_err != NOTIFICATION_ERROR_NONE) {
239 notification_free(noti);
245 int notification_set_text(notification_h noti, notification_text_type_e type,
246 const char *text, const char *key, int args_type, ...);
249 * @brief Gets the text from the notification handle.
250 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
251 * @param[in] noti The notification handle
252 * @param[in] type The notification text type
253 * @param[out] text The notification text
254 * @return #NOTIFICATION_ERROR_NONE on success,
255 * otherwise any other value on failure
256 * @retval #NOTIFICATION_ERROR_NONE Success
257 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
260 #include <notification.h>
263 notification_h noti = NULL;
264 int noti_err = NOTIFICATION_ERROR_NONE;
267 noti_err = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, &text);
268 if (noti_err != NOTIFICATION_ERROR_NONE) {
274 int notification_get_text(notification_h noti, notification_text_type_e type,
278 * @brief Sets the timestamp to display on the notification view.
279 * @details The timestamp will be converted to a formatted string and it will be displayed on the set text area.
280 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
281 * @param[in] noti The notification handle
282 * @param[in] type The notification text type
283 * @param[in] time The timestamp
284 * @return #NOTIFICATION_ERROR_NONE on success,
285 * otherwise any other value on failure
286 * @retval #NOTIFICATION_ERROR_NONE Success
287 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
288 * @pre Notification handle should be created by notification_create().
290 int notification_set_time_to_text(notification_h noti,
291 notification_text_type_e type, time_t time);
294 * @brief Gets the timestamp from the notification handle.
295 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
296 * @param[in] noti The notification handle
297 * @param[in] type The notification text type
298 * @param[in] time The pointer of time stamp
299 * @return #NOTIFICATION_ERROR_NONE on success,
300 * otherwise any other value on failure
301 * @retval #NOTIFICATION_ERROR_NONE Success
302 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
303 * @pre Notification handle should be created by notification_create().
305 int notification_get_time_from_text(notification_h noti,
306 notification_text_type_e type, time_t *time);
309 * @brief Sets the sound type for the notification.
310 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
311 * @param[in] noti The notification handle
312 * @param[in] type The notification sound type
313 * @param[in] path The user sound file path
314 * @return #NOTIFICATION_ERROR_NONE on success,
315 * otherwise any other value on failure
316 * @retval #NOTIFICATION_ERROR_NONE Success
317 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
320 #include <notification.h>
323 notification_h noti = NULL;
324 int noti_err = NOTIFICATION_ERROR_NONE;
326 noti_err = notification_set_sound(noti, NOTIFICATION_SOUND_TYPE_DEFAULT, NULL);
327 if (noti_err != NOTIFICATION_ERROR_NONE) {
333 int notification_set_sound(notification_h noti,
334 notification_sound_type_e type, const char *path);
337 * @brief Gets the sound type from the notification handle.
338 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
339 * @param[in] noti The notification handle
340 * @param[out] type The notification sound type
341 * @param[out] path The user sound file path
342 * @return #NOTIFICATION_ERROR_NONE on success,
343 * otherwise any other value on failure
344 * @retval #NOTIFICATION_ERROR_NONE Success
345 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
348 #include <notification.h>
351 notification_h noti = NULL;
352 int noti_err = NOTIFICATION_ERROR_NONE;
353 notification_sound_type_e type = NOTIFICATION_SOUND_TYPE_NONE;
355 noti_err = notification_get_sound(noti, &type, NULL);
356 if (noti_err != NOTIFICATION_ERROR_NONE) {
362 int notification_get_sound(notification_h noti,
363 notification_sound_type_e *type, const char **path);
366 * @brief Sets the vibration type for the notification.
367 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
368 * @param[in] noti The notification handle
369 * @param[in] type The notification vibration type
370 * @param[in] path The user vibration file path
371 * @return #NOTIFICATION_ERROR_NONE on success,
372 * otherwise any other value on failure
373 * @retval #NOTIFICATION_ERROR_NONE Success
374 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
377 #include <notification.h>
380 notification_h noti = NULL;
381 int noti_err = NOTIFICATION_ERROR_NONE;
383 noti_err = notification_set_vibration(noti, NOTIFICATION_VIBRATION_TYPE_DEFAULT, NULL);
384 if (noti_err != NOTIFICATION_ERROR_NONE) {
390 int notification_set_vibration(notification_h noti,
391 notification_vibration_type_e type, const char *path);
394 * @brief Gets the vibrate type from the notification handle.
395 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
396 * @param[in] noti The notification handle
397 * @param[out] type The notification sound type
398 * @param[out] path The user vibration file path
399 * @return #NOTIFICATION_ERROR_NONE on success,
400 * otherwise other value on failure
401 * @retval #NOTIFICATION_ERROR_NONE Success
402 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
405 #include <notification.h>
408 notification_h noti = NULL;
409 int noti_err = NOTIFICATION_ERROR_NONE;
410 notification_vibration_type_e type = NOTIFICATION_VIBRATION_TYPE_NONE;
412 noti_err = notification_get_vibration(noti, &type, NULL);
413 if (noti_err != NOTIFICATION_ERROR_NONE) {
419 int notification_get_vibration(notification_h noti,
420 notification_vibration_type_e *type, const char **path);
423 * @brief Sets the LED displaying option.
424 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
425 * @param[in] noti The notification handle
426 * @param[in] operation The LED notification operation
427 * @param[in] led_argb The notification led color
428 * @return #NOTIFICATION_ERROR_NONE on success,
429 * otherwise other value on failure
430 * @retval #NOTIFICATION_ERROR_NONE Success
431 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
434 #include <notification.h>
437 notification_h noti = NULL;
438 int noti_err = NOTIFICATION_ERROR_NONE;
440 noti_err = notification_set_led(noti, NOTIFICATION_LED_OP_ON, NULL);
441 if (noti_err != NOTIFICATION_ERROR_NONE) {
447 int notification_set_led(notification_h noti, notification_led_op_e operation,
451 * @brief Gets the LED displaying option from the notification handle.
452 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
453 * @param[in] noti The notification handle
454 * @param[out] operation The LED notification operation
455 * @param[out] led_argb The notification LED color
456 * @return #NOTIFICATION_ERROR_NONE on success,
457 * otherwise any other value on failure
458 * @retval #NOTIFICATION_ERROR_NONE Success
459 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
462 #include <notification.h>
465 notification_h noti = NULL;
466 int noti_err = NOTIFICATION_ERROR_NONE;
467 notification_led_type_e type = NOTIFICATION_LED_OP_OFF;
469 noti_err = notification_get_led(noti, &type, NULL);
470 if (noti_err != NOTIFICATION_ERROR_NONE) {
476 int notification_get_led(notification_h noti, notification_led_op_e *operation,
480 * @brief Sets the time period of flashing the LED.
481 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
482 * @param[in] noti The notification handle
483 * @param[in] on_ms The time for turning on the LED
484 * @param[in] off_ms The time for turning off the LED
485 * @return #NOTIFICATION_ERROR_NONE on success,
486 * otherwise any other value on failure
487 * @retval #NOTIFICATION_ERROR_NONE Success
488 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
491 #include <notification.h>
494 notification_h noti = NULL;
495 int noti_err = NOTIFICATION_ERROR_NONE;
497 noti_err = notification_set_led_time_period(noti, 100, 100);
498 if (noti_err != NOTIFICATION_ERROR_NONE) {
504 int notification_set_led_time_period(notification_h noti, int on_ms,
508 * @brief Gets the time period of flashing the LED from the notification handle.
509 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
510 * @param[in] noti The notification handle
511 * @param[out] on_ms The time for turning on the LED
512 * @param[out] off_ms The time for turning on the LED
513 * @return #NOTIFICATION_ERROR_NONE on success,
514 * otherwise any other value on failure
515 * @retval #NOTIFICATION_ERROR_NONE Success
516 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
519 #include <notification.h>
522 notification_h noti = NULL;
523 int noti_err = NOTIFICATION_ERROR_NONE;
527 noti_err = notification_get_led_time_period(noti, &led_on_ms, &led_off_ms);
528 if (noti_err != NOTIFICATION_ERROR_NONE) {
534 int notification_get_led_time_period(notification_h noti, int *on_ms,
538 * @brief Sets the launch option for a notification.
539 * @details When notification data selected in display application, application launched by app_control_send_launch_request with app_control handle.
540 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
541 * @param[in] noti The notification handle
542 * @param[in] type Launching option type
543 * @param[in] option App Control handler
544 * @return #NOTIFICATION_ERROR_NONE on success,
545 * otherwise any other value on failure
546 * @retval #NOTIFICATION_ERROR_NONE Success
547 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
550 #include <notification.h>
553 notification_h noti = NULL;
554 app_control_h app_control = NULL;
555 int noti_err = NOTIFICATION_ERROR_NONE;
559 app_control_create(&app_control);
560 app_control_set_app_id(app_control, "org.tizen.app");
564 noti_err = notification_set_launch_option(noti, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, (void *)app_control);
565 if (noti_err != NOTIFICATION_ERROR_NONE) {
566 notification_free(noti);
570 app_control_destroy(app_control);
574 int notification_set_launch_option(notification_h noti,
575 notification_launch_option_type type, void *option);
578 * @brief Gets the launch option from the notification handle.
579 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
580 * @remarks You must release @a app_control using app_control_destroy().
581 * @param[in] noti The notification handle
582 * @param[in] type Launching option type
583 * @param[out] option The pointer of App Control handler
584 * @return #NOTIFICATION_ERROR_NONE on success,
585 * otherwise any other value on failure
586 * @retval #NOTIFICATION_ERROR_NONE Success
587 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
590 #include <notification.h>
593 app_control_h app_control = NULL;
594 app_control_create(&app_control);
598 noti_err = notification_get_launch_option(noti, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, (void *)&app_control);
599 if (noti_err != NOTIFICATION_ERROR_NONE) {
600 notification_free(noti);
606 int notification_get_launch_option(notification_h noti,
607 notification_launch_option_type type, void *option);
610 * @brief Sets the handler for a specific event.
611 * @details When some event occurs on notification, application launched by app_control_send_launch_request with app_control handle.\n
612 * Setting event handler of a button means that the notification will show the button.
613 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
614 * @param[in] noti The notification handle
615 * @param[in] event_type event type
616 * @param[in] event_handler app control handle
617 * @return #NOTIFICATION_ERROR_NONE on success,
618 * otherwise any other value on failure
619 * @retval #NOTIFICATION_ERROR_NONE Success
620 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
621 * @see #notification_event_type_e
624 #include <notification.h>
627 notification_h noti = NULL;
628 app_control_h app_control = NULL;
629 int noti_err = NOTIFICATION_ERROR_NONE;
633 app_control_create(&app_control);
634 app_control_set_app_id(app_control, "org.tizen.app");
638 noti_err = notification_set_event_handler(noti, NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1, app_control);
639 if (noti_err != NOTIFICATION_ERROR_NONE) {
640 notification_free(noti);
644 app_control_destroy(app_control);
648 int notification_set_event_handler(notification_h noti,
649 notification_event_type_e event_type,
650 app_control_h event_handler);
653 * @brief Gets the event handler of a specific event.
654 * @remarks You must release @a app_control using app_control_destroy().
655 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
656 * @param[in] noti The notification handle
657 * @param[in] event_type Launching option type
658 * @param[out] option The pointer of App Control handler
659 * @return #NOTIFICATION_ERROR_NONE on success,
660 * otherwise any other value on failure
661 * @retval #NOTIFICATION_ERROR_NONE Success
662 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
663 * @see #notification_event_type_e
666 #include <notification.h>
669 app_control_h app_control = NULL;
670 app_control_create(&app_control);
674 noti_err = notification_get_event_handler(noti, NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1, &app_control);
675 if (noti_err != NOTIFICATION_ERROR_NONE) {
676 notification_free(noti);
682 int notification_get_event_handler(notification_h noti,
683 notification_event_type_e event_type,
684 app_control_h *event_handler);
687 * @brief Sets the property of the notification.
688 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
689 * @param[in] noti The notification handle
690 * @param[in] flags The property with | operation
691 * @return #NOTIFICATION_ERROR_NONE on success,
692 * otherwise any other value on failure
693 * @retval #NOTIFICATION_ERROR_NONE Success
694 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
697 #include <notification.h>
700 notification_h noti = NULL;
701 int noti_err = NOTIFICATION_ERROR_NONE;
704 noti = notification_create(NOTIFICATION_TYPE_NOTI);
709 noti_err = notification_set_property(noti, NOTIFICATION_PROP_DISPLAY_ONLY_SIMMODE | NOTIFICATION_PROP_DISABLE_APP_LAUNCH);
710 if (noti_err != NOTIFICATION_ERROR_NONE) {
711 notification_free(noti);
717 int notification_set_property(notification_h noti, int flags);
720 * @brief Gets the property of the notification from the notification handle.
721 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
722 * @param[in] noti The notification handle
723 * @param[out] flags The notification property
724 * @return #NOTIFICATION_ERROR_NONE on success,
725 * otherwise any other value on failure
726 * @retval #NOTIFICATION_ERROR_NONE Success
727 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
730 #include <notification.h>
733 notification_h noti = NULL;
734 int noti_err = NOTIFICATION_ERROR_NONE;
737 noti_err = notification_get_property(noti, &flags);
738 if (noti_err != NOTIFICATION_ERROR_NONE) {
744 int notification_get_property(notification_h noti, int *flags);
747 * @brief Sets applications to display the notification.
748 * @details All display application is enable(NOTIFICATION_DISPLAY_APP_ALL) if you are not call this API.
749 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
750 * @param[in] noti The notification handle
751 * @param[in] applist The with | operation
752 * @return #NOTIFICATION_ERROR_NONE on success,
753 * otherwise any other value on failure
754 * @retval #NOTIFICATION_ERROR_NONE Success
755 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
758 #include <notification.h>
761 notification_h noti = NULL;
762 int noti_err = NOTIFICATION_ERROR_NONE;
765 noti = notification_create(NOTIFICATION_TYPE_NOTI);
770 noti_err = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER | NOTIFICATION_DISPLAY_APP_INDICATOR);
771 if (noti_err != NOTIFICATION_ERROR_NONE) {
772 notification_free(noti);
779 int notification_set_display_applist(notification_h noti, int applist);
782 * @brief Gets the application list displaying the notification from the notification handle.
783 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
784 * @param[in] noti The notification handle
785 * @param[out] applist The display application list
786 * @return #NOTIFICATION_ERROR_NONE on success,
787 * otherwise any other value on failure
788 * @retval #NOTIFICATION_ERROR_NONE Success
789 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
792 #include <notification.h>
795 notification_h noti = NULL;
796 int noti_err = NOTIFICATION_ERROR_NONE;
799 noti_err = notification_get_display_applist(noti, &applist);
800 if (noti_err != NOTIFICATION_ERROR_NONE) {
806 int notification_get_display_applist(notification_h noti, int *applist);
809 * @brief Sets the initial size for the ongoing type.
810 * @details After notification_post() call, the size is not updated.
811 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
812 * @param[in] noti The notification handle
813 * @param[in] size The double type size
814 * @return #NOTIFICATION_ERROR_NONE on success,
815 * otherwise any other value on failure
816 * @retval #NOTIFICATION_ERROR_NONE Success
817 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
820 #include <notification.h>
823 notification_h noti = NULL;
824 int noti_err = NOTIFICATION_ERROR_NONE;
826 noti = notification_create(NOTIFICATION_TYPE_NOTI);
831 noti_err = notification_set_size(noti, 0.0);
832 if (noti_err != NOTIFICATION_ERROR_NONE) {
833 notification_free(noti);
839 int notification_set_size(notification_h noti, double size);
842 * @brief Gets the progress size.
843 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
844 * @param[in] noti The notification handle
845 * @param[out] size The progress size
846 * @return #NOTIFICATION_ERROR_NONE on success,
847 * otherwise any other value on failure
848 * @retval #NOTIFICATION_ERROR_NONE Success
849 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
852 #include <notification.h>
855 notification_h noti = NULL;
856 int noti_err = NOTIFICATION_ERROR_NONE;
859 noti_err = notification_get_size(noti, &size);
860 if (noti_err != NOTIFICATION_ERROR_NONE) {
866 int notification_get_size(notification_h noti, double *size);
869 * @brief Sets the initial progress for the ongoing type.
870 * @details After the notification_post() call, the progress is not updated.
871 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
872 * @param[in] noti The notification handle
873 * @param[in] percentage The progress percentage
874 * @return #NOTIFICATION_ERROR_NONE on success,
875 * otherwise any other value on failure
876 * @retval #NOTIFICATION_ERROR_NONE Success
877 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
880 #include <notification.h>
883 notification_h noti = NULL;
884 int noti_err = NOTIFICATION_ERROR_NONE;
886 noti = notification_create(NOTIFICATION_TYPE_NOTI);
891 noti_err = notification_set_progress(noti, 0.0);
892 if (noti_err != NOTIFICATION_ERROR_NONE) {
893 notification_free(noti);
899 int notification_set_progress(notification_h noti, double percentage);
902 * @brief Gets the progress from the notification handle.
903 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
904 * @remarks At the end of the operation, the progress should be @c 1.0.
905 * @param[in] noti The notification handle
906 * @param[out] percentage The progress percentage
907 * @return #NOTIFICATION_ERROR_NONE on success,
908 * otherwise any other value on failure
909 * @retval #NOTIFICATION_ERROR_NONE Success
910 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
913 #include <notification.h>
916 notification_h noti = NULL;
917 int noti_err = NOTIFICATION_ERROR_NONE;
918 double percentage = 0.0;
920 noti_err = notification_get_progress(noti, &percentage);
921 if (noti_err != NOTIFICATION_ERROR_NONE) {
927 int notification_get_progress(notification_h noti, double *percentage);
930 * @brief Sets the layout of the notification view.
931 * @details Caller can set displaying layout of notification.
932 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
933 * @param[in] noti The notification handle
934 * @param[in] layout The type of layout
935 * @return #NOTIFICATION_ERROR_NONE on success,
936 * otherwise any other value on failure
937 * @retval #NOTIFICATION_ERROR_NONE Success
938 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
939 * @see #notification_ly_type_e
941 int notification_set_layout(notification_h noti, notification_ly_type_e layout);
944 * @brief Gets the layout of the notification view from the notification handle.
945 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
946 * @param[in] noti The notification handle
947 * @param[out] layout The type of layout
948 * @return #NOTIFICATION_ERROR_NONE on success,
949 * otherwise any other value on failure
950 * @retval #NOTIFICATION_ERROR_NONE Success
951 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
952 * @see #notification_ly_type_e
954 int notification_get_layout(notification_h noti,
955 notification_ly_type_e *layout);
958 * @brief Gets the type of a notification.
959 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
960 * @param[in] noti The notification handle
961 * @param[out] type The notification type
962 * @return #NOTIFICATION_ERROR_NONE on success,
963 * otherwise any other value on failure
964 * @retval #NOTIFICATION_ERROR_NONE Success
965 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
968 #include <notification.h>
971 int noti_err = NOTIFICATION_ERROR_NONE;
972 notification_type_e type;
974 noti_err = notification_get_type(noti, &type);
975 if (noti_err != NOTIFICATION_ERROR_NONE) {
981 int notification_get_type(notification_h noti, notification_type_e *type);
983 * @brief Updates notification data.
984 * @details The updated notification will appear in the notification area.
985 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
987 * @privilege %http://tizen.org/privilege/notification
988 * @param[in] noti The notification handle that is created by notification_create()
989 * @return #NOTIFICATION_ERROR_NONE on success,
990 * otherwise any other value on failure
991 * @retval #NOTIFICATION_ERROR_NONE Success
992 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
993 * @retval #NOTIFICATION_ERROR_NOT_EXIST_ID Priv ID does not exist
994 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
997 #include <notification.h>
1000 int noti_err = NOTIFICATION_ERROR_NONE;
1002 noti_err = notification_update(NULL);
1003 if (noti_err != NOTIFICATION_ERROR_NONE) {
1009 int notification_update(notification_h noti);
1012 * @brief Deletes a notification with the given handle.
1013 * @details notification_delete() removes notification data from database and notification_free() releases memory of notification data.
1014 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
1016 * @privilege %http://tizen.org/privilege/notification
1017 * @param[in] noti The notification handle
1018 * @return #NOTIFICATION_ERROR_NONE on success,
1019 * otherwise any other value on failure
1020 * @retval #NOTIFICATION_ERROR_NONE Success
1021 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
1022 * @retval NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
1025 #include <notification.h>
1028 notificaton_h noti = NULL;
1029 int noti_err = NOTIFICATION_ERROR_NONE;
1033 noti_err = notification_delete(noti);
1034 if (noti_err != NOTIFICATION_ERROR_NONE) {
1041 int notification_delete(notification_h noti);
1044 * @brief Creates internal structure data and returns a notification handle.
1045 * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1046 * #NOTIFICATION_TYPE_NOTI is remaining notification data even if device is restarted.
1047 * #NOTIFICATION_TYPE_ONGOING can display progress on a notification with #NOTIFICATION_LY_ONGOING_PROGRESS layout.
1048 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
1049 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
1050 * @param[in] type The notification type
1051 * @return Notification handle(notification_h) on success,
1052 * otherwise @c NULL on failure
1053 * @retval notification_h Success
1054 * @retval NULL Failure
1055 * @exception #NOTIFICATION_ERROR_NONE Success
1056 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
1057 * @exception #NOTIFICATION_ERROR_OUT_OF_MEMORY Out of memory
1058 * @see #notification_type_e
1061 #include <notification.h>
1064 notification_h noti = NULL;
1066 noti = notification_create(NOTIFICATION_TYPE_NOTI);
1074 notification_h notification_create(notification_type_e type);
1077 * @brief Creates a notification clone.
1078 * @details Newly created notification handle is returned.
1079 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
1080 * @remarks This cloned notification handle should be freed using notification_free().
1081 * @param[in] noti The notification handle
1082 * @param[out] clone The newly created notification handle that has same with input @a noti
1083 * @return #NOTIFICATION_ERROR_NONE if success,
1084 * otherwise any other value if failure
1085 * @retval #NOTIFICATION_ERROR_NONE Success
1086 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1087 * @see #notification_type_e
1090 #include <notification.h>
1093 notification_h noti = notification_create(NOTIFICATION_TYPE_NOTI);
1094 notification_h clone = NULL;
1096 notification_clone(noti, &clone);
1101 int notification_clone(notification_h noti, notification_h *clone);
1104 * @brief Frees the internal structure data of a notification handle.
1105 * @details Internal data of a notification handle is released. Data of the inserted notification is not deleted.
1106 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
1107 * @param[in] noti The notification handle
1108 * @return #NOTIFICATION_ERROR_NONE on success,
1109 * otherwise any other value on failure
1110 * @retval #NOTIFICATION_ERROR_NONE Success
1111 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1112 * @pre Notification handle should be created by notification_create().
1115 #include <notification.h>
1118 notification_h noti = NULL;
1119 int noti_err = NOTIFICATION_ERROR_NONE;
1121 noti = notification_create(NOTIFICATION_TYPE_NOTI);
1127 noti_err = notification_free(noti);
1128 if (noti_err != NOTIFICATION_ERROR_NONE) {
1134 int notification_free(notification_h noti);
1141 * @addtogroup NOTIFICATION_MODULE
1146 * @brief Sets the tag of the notification handle.
1147 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
1148 * @param[in] noti Notification handle
1149 * @param[in] tag tag for loading notification handle
1150 * @return #NOTIFICATION_ERROR_NONE on success, other value on failure
1151 * @retval #NOTIFICATION_ERROR_NONE Success
1152 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1153 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
1154 * @see notification_get_tag()
1157 #include <notification.h>
1160 notification_h noti = NULL;
1161 int noti_err = NOTIFICATION_ERROR_NONE;
1163 noti = notification_create(NOTIFICATION_TYPE_NOTI);
1169 noti_err = notification_set_tag(noti, tag);
1170 if (noti_err != NOTIFICATION_ERROR_NONE) {
1176 int notification_set_tag(notification_h noti, const char *tag);
1179 * @brief Gets the tag of the notification handle.
1180 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
1181 * @param[in] noti Notification handle
1182 * @param[out] tag tag for loading notification handle
1183 * @return #NOTIFICATION_ERROR_NONE on success, other value on failure
1184 * @retval #NOTIFICATION_ERROR_NONE Success
1185 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1186 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
1187 * @see notification_set_tag()
1190 #include <notification.h>
1193 int noti_err = NOTIFICATION_ERROR_NONE;
1194 const char *tag = NULL;
1198 noti_err = notification_get_tag(noti, &tag);
1199 if (noti_err != NOTIFICATION_ERROR_NONE) {
1205 int notification_get_tag(notification_h noti, const char **tag);
1208 * @brief Loads a notification from the notification's database with the tag.
1209 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
1211 * @privilege %http://tizen.org/privilege/notification
1212 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
1213 * @param[in] tag tag for loading notification handle
1214 * @return Notification handle(notification_h) on success, NULL on failure
1215 * @retval notification_h Success
1216 * @retval NULL Failure
1217 * @exception #NOTIFICATION_ERROR_NONE Success
1218 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
1219 * @exception #NOTIFICATION_ERROR_OUT_OF_MEMORY Out of memory
1220 * @exception #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
1221 * @see #notification_type_e
1224 #include <notification.h>
1227 notification_h noti = NULL;
1229 noti = notification_load_by_tag(tag);
1237 notification_h notification_load_by_tag(const char *tag);
1240 * @brief Deletes all notifications of the given type.
1241 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
1243 * @privilege %http://tizen.org/privilege/notification
1244 * @param[in] type Notification type
1245 * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
1246 * @retval #NOTIFICATION_ERROR_NONE Success
1247 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
1248 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
1251 #include <notification.h>
1254 int noti_err = NOTIFICATION_ERROR_NONE;
1256 noti_err = notification_delete_all(NOTIFICATION_TYPE_NOTI);
1257 if (noti_err != NOTIFICATION_ERROR_NONE) {
1263 int notification_delete_all(notification_type_e type);
1266 * @brief Posts a notification.
1267 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
1269 * @privilege %http://tizen.org/privilege/notification
1270 * @param[in] noti Notification handle
1271 * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
1272 * @retval #NOTIFICATION_ERROR_NONE Success
1273 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1274 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
1275 * @pre Notification handle should be created by notification_create().
1276 * @post notification_free().
1279 #include <notification.h>
1282 int noti_err = NOTIFICATION_ERROR_NONE;
1284 noti_err = notification_post(noti);
1285 if (noti_err != NOTIFICATION_ERROR_NONE) {
1291 int notification_post(notification_h noti);
1294 * @brief Gets the package name of the notification
1295 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1296 * @param[in] noti Notification handle
1297 * @param[out] pkgname The package name of the notification
1298 * @return #NOTIFICATION_ERROR_NONE on success, otherwise a negative error value
1299 * @retval NOTIFICATION_ERROR_NONE Success
1300 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
1303 #include <notification.h>
1306 notification_h noti = NULL;
1307 int noti_err = NOTIFICATION_ERROR_NONE;
1308 char *pkgname = NULL;
1312 noti_err = notification_get_pkgname(noti, &pkgname);
1314 if (noti_err != NOTIFICATION_ERROR_NONE) {
1315 notification_free(noti);
1321 int notification_get_pkgname(notification_h noti, char **pkgname);
1324 * @brief Adds a button on the notification
1325 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1326 * @param[in] noti Notification handle
1327 * @param[in] button_index Button index
1328 * @return #NOTIFICATION_ERROR_NONE on success, otherwise a negative error value
1329 * @retval NOTIFICATION_ERROR_NONE Success
1330 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
1333 #include <notification.h>
1336 notification_h noti = NULL;
1337 int noti_err = NOTIFICATION_ERROR_NONE;
1338 char *pkgname = NULL;
1342 noti_err = notification_add_button(noti, NOTIFICATION_BUTTON_1);
1344 if (noti_err != NOTIFICATION_ERROR_NONE) {
1345 notification_free(noti);
1351 int notification_add_button(notification_h noti,
1352 notification_button_index_e button_index);
1355 * @brief Removes a button on the notification
1356 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1357 * @param[in] noti Notification handle
1358 * @param[in] button_index Button index
1359 * @return #NOTIFICATION_ERROR_NONE on success, otherwise a negative error value
1360 * @retval NOTIFICATION_ERROR_NONE Success
1361 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
1364 #include <notification.h>
1367 notification_h noti = NULL;
1368 int noti_err = NOTIFICATION_ERROR_NONE;
1369 char *pkgname = NULL;
1373 noti_err = notification_remove_button(noti, NOTIFICATION_BUTTON_1);
1375 if (noti_err != NOTIFICATION_ERROR_NONE) {
1376 notification_free(noti);
1382 int notification_remove_button(notification_h noti,
1383 notification_button_index_e button_index);
1386 * @brief Sets the 'auto remove' option of the active notification
1387 * @details The 'auto remove' option let the active notification be removed in several seconds after it shows. Default value is true.
1388 * @remarks When 'auto_remove' is set as false, the active notification will not be removed
1389 as long as the user removes the active notification or the app which posted the active notification removes the active notification.
1390 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1391 * @param[in] noti Notification handle
1392 * @param[in] auto_remove Auto remove option
1393 * @return #NOTIFICATION_ERROR_NONE On success, other value if failure
1394 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1395 * @see #notification_h
1396 * @see #notification_get_auto_remove
1399 #include <notification.h>
1402 notification_h noti = NULL;
1403 int noti_err = NOTIFICATION_ERROR_NONE;
1407 noti_err = notification_set_auto_remove(noti, false);
1408 if (noti_err != NOTIFICATION_ERROR_NONE) {
1414 int notification_set_auto_remove(notification_h noti, bool auto_remove);
1417 * @brief Gets the 'auto remove' option of the active notification
1418 * @details The 'auto remove' option let the active notification be removed in several seconds after it shows. Default value is true.
1419 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1420 * @param[in] noti Notification handle
1421 * @param[out] auto_remove Auto remove option
1422 * @return #NOTIFICATION_ERROR_NONE On success, other value on failure
1423 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1424 * @see #notification_h
1425 * @see #notification_get_auto_remove
1428 #include <notification.h>
1431 int noti_err = NOTIFICATION_ERROR_NONE;
1436 noti_err = notification_get_auto_remove(noti, &auto_remove);
1437 if (noti_err != NOTIFICATION_ERROR_NONE) {
1443 int notification_get_auto_remove(notification_h noti, bool *auto_remove);
1446 * @brief Saves a notification template to the notification database.
1447 * @details An application can save the created notification as a template for later reuse.
1448 * If the template has the same name as a saved one, the saved template will be overwritten.
1449 * A saved template can be loaded only by the application which saved it.
1450 * All templates are removed when the application package is uninstalled.
1453 * @privilege %http://tizen.org/privilege/notification
1454 * @remarks The number of templates is limited to 10.
1455 * When you try to add more than 10 templates, #NOTIFICATION_ERROR_MAX_EXCEEDED will be returned.
1456 * @param[in] noti Notification handle
1457 * @param[in] template_name Template name
1458 * @return #NOTIFICATION_ERROR_NONE On success, other value on failure
1459 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1460 * @retval #NOTIFICATION_ERROR_IO_ERROR I/O error
1461 * @retval #NOTIFICATION_ERROR_OUT_OF_MEMORY Out of memory
1462 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The Permission denied
1463 * @retval #NOTIFICATION_ERROR_MAX_EXCEEDED Max notification count exceeded
1464 * @see #notification_h
1465 * @see notification_create_from_template()
1468 #include <notification.h>
1471 int noti_err = NOTIFICATION_ERROR_NONE;
1475 noti_err = notification_save_as_template(noti, "CALL_ACCEPT");
1476 if (noti_err != NOTIFICATION_ERROR_NONE) {
1482 int notification_save_as_template(notification_h noti, const char *template_name);
1485 * @brief Loads a notification template from the notification database.
1486 * @details An application can load a saved template and post it.
1487 * An application can load only templates that it has saved.
1490 * @privilege %http://tizen.org/privilege/notification
1491 * @remarks The returned handle should be destroyed using notification_free().
1492 * The specific error code can be obtained using get_last_result().
1493 * Error codes are described in the Exception section.
1494 * If an invalid template name is given, the result will be set to #NOTIFICATION_ERROR_FROM_DB.
1495 * @param[in] template_name Template name
1496 * @return Notification handle on success, NULL on failure
1497 * @exception #NOTIFICATION_ERROR_NONE Success
1498 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
1499 * @exception #NOTIFICATION_ERROR_OUT_OF_MEMORY Out of memory
1500 * @exception #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
1501 * @exception #NOTIFICATION_ERROR_FROM_DB Error from DB query
1502 * @see #notification_h
1503 * @see notification_save_as_template()
1506 #include <notification.h>
1509 notification_h noti = NULL;
1511 noti = notification_create_from_template("CALL_ACCEPT");
1519 notification_h notification_create_from_template(const char *template_name);
1522 * @brief Gets notification block state.
1523 * @details The user can set the notification block state in settings.
1524 * The block state indicates whether or not notifications can be posted.
1525 * Additionally only notifications to the notification panel are
1526 * allowed in "Do not disturb mode". Sound, Vibrate and
1527 * Active/Instant notifications are blocked.
1530 * @privilege %http://tizen.org/privilege/notification
1531 * @param[out] state Notification block state
1532 * @return #NOTIFICATION_ERROR_NONE On success, other value on failure
1533 * @retval #NOTIFICATION_ERROR_NONE Success
1534 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1535 * @retval #NOTIFICATION_ERROR_OUT_OF_MEMORY out of memory
1536 * @retval #NOTIFICATION_ERROR_IO_ERROR I/O Error
1537 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED Permission denied
1538 * @retval #NOTIFICATION_ERROR_SERVICE_NOT_READY No response from notification service
1539 * @see #notification_block_state_e
1542 #include <notification.h>
1545 int noti_err = NOTIFICATION_ERROR_NONE;
1546 notification_block_state_e state;
1550 noti_err = notification_get_noti_block_state(&state);
1551 if (noti_err != NOTIFICATION_ERROR_NONE) {
1557 int notification_get_noti_block_state(notification_block_state_e *state);
1560 * @brief Sets a text input box to reply directly on the notification.
1561 * @details When you add a text input to the active notification, the notification UI will show a text input with a button.
1562 * So, the user can enter any text and press the button to confirm the text as a input.
1563 * You can edit some UI component that is related to the text input.
1564 * First, you can add placeholder text to guide the user using notification_set_text() with #NOTIFICATION_TEXT_TYPE_TEXT_INPUT_PLACEHOLDER type.
1565 * You also can edit button for the text input.
1566 * For setting just a text to the button, you can set the text using notification_set_text() with #NOTIFICATION_TEXT_TYPE_TEXT_INPUT_BUTTON type.
1567 * If you want to show image button, you can set an image for the button using notification_set_image() with #NOTIFICATION_IMAGE_TYPE_TEXT_INPUT_BUTTON type.
1569 * Note that You should set an app_control for handling the event for user input using notification_set_event_handler().
1570 * #NOTIFICATION_EVENT_TYPE_CLICK_ON_TEXT_INPUT_BUTTON is the event type for the text input.
1571 * You can get the text the user enters in the app_control handle that is passed as a result of the event.
1572 * The app_control will contain APP_CONTROL_DATA_TEXT key, so you can get the text using app_control_get_extra_data() using APP_CONTROL_DATA_TEXT key.
1573 * The value will contain the text user enters.
1575 * @return #NOTIFICATION_ERROR_NONE on success,
1576 * otherwise any other value on failure
1577 * @retval #NOTIFICATION_ERROR_NONE Success
1578 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1581 #include <notification.h>
1584 notification_h noti = NULL;
1585 int noti_err = NOTIFICATION_ERROR_NONE;
1588 noti = notification_create(NOTIFICATION_TYPE_NOTI);
1594 noti_err = notification_set_text_input(noti, 160);
1595 if (noti_err != NOTIFICATION_ERROR_NONE) {
1599 noti_err = notification_set_text(noti,
1600 NOTIFICATION_TEXT_TYPE_TEXT_INPUT_PLACEHOLDER,
1603 NOTIFICATION_VARIABLE_TYPE_NONE);
1604 if (noti_err != NOTIFICATION_ERROR_NONE) {
1608 noti_err = notification_set_text(noti,
1609 NOTIFICATION_TEXT_TYPE_TEXT_INPUT_BUTTON,
1612 NOTIFICATION_VARIABLE_TYPE_NONE);
1613 if (noti_err != NOTIFICATION_ERROR_NONE) {
1617 noti_err = notification_set_image(noti,
1618 NOTIFICATION_IMAGE_TYPE_TEXT_INPUT_BUTTON,
1619 TEXT_INPUT_BUTTON_PATH);
1620 if (noti_err != NOTIFICATION_ERROR_NONE) {
1626 noti_err = app_control_create(&app_control);
1627 if (noti_err != APP_CONTROL_ERROR_NONE) {
1631 noti_err = app_control_set_app_id(app_control, appid);
1632 if (noti_err != APP_CONTROL_ERROR_NONE) {
1636 noti_err = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
1637 if (noti_err != APP_CONTROL_ERROR_NONE) {
1641 noti_err = notification_set_event_handler(noti,
1642 NOTIFICATION_EVENT_TYPE_CLICK_ON_TEXT_INPUT_BUTTON,
1644 if (noti_err != NOTIFICATION_ERROR_NONE) {
1648 noti_err = app_control_destroy(app_control);
1649 if (noti_err != APP_CONTROL_ERROR_NONE) {
1653 noti_err = notification_post(noti);
1654 if(noti_err != NOTIFICATION_ERROR_NONE) {
1661 int notification_set_text_input(notification_h noti, int text_input_max_length);
1670 #endif /* __NOTIFICATION_H__ */