Fix sample codes for notification_set/get_led
[platform/core/api/notification.git] / include / notification_type.h
1 /*
2  * Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __NOTIFICATION_TYPE_H__
18 #define __NOTIFICATION_TYPE_H__
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 #ifndef NOTIFICATION_DEPRECATED_API
25 #if 0 /* __GNUC__ */
26 #define NOTIFICATION_DEPRECATED_API __attribute__((deprecated))
27 #else
28 #define NOTIFICATION_DEPRECATED_API
29 #endif
30 #endif
31
32 /**
33  * @file notification_type.h
34  * @brief This file contains type definitions and enumerations for Notification API.
35  */
36
37 /**
38  * @addtogroup NOTIFICATION_MODULE
39  * @{
40  */
41
42 #define NOTIFICATION_DO_NOT_SHOW_TIME_STAMP -1  /**< Do not show time stamp on the notificaion. Could be passed as a argument of notification_set_time() */
43
44 /**
45  * @brief Enumeration for notification layout type.
46  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
47  */
48 typedef enum _notification_ly_type {
49         NOTIFICATION_LY_NONE = 0,
50         /**< Default */
51         NOTIFICATION_LY_NOTI_EVENT_SINGLE,
52         /**< Layout for notification. Used to inform single event*/
53         NOTIFICATION_LY_NOTI_EVENT_MULTIPLE,
54         /**< Layout for notification. Used to inform multiple event*/
55         NOTIFICATION_LY_NOTI_THUMBNAIL,
56         /**< Layout for notification. Used to display images*/
57         NOTIFICATION_LY_ONGOING_EVENT,
58         /**< Layout for ongoing notification. Used to display text message.
59          * notifications with NOTIFICATION_LY_ONGOING_EVENT can not be protected from removing by user since tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif */
60         NOTIFICATION_LY_ONGOING_PROGRESS,
61         /**< Layout for ongoing notification. Used to display progress*/
62         NOTIFICATION_LY_MAX,
63         /**< TBD */
64 } notification_ly_type_e;
65
66 /**
67  * @brief Enumeration for notification lauch option type.
68  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
69  */
70 typedef enum  _notification_launch_option_type {
71         NOTIFICATION_LAUNCH_OPTION_APP_CONTROL = 1,
72         /**< launching with app control */
73 } notification_launch_option_type;
74
75 /**
76  * @brief Enumeration for event type on notification.
77  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
78  */
79 typedef enum _notification_event_type {
80         NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1  = 0,  /**< Event type : Click on button 1 */
81         NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_2  = 1,  /**< Event type : Click on button 2 */
82         NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_3  = 2,  /**< Event type : Click on button 3 */
83         NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_4  = 3,  /**< Event type : Click on button 4 */
84         NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_5  = 4,  /**< Event type : Click on button 5 */
85         NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_6  = 5,  /**< Event type : Click on button 6 */
86         NOTIFICATION_EVENT_TYPE_CLICK_ON_ICON      = 6,  /**< Event type : Click on icon */
87         NOTIFICATION_EVENT_TYPE_CLICK_ON_THUMBNAIL = 7,  /**< Event type : Click on thumbnail */
88         NOTIFICATION_EVENT_TYPE_MAX,
89 } notification_event_type_e;
90
91 /**
92  * @brief Enumeration for notification sound type.
93  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
94  */
95 typedef enum _notification_sound_type {
96         NOTIFICATION_SOUND_TYPE_NONE = -1,
97                                         /**< Default value. no sound */
98         NOTIFICATION_SOUND_TYPE_DEFAULT = 0,
99                                         /**< Default sound */
100         NOTIFICATION_SOUND_TYPE_USER_DATA,
101                                         /**< User sound data */
102         NOTIFICATION_SOUND_TYPE_MAX,
103 } notification_sound_type_e;
104
105 /**
106  * @brief Enumeration for notification vibration type.
107  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
108  */
109 typedef enum _notification_vibration_type {
110         NOTIFICATION_VIBRATION_TYPE_NONE = -1,
111         /**< Default value. No vibration */
112         NOTIFICATION_VIBRATION_TYPE_DEFAULT = 0,/**< Default vibrate pattern */
113         NOTIFICATION_VIBRATION_TYPE_USER_DATA,
114         /**< User vibration data */
115         NOTIFICATION_VIBRATION_TYPE_MAX,
116 } notification_vibration_type_e;
117
118 /**
119  * @brief Enumeration for notification LED operation.
120  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
121  */
122 typedef enum _notification_led_op {
123         NOTIFICATION_LED_OP_OFF = -1,
124                                         /**< Default value. Disable the LED notification */
125         NOTIFICATION_LED_OP_ON = 0,/**< Turn on the LED with default color */
126         NOTIFICATION_LED_OP_ON_CUSTOM_COLOR,
127                                         /**< Turn on the LED with custom color */
128         NOTIFICATION_LED_OP_MAX,/**< Max flag */
129 } notification_led_op_e;
130
131 /**
132  * @deprecated Deprecated since 2.3.1
133  * @brief Enumeration for setting display type of count
134  * @since_tizen 2.3
135  */
136 typedef enum _notification_count_display_type {
137         NOTIFICATION_COUNT_DISPLAY_TYPE_NONE = -1,
138         NOTIFICATION_COUNT_DISPLAY_TYPE_LEFT = 0,       /**< The number is placed to left */
139         NOTIFICATION_COUNT_DISPLAY_TYPE_IN,     /**< The number is placed to center */
140         NOTIFICATION_COUNT_DISPLAY_TYPE_RIGHT,  /**< The number is placed to right */
141         NOTIFICATION_COUNT_DISPLAY_TYPE_MAX,
142 } notification_count_display_type_e;
143
144 /**
145  * @brief Enumeration for button
146  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
147  */
148 typedef enum _notification_button_index {
149         NOTIFICATION_BUTTON_1 = 1, /**< button 1 */
150         NOTIFICATION_BUTTON_2 = 2, /**< button 2 */
151         NOTIFICATION_BUTTON_3 = 3, /**< button 3 */
152         NOTIFICATION_BUTTON_4 = 4, /**< button 4 */
153         NOTIFICATION_BUTTON_5 = 5, /**< button 5 */
154         NOTIFICATION_BUTTON_6 = 6, /**< button 6 */
155 } notification_button_index_e;
156
157 /**
158  * @brief Enumeration for notification text type.
159  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
160  */
161 typedef enum _notification_text_type {
162         NOTIFICATION_TEXT_TYPE_NONE = -1,
163         NOTIFICATION_TEXT_TYPE_TITLE = 0,
164                                         /**< Title */
165         NOTIFICATION_TEXT_TYPE_CONTENT,
166                                 /**< Content */
167         NOTIFICATION_TEXT_TYPE_CONTENT_FOR_DISPLAY_OPTION_IS_OFF,
168                                                                 /**< Content for content display option is off of the Settings */
169         NOTIFICATION_TEXT_TYPE_EVENT_COUNT,
170                                                                 /**< Text to display event count */
171         NOTIFICATION_TEXT_TYPE_INFO_1,
172                                                                 /**< Box contents 1 */
173         NOTIFICATION_TEXT_TYPE_INFO_SUB_1,
174                                                                 /**< Box contents 1-1 */
175         NOTIFICATION_TEXT_TYPE_INFO_2,
176                                                                 /**< Box contents 2 */
177         NOTIFICATION_TEXT_TYPE_INFO_SUB_2,
178                                                                 /**< Box contents 2-1 */
179         NOTIFICATION_TEXT_TYPE_INFO_3,
180                                                                 /**< Box contents 3 */
181         NOTIFICATION_TEXT_TYPE_INFO_SUB_3,
182                                                                 /**< Box contents 3-1 */
183         NOTIFICATION_TEXT_TYPE_GROUP_TITLE,
184                                         /**< Group title */
185         NOTIFICATION_TEXT_TYPE_GROUP_CONTENT,
186                                         /**< Group content */
187         NOTIFICATION_TEXT_TYPE_GROUP_CONTENT_FOR_DISPLAY_OPTION_IS_OFF,
188                                                                 /**< Group content for content display option is off of the Settings */
189         NOTIFICATION_TEXT_TYPE_BUTTON_1,
190                                                                 /**< Text on button 1 */
191         NOTIFICATION_TEXT_TYPE_BUTTON_2,
192                                                                 /**< Text on button 2 */
193         NOTIFICATION_TEXT_TYPE_BUTTON_3,
194                                                                 /**< Text on button 3 */
195         NOTIFICATION_TEXT_TYPE_BUTTON_4,
196                                                                 /**< Text on button 4 */
197         NOTIFICATION_TEXT_TYPE_BUTTON_5,
198                                                                 /**< Text on button 5 */
199         NOTIFICATION_TEXT_TYPE_BUTTON_6,
200                                                                 /**< Text on button 6 */
201         NOTIFICATION_TEXT_TYPE_MAX,
202 } notification_text_type_e;
203
204 /**
205  * @brief Enumeration for image type.
206  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
207  */
208 typedef enum _notification_image_type {
209         NOTIFICATION_IMAGE_TYPE_NONE = -1,
210         NOTIFICATION_IMAGE_TYPE_ICON = 0,
211                                         /**< Icon */
212         NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR,
213                                                 /**< Indicator icon */
214         NOTIFICATION_IMAGE_TYPE_ICON_FOR_LOCK,
215                                         /**< Lock screen icon */
216         NOTIFICATION_IMAGE_TYPE_THUMBNAIL,
217                                         /**< Thumbnail */
218         NOTIFICATION_IMAGE_TYPE_THUMBNAIL_FOR_LOCK,
219                                                 /**< Lock screen thumbnail */
220         NOTIFICATION_IMAGE_TYPE_ICON_SUB,
221                                         /**< Icon */
222         NOTIFICATION_IMAGE_TYPE_BACKGROUND,
223                                                 /**< image displayed on background */
224         NOTIFICATION_IMAGE_TYPE_LIST_1,
225                                                 /**< Image for thumbnail list */
226         NOTIFICATION_IMAGE_TYPE_LIST_2,
227                                                 /**< Image for thumbnail list */
228         NOTIFICATION_IMAGE_TYPE_LIST_3,
229                                                 /**< Image for thumbnail list */
230         NOTIFICATION_IMAGE_TYPE_LIST_4,
231                                                 /**< Image for thumbnail list */
232         NOTIFICATION_IMAGE_TYPE_LIST_5,
233                                                 /**< Image for thumbnail list */
234         NOTIFICATION_IMAGE_TYPE_BUTTON_1,
235                                                 /**< Image for button 1 */
236         NOTIFICATION_IMAGE_TYPE_BUTTON_2,
237                                                 /**< Image for button 2 */
238         NOTIFICATION_IMAGE_TYPE_BUTTON_3,
239                                                 /**< Image for button 3 */
240         NOTIFICATION_IMAGE_TYPE_BUTTON_4,
241                                                 /**< Image for button 4 */
242         NOTIFICATION_IMAGE_TYPE_BUTTON_5,
243                                                 /**< Image for button 5 */
244         NOTIFICATION_IMAGE_TYPE_BUTTON_6,
245                                                 /**< Image for button 6 */
246         NOTIFICATION_IMAGE_TYPE_MAX,
247 } notification_image_type_e;
248
249 /**
250  * @brief Enumeration for application execution type.
251  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
252  */
253 typedef enum _notification_execute_type {
254         NOTIFICATION_EXECUTE_TYPE_NONE = -1,
255                                         /**< No operation */
256         NOTIFICATION_EXECUTE_TYPE_RESPONDING = 0,
257                                                 /**< Responding action*/
258         NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,/**< Launching when notification data is single */
259         NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH,
260                                         /**< Launching when notification data is grouping(multi) */
261         NOTIFICATION_EXECUTE_TYPE_MAX,
262                                 /**< Max flag */
263 } notification_execute_type_e;
264
265 /**
266  * @brief Enumeration for notification type.
267  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
268  */
269 typedef enum _notification_type {
270         NOTIFICATION_TYPE_NONE = -1,
271                                 /**< None */
272         NOTIFICATION_TYPE_NOTI = 0,
273                                 /**< Notification type */
274         NOTIFICATION_TYPE_ONGOING,
275                                 /**< Ongoing type */
276         NOTIFICATION_TYPE_MAX,
277                         /**< Max flag */
278 } notification_type_e;
279
280 /**
281  * @brief Enumeration for Group ID.
282  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
283  */
284 enum _notification_group_id {
285         NOTIFICATION_GROUP_ID_NONE = -1,/**< Not Grouping */
286         NOTIFICATION_GROUP_ID_DEFAULT = 0,
287                                         /**< Notification that has same title is grouping */
288 };
289
290 /**
291  * @brief Enumeration for Private ID.
292  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
293  */
294 enum _notification_priv_id {
295         NOTIFICATION_PRIV_ID_NONE = -1,
296                                 /**< Internally set priv_id */
297 };
298
299 /**
300  * @brief Enumeration for notification property.
301  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
302  */
303 enum _notification_property {
304         NOTIFICATION_PROP_DISPLAY_ONLY_SIMMODE = 0x00000001,
305                                                         /**< Display only SIM card inserted */
306         NOTIFICATION_PROP_DISABLE_APP_LAUNCH = 0x00000002,
307                                                         /**< Disable application launch when it selected */
308         NOTIFICATION_PROP_DISABLE_AUTO_DELETE = 0x00000004,
309                                                         /**< Disable auto delete when it selected */
310         NOTIFICATION_PROP_LAUNCH_UG = 0x00000008,
311                                                 /**< Notification Tray should launch application using appsvc API (Deprecated since 2.3.1) */
312         NOTIFICATION_PROP_DISABLE_TICKERNOTI = 0x00000010,
313                                                         /**< Use notification_set_display_applist API (Deprecated since 2.3.1) */
314         NOTIFICATION_PROP_PERMANENT_DISPLAY = 0x00000020,
315                                                         /**< The notification will not be removed (Deprecated since 2.3.1) */
316         NOTIFICATION_PROP_DISABLE_UPDATE_ON_INSERT = 0x00000040,/**< Disable update when it inserted. */
317         NOTIFICATION_PROP_DISABLE_UPDATE_ON_DELETE = 0x00000080,/**< Disable update when it deleted. */
318         NOTIFICATION_PROP_VOLATILE_DISPLAY = 0x00000100,/**< Deleted when device is rebooted eventhough NOTIFICATION_TYPE_NOTI type */
319 };
320
321 /**
322  * @brief Enumeration for display application list.
323  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
324  */
325 enum _notificaton_display_applist {
326         NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY = 0x00000001, /**< Notification Tray(Quickpanel) */
327         NOTIFICATION_DISPLAY_APP_TICKER = 0x00000002, /**< Ticker notification */
328         NOTIFICATION_DISPLAY_APP_LOCK = 0x00000004, /**< Lock screen */
329         NOTIFICATION_DISPLAY_APP_INDICATOR = 0x00000008,/**< Indicator */
330         NOTIFICATION_DISPLAY_APP_ACTIVE = 0x00000010,/**< Active notification */
331         NOTIFICATION_DISPLAY_APP_ALL = 0x0000000f, /**< All display application except active notification*/
332 };
333
334 /**
335  * @brief Enumeration for notification operation code.
336  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
337  */
338 typedef enum _notification_op_type {
339         NOTIFICATION_OP_NONE = 0,       /**< Default */
340         NOTIFICATION_OP_INSERT = 1,     /**< Notification inserted */
341         NOTIFICATION_OP_UPDATE, /**< Notification updated */
342         NOTIFICATION_OP_DELETE, /**< Notification deleted */
343         NOTIFICATION_OP_DELETE_ALL,     /**< Notifications deleted */
344         NOTIFICATION_OP_REFRESH,        /**< (Deprecated Since 2.3.1) */
345         NOTIFICATION_OP_SERVICE_READY,  /**< Notification service is ready  */
346 } notification_op_type_e;
347
348 /**
349  * @brief Enumeration for notification operation data code
350  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
351  */
352 typedef enum _notification_op_data_type {
353         NOTIFICATION_OP_DATA_MIN = 0,   /**< Default */
354         NOTIFICATION_OP_DATA_TYPE,      /**< Operation type */
355         NOTIFICATION_OP_DATA_PRIV_ID,   /**< Private ID */
356         NOTIFICATION_OP_DATA_NOTI,      /**< Notification handler */
357         NOTIFICATION_OP_DATA_EXTRA_INFO_1,      /**< Reserved */
358         NOTIFICATION_OP_DATA_EXTRA_INFO_2,      /**< Reserved */
359         NOTIFICATION_OP_DATA_MAX,       /**< Max flag */
360 } notification_op_data_type_e;
361
362 /**
363  * @brief Enumeration for notification count position in the text.
364  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
365  */
366 typedef enum _notifcation_count_pos_type {
367         NOTIFICATION_COUNT_POS_NONE = -1,
368                                         /**< Count data is not displaying in the text */
369         NOTIFICATION_COUNT_POS_LEFT = 0,/**< Count data is displaying at the left of the text */
370         NOTIFICATION_COUNT_POS_IN,
371                                 /**< Count data is displaying in the text */
372         NOTIFICATION_COUNT_POS_RIGHT,
373                                 /**< Count data is displaying at the right of the text */
374         NOTIFICATION_COUNT_POS_MAX,
375                                 /**< Max flag */
376 } notification_count_pos_type_e;
377
378 /**
379  * @brief Enumeration for notification variable parameter type.
380  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
381  */
382 typedef enum _notification_variable_type {
383         NOTIFICATION_VARIABLE_TYPE_NONE = -1,
384                                         /**< Variable parameter type is NONE */
385         NOTIFICATION_VARIABLE_TYPE_INT = 0,
386                                         /**< Variable parameter type is int */
387         NOTIFICATION_VARIABLE_TYPE_DOUBLE,
388                                         /**< Variable parameter type is double */
389         NOTIFICATION_VARIABLE_TYPE_STRING,
390                                         /**< Variable parameter type is string */
391         NOTIFICATION_VARIABLE_TYPE_COUNT,
392                                         /**< Variable parameter type is count */
393         NOTIFICATION_VARIABLE_TYPE_MAX,
394                                 /**< Max flag */
395 } notification_variable_type_e;
396
397 /**
398  * @brief Notification handle.
399  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
400  */
401 typedef struct _notification *notification_h;
402
403 /**
404  * @brief The structure for notification operation.
405  * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
406  */
407 typedef struct _notification_op {
408         notification_op_type_e type;    /**< Notification operation type */
409         int priv_id;    /**< private ID */
410         int extra_info_1;       /**< Reserved */
411         int extra_info_2;       /**< Reserved */
412         notification_h noti;    /**< Notification handler */
413 } notification_op;
414
415 /**
416  * @brief Enumeration for permission.
417  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
418  */
419 typedef enum notification_permission_type {
420         NOTIFICATION_PERMISSION_TYPE_NONE = 0,
421         NOTIFICATION_PERMISSION_TYPE_DELETE = 1,
422         NOTIFICATION_PERMISSION_TYPE_UPDATE = 2,
423 } notification_permission_type_e;
424
425 /**
426  * @}
427  */
428
429 #ifdef __cplusplus
430 }
431 #endif
432 #endif /* __NOTIFICATION_TYPE_H__ */
433