2 * Copyright (c) 2015 - 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.
18 #ifndef __TIZEN_APPFW_EVENT_H__
19 #define __TIZEN_APPFW_EVENT_H__
32 * @addtogroup CAPI_EVENT_MODULE
38 * @brief Event handle.
39 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
41 typedef struct event_handler *event_handler_h;
44 * @brief Event callback.
46 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
47 * @param[in] event_name The interested event name
48 * @param[in] event_data The data of interested event
49 * @param[in] user_data The user data set by event_add_event_handler()
50 * @see event_add_event_handler
52 typedef void (*event_cb)(const char *event_name, bundle *event_data, void *user_data);
55 * @brief Enumeration for Event Error.
56 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
59 EVENT_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
60 EVENT_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
61 EVENT_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
62 EVENT_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< Time out */
63 EVENT_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< IO error */
64 EVENT_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED /**< Permisiion denied */
68 * @brief Definition for system-event of battery : charger status.
69 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
70 * @remarks If there is earlier occurrence regarding this event, you will receive the event as soon as you register event handler for this event. You can use this earlier event-data as initial value.
71 * @see EVENT_KEY_BATTERY_CHARGER_STATUS
73 #define SYSTEM_EVENT_BATTERY_CHARGER_STATUS "tizen.system.event.battery_charger_status"
76 * @brief Definition for key of SYSTEM_EVENT_BATTERY_CHARGER_STATUS.
77 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
78 * @see EVENT_VAL_BATTERY_CHARGER_DISCONNECTED
79 * @see EVENT_VAL_BATTERY_CHARGER_CONNECTED
80 * @see EVENT_VAL_BATTERY_CHARGER_CHARGING
81 * @see EVENT_VAL_BATTERY_CHARGER_DISCHARGING
83 #define EVENT_KEY_BATTERY_CHARGER_STATUS "battery_charger_status"
86 * @brief Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS.
87 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
88 * @remarks charger disconnected
90 #define EVENT_VAL_BATTERY_CHARGER_DISCONNECTED "disconnected"
93 * @brief Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS.
94 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
95 * @remarks charger connected
97 #define EVENT_VAL_BATTERY_CHARGER_CONNECTED "connected"
100 * @brief Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS.
101 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
102 * @remarks charging is enabled
104 #define EVENT_VAL_BATTERY_CHARGER_CHARGING "charging"
107 * @brief Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS.
108 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
109 * @remarks charging is disabled
111 #define EVENT_VAL_BATTERY_CHARGER_DISCHARGING "discharging"
114 * @brief Definition for system-event of battery : level status.
115 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
116 * @see EVENT_KEY_BATTERY_LEVEL_STATUS
118 #define SYSTEM_EVENT_BATTERY_LEVEL_STATUS "tizen.system.event.battery_level_status"
121 * @brief Definition for key of SYSTEM_EVENT_BATTERY_LEVEL_STATUS.
122 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
123 * @see EVENT_VAL_BATTERY_LEVEL_EMPTY
124 * @see EVENT_VAL_BATTERY_LEVEL_CRITICAL
125 * @see EVENT_VAL_BATTERY_LEVEL_LOW
126 * @see EVENT_VAL_BATTERY_LEVEL_HIGH
127 * @see EVENT_VAL_BATTERY_LEVEL_FULL
129 #define EVENT_KEY_BATTERY_LEVEL_STATUS "battery_level_status"
132 * @brief Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
133 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
135 #define EVENT_VAL_BATTERY_LEVEL_EMPTY "empty"
138 * @brief Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
139 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
141 #define EVENT_VAL_BATTERY_LEVEL_CRITICAL "critical"
144 * @brief Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
145 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
147 #define EVENT_VAL_BATTERY_LEVEL_LOW "low"
150 * @brief Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
151 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
153 #define EVENT_VAL_BATTERY_LEVEL_HIGH "high"
156 * @brief Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
157 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
159 #define EVENT_VAL_BATTERY_LEVEL_FULL "full"
162 * @brief Definition for system-event of usb : status of usb connection.
163 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
164 * @see EVENT_KEY_USB_STATUS
166 #define SYSTEM_EVENT_USB_STATUS "tizen.system.event.usb_status"
169 * @brief Definition for key of SYSTEM_EVENT_USB_STATUS.
170 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
171 * @see EVENT_VAL_USB_DISCONNECTED
172 * @see EVENT_VAL_USB_CONNECTED
173 * @see EVENT_VAL_USB_AVAILABLE
175 #define EVENT_KEY_USB_STATUS "usb_status"
178 * @brief Definition for value of EVENT_KEY_USB_STATUS.
179 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
181 #define EVENT_VAL_USB_DISCONNECTED "disconnected"
184 * @brief Definition for value of EVENT_KEY_USB_STATUS.
185 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
186 * @remarks Connected but not-available.
188 #define EVENT_VAL_USB_CONNECTED "connected"
191 * @brief Definition for value of EVENT_KEY_USB_STATUS.
192 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
194 #define EVENT_VAL_USB_AVAILABLE "available"
197 * @brief Definition for system-event of ear-jack : status of ear-jack connection.
198 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
199 * @see EVENT_KEY_EARJACK_STATUS
201 #define SYSTEM_EVENT_EARJACK_STATUS "tizen.system.event.earjack_status"
204 * @brief Definition for key of SYSTEM_EVENT_EARJACK_STATUS.
205 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
206 * @see EVENT_VAL_EARJACK_DISCONNECTED
207 * @see EVENT_VAL_EARJACK_CONNECTED
209 #define EVENT_KEY_EARJACK_STATUS "earjack_status"
212 * @brief Definition for value of EVENT_KEY_EARJACK_STATUS.
213 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
215 #define EVENT_VAL_EARJACK_DISCONNECTED "disconnected"
218 * @brief Definition for value of EVENT_KEY_EARJACK_STATUS.
219 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
221 #define EVENT_VAL_EARJACK_CONNECTED "connected"
224 * @brief Definition for system-event of display : state of display.
225 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
226 * @privilege %http://tizen.org/privilege/display
227 * @remarks If you want to receive this event, you must declare this privilege.
228 * @see EVENT_KEY_DISPLAY_STATE
230 #define SYSTEM_EVENT_DISPLAY_STATE "tizen.system.event.display_state"
233 * @brief Definition for key of SYSTEM_EVENT_DISPLAY_STATE.
234 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
235 * @see EVENT_VAL_DISPLAY_NORMAL
236 * @see EVENT_VAL_DISPLAY_DIM
237 * @see EVENT_VAL_DISPLAY_OFF
239 #define EVENT_KEY_DISPLAY_STATE "display_state"
242 * @brief Definition for value of EVENT_KEY_DISPLAY_STATE.
243 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
245 #define EVENT_VAL_DISPLAY_NORMAL "normal"
248 * @brief Definition for value of EVENT_KEY_DISPLAY_STATE.
249 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
251 #define EVENT_VAL_DISPLAY_DIM "dim"
254 * @brief Definition for value of EVENT_KEY_DISPLAY_STATE.
255 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
257 #define EVENT_VAL_DISPLAY_OFF "off"
260 * @brief Definition for system-event of system : boot completion.
261 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
262 * @remarks There is no corresponding key/value.
263 * @remarks You can treat the initial value as "false" before you receive this event.
264 * @remarks If it's already boot-completed state before you regiser event handler, you can receive the event as soon as you register the event handler.
266 #define SYSTEM_EVENT_BOOT_COMPLETED "tizen.system.event.boot_completed"
269 * @brief Definition for system-event of system : shutdown.
270 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
271 * @remarks There is no corresponding key/value.
272 * @remarks You can treat the inital value as "false" before you receive this event.
273 * @remarks If it's already shutting-down state before you regiser event handler, you can receive the event as soon as you register the event handler.
275 #define SYSTEM_EVENT_SYSTEM_SHUTDOWN "tizen.system.event.system_shutdown"
278 * @brief Definition for system-event of system : low memory.
279 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
280 * @see EVENT_KEY_LOW_MEMORY
282 #define SYSTEM_EVENT_LOW_MEMORY "tizen.system.event.low_memory"
285 * @brief Definition for key of SYSTEM_EVENT_LOW_MEMORY.
286 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
287 * @remarks If there is earlier occurrence regarding this event, you will receive the event as soon as you register event handler for this event. You can use this earlier event-data as initial value.
288 * @see EVENT_VAL_MEMORY_NORMAL
289 * @see EVENT_VAL_MEMORY_SOFT_WARNING
290 * @see EVENT_VAL_MEMORY_HARD_WARNING
292 #define EVENT_KEY_LOW_MEMORY "low_memory"
295 * @brief Definition for value of EVENT_KEY_LOW_MEMORY.
296 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
298 #define EVENT_VAL_MEMORY_NORMAL "normal"
301 * @brief Definition for value of EVENT_KEY_LOW_MEMORY.
302 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
304 #define EVENT_VAL_MEMORY_SOFT_WARNING "soft_warning"
307 * @brief Definition for value of EVENT_KEY_LOW_MEMORY.
308 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
310 #define EVENT_VAL_MEMORY_HARD_WARNING "hard_warning"
313 * @brief Definition for system-event of wifi : state of wifi.
314 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
315 * @privilege %http://tizen.org/privilege/network.get
316 * @remarks If you want to receive this event, you must declare this privilege.
317 * @see EVENT_KEY_WIFI_STATE
319 #define SYSTEM_EVENT_WIFI_STATE "tizen.system.event.wifi_state"
322 * @brief Definition for key of SYSTEM_EVENT_WIFI_STATE.
323 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
324 * @see EVENT_VAL_WIFI_OFF
325 * @see EVENT_VAL_WIFI_ON
326 * @see EVENT_VAL_WIFI_CONNECTED
328 #define EVENT_KEY_WIFI_STATE "wifi_state"
331 * @brief Definition for value of EVENT_KEY_WIFI_STATE.
332 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
334 #define EVENT_VAL_WIFI_OFF "off"
337 * @brief Definition for value of EVENT_KEY_WIFI_STATE.
338 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
340 #define EVENT_VAL_WIFI_ON "on"
343 * @brief Definition for value of EVENT_KEY_WIFI_STATE.
344 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
346 #define EVENT_VAL_WIFI_CONNECTED "connected"
349 * @brief Definition for system-event of bluetooth : status of bluetooth.
350 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
351 * @see EVENT_KEY_BT_STATE
352 * @see EVENT_KEY_BT_LE_STATE
353 * @see EVENT_KEY_BT_TRANSFERING_STATE
355 #define SYSTEM_EVENT_BT_STATE "tizen.system.event.bt_state"
358 * @brief Definition for key of SYSTEM_EVENT_BT_STATE.
359 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
360 * @see EVENT_VAL_BT_STATE_OFF
361 * @see EVENT_VAL_BT_STATE_ON
363 #define EVENT_KEY_BT_STATE "bt_state"
366 * @brief Definition for value of EVENT_KEY_BT_STATE.
367 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
369 #define EVENT_VAL_BT_OFF "off"
372 * @brief Definition for value of EVENT_KEY_BT_STATE.
373 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
375 #define EVENT_VAL_BT_ON "on"
378 * @brief Definition for key of SYSTEM_EVENT_BT_STATE.
379 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
380 * @see EVENT_VAL_BT_LE_STATE_OFF
381 * @see EVENT_VAL_BT_LE_STATE_ON
383 #define EVENT_KEY_BT_LE_STATE "bt_le_state"
386 * @brief Definition for value of EVENT_KEY_BT_LE_STATE.
387 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
389 #define EVENT_VAL_BT_LE_OFF "off"
392 * @brief Definition for value of EVENT_KEY_BT_LE_STATE.
393 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
395 #define EVENT_VAL_BT_LE_ON "on"
398 * @brief Definition for key of SYSTEM_EVENT_BT_STATE.
399 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
400 * @remarks If it's already transfering state before you register this event, you can't receive the event regarding current transfer but you can receive the following transfers.
401 * @see EVENT_VAL_BT_NON_TRANSFERING
402 * @see EVENT_VAL_BT_TRANSFERING
404 #define EVENT_KEY_BT_TRANSFERING_STATE "bt_transfering_state"
407 * @brief Definition for value of EVENT_KEY_BT_TRANSFERING_STATE.
408 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
410 #define EVENT_VAL_BT_NON_TRANSFERING "non_transfering"
413 * @brief Definition for value of EVENT_KEY_BT_TRANSFERING_STATE.
414 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
416 #define EVENT_VAL_BT_TRANSFERING "transfering"
419 * @brief Definition for system-event of location : enable state of location.
420 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
421 * @see EVENT_KEY_LOCATION_ENABLE_STATE
423 #define SYSTEM_EVENT_LOCATION_ENABLE_STATE "tizen.system.event.location_enable_state"
426 * @brief Definition for key of SYSTEM_EVENT_LOCATION_ENABLE_STATE.
427 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
428 * @see EVENT_VAL_LOCATION_DISABLED
429 * @see EVENT_VAL_LOCATION_ENABLED
431 #define EVENT_KEY_LOCATION_ENABLE_STATE "location_enable_state"
434 * @brief Definition for value of EVENT_KEY_LOCATION_ENABLE_STATE.
435 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
437 #define EVENT_VAL_LOCATION_DISABLED "disabled"
440 * @brief Definition for value of EVENT_KEY_LOCATION_ENABLE_STATE.
441 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
443 #define EVENT_VAL_LOCATION_ENABLED "enabled"
446 * @brief Definition for system-event of location : enable state of gps.
447 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
448 * @see EVENT_KEY_GPS_ENABLE_STATE
450 #define SYSTEM_EVENT_GPS_ENABLE_STATE "tizen.system.event.gps_enable_state"
453 * @brief Definition for key of SYSTEM_EVENT_GPS_ENABLE_STATE.
454 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
455 * @see EVENT_VAL_GPS_DISABLED
456 * @see EVENT_VAL_GPS_ENABLED
458 #define EVENT_KEY_GPS_ENABLE_STATE "gps_enable_state"
461 * @brief Definition for value of EVENT_KEY_GPS_ENABLE_STATE.
462 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
464 #define EVENT_VAL_GPS_DISABLED "disabled"
467 * @brief Definition for value of EVENT_KEY_GPS_ENABLE_STATE.
468 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
470 #define EVENT_VAL_GPS_ENABLED "enabled"
473 * @brief Definition for system-event of location : enable state of nps.
474 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
475 * @see EVENT_KEY_NPS_ENABLE_STATE
477 #define SYSTEM_EVENT_NPS_ENABLE_STATE "tizen.system.event.nps_enable_state"
480 * @brief Definition for key of SYSTEM_EVENT_NPS_ENABLE_STATE.
481 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
482 * @see EVENT_VAL_NPS_DISABLED
483 * @see EVENT_VAL_NPS_ENABLED
485 #define EVENT_KEY_NPS_ENABLE_STATE "nps_enable_state"
488 * @brief Definition for value of EVENT_KEY_NPS_ENABLE_STATE.
489 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
491 #define EVENT_VAL_NPS_DISABLED "disabled"
494 * @brief Definition for value of EVENT_KEY_NPS_ENABLE_STATE.
495 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
497 #define EVENT_VAL_NPS_ENABLED "enabled"
500 * @brief Definition for system-event of message : incoming msg.
501 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
502 * @privilege %http://tizen.org/privilege/message.read
503 * @remarks If you want to receive this event, you must declare this privilege.
504 * @see EVENT_KEY_MSG_TYPE
505 * @see EVENT_KEY_MSG_ID
507 #define SYSTEM_EVENT_INCOMING_MSG "tizen.system.event.incoming_msg"
510 * @brief Definition for key of SYSTEM_EVENT_INCOMING_MSG.
511 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
513 * @see EVENT_VAL_PUSH
516 #define EVENT_KEY_MSG_TYPE "msg_type"
519 * @brief Definition for value of EVENT_KEY_MSG_TYPE.
520 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
522 #define EVENT_VAL_SMS "sms"
525 * @brief Definition for value of EVENT_KEY_MSG_TYPE.
528 #define EVENT_VAL_MMS "mms"
531 * @brief Definition for value of EVENT_KEY_MSG_TYPE.
532 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
534 #define EVENT_VAL_PUSH "push"
537 * @brief Definition for value of EVENT_KEY_MSG_TYPE.
538 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
540 #define EVENT_VAL_CB "cb"
543 * @brief Definition for key of SYSTEM_EVENT_INCOMING_MSG.
544 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
545 * @remarks The value of this key is a string of unsigned int value : new message id.
547 #define EVENT_KEY_MSG_ID "msg_id"
550 * @brief Definition for system-event of message : outgoing msg.
552 * @privilege %http://tizen.org/privilege/message.read
553 * @remarks If you want to receive this event, you must declare this privilege.
554 * @see EVENT_KEY_OUT_MSG_TYPE
555 * @see EVENT_KEY_OUT_MSG_ID
557 #define SYSTEM_EVENT_OUTGOING_MSG "tizen.system.event.outgoing_msg"
560 * @brief Definition for key of SYSTEM_EVENT_OUTGOING_MSG.
562 * @see EVENT_VAL_OUT_MSG_SMS
563 * @see EVENT_VAL_OUT_MSG_MMS
565 #define EVENT_KEY_OUT_MSG_TYPE "msg_type"
568 * @brief Definition for value of EVENT_KEY_OUT_MSG_TYPE.
571 #define EVENT_VAL_SMS "sms"
574 * @brief Definition for value of EVENT_KEY_OUT_MSG_TYPE.
577 #define EVENT_VAL_MMS "mms"
580 * @brief Definition for key of SYSTEM_EVENT_OUTGOING_MSG.
582 * @remarks The value of this key is a string of unsigned int value : new message id.
584 #define EVENT_KEY_OUT_MSG_ID "msg_id"
587 * @brief Definition for system-event of setting : time changed.
588 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
589 * @remarks There is no corresponding key/value.
590 * @remarks You can use a @a alarm_get_current_time() API for checking new time after receiving this event.
592 #define SYSTEM_EVENT_TIME_CHANGED "tizen.system.event.time_changed"
595 * @brief Definition for system-event of setting : timezone setting.
596 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
597 * @see EVENT_KEY_TIME_ZONE
599 #define SYSTEM_EVENT_TIME_ZONE "tizen.system.event.time_zone"
602 * @brief Definition for key of SYSTEM_EVENT_TIME_ZONE.
603 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
604 * @remarks The value of this key is timezone value of tz database,
605 * for example, "Asia/Seoul", "America/New_York",
606 * refer to the Time Zone Database of IANA.
608 #define EVENT_KEY_TIME_ZONE "time_zone"
611 * @brief Definition for system-event of setting : hour format.
612 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
613 * @see EVENT_KEY_HOUR_FORMAT
615 #define SYSTEM_EVENT_HOUR_FORMAT "tizen.system.event.hour_format"
618 * @brief Definition for key of SYSTEM_EVENT_HOUR_FORMAT.
619 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
620 * @see EVENT_VAL_HOURFORMAT_12
621 * @see EVENT_VAL_HOURFORMAT_24
623 #define EVENT_KEY_HOUR_FORMAT "hour_format"
626 * @brief Definition for value of EVENT_KEY_HOUR_FORMAT.
627 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
629 #define EVENT_VAL_HOURFORMAT_12 "12"
632 * @brief Definition for value of EVENT_KEY_HOUR_FORMAT.
633 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
635 #define EVENT_VAL_HOURFORMAT_24 "24"
638 * @brief Definition for system-event of setting : language setting.
639 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
640 * @see EVENT_KEY_LANGUAGE_SET
642 #define SYSTEM_EVENT_LANGUAGE_SET "tizen.system.event.language_set"
645 * @brief Definition for key of SYSTEM_EVENT_LANGUAGE_SET.
646 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
647 * @remarks The value of this key is full name of locale, for example,
648 * "ko_KR.UTF8" : in case of Korean language
649 * "en_US.UTF8" : in case of USA language,
650 * refer to linux locale info.
652 #define EVENT_KEY_LANGUAGE_SET "language_set"
655 * @brief Definition for system-event of setting : region format.
656 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
657 * @see EVENT_KEY_REGION_FORMAT
659 #define SYSTEM_EVENT_REGION_FORMAT "tizen.system.event.region_format"
662 * @brief Definition for key of SYSTEM_EVENT_REGION_FORMAT.
663 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
664 * @remarks The value of this key is full name of locale, for example,
665 * "ko_KR.UTF8" : in case of Korean region format
666 * "en_US.UTF8" : in case of USA region format,
667 * refer to linux locale info.
669 #define EVENT_KEY_REGION_FORMAT "region_format"
672 * @brief Definition for system-event of setting : silent_mode.
673 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
674 * @see EVENT_KEY_SILENT_MODE
676 #define SYSTEM_EVENT_SILENT_MODE "tizen.system.event.silent_mode"
679 * @brief Definition for key of SYSTEM_EVENT_SILENT_MODE.
680 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
681 * @see EVENT_VAL_SILENTMODE_ON
682 * @see EVENT_VAL_SILENTMODE_OFF
684 #define EVENT_KEY_SILENT_MODE "silent_mode"
687 * @brief Definition for value of EVENT_KEY_SILENT_MODE.
688 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
690 #define EVENT_VAL_SILENTMODE_ON "on"
693 * @brief Definition for value of EVENT_KEY_SILENT_MODE.
694 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
696 #define EVENT_VAL_SILENTMODE_OFF "off"
699 * @brief Definition for system-event of setting : state of vibration.
700 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
701 * @see EVENT_KEY_VIBRATION_STATE
703 #define SYSTEM_EVENT_VIBRATION_STATE "tizen.system.event.vibration_state"
706 * @brief Definition for key of SYSTEM_EVENT_VIBRATION_STATE.
707 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
708 * @see EVENT_VAL_VIBRATION_ON
709 * @see EVENT_VAL_VIBRATION_OFF
711 #define EVENT_KEY_VIBRATION_STATE "vibration_state"
714 * @brief Definition for value of EVENT_KEY_VIBRATION_STATE.
715 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
717 #define EVENT_VAL_VIBRATION_ON "on"
720 * @brief Definition for value of EVENT_KEY_VIBRATION_STATE.
721 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
723 #define EVENT_VAL_VIBRATION_OFF "off"
726 * @brief Definition for system-event of setting : state of screen's auto-rotation.
727 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
728 * @see EVENT_KEY_SCREEN_AUTOROTATE_STATE
730 #define SYSTEM_EVENT_SCREEN_AUTOROTATE_STATE "tizen.system.event.screen_autorotate_state"
733 * @brief Definition for key of SYSTEM_EVENT_SCREEN_AUTOROTATE_STATE.
734 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
735 * @see EVENT_VAL_SCREEN_AUTOROTATE_ON
736 * @see EVENT_VAL_SCREEN_AUTOROTATE_OFF
738 #define EVENT_KEY_SCREEN_AUTOROTATE_STATE "screen_autorotate_state"
741 * @brief Definition for value of EVENT_KEY_SCREEN_AUTOROTATE_STATE.
742 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
744 #define EVENT_VAL_SCREEN_AUTOROTATE_ON "on"
747 * @brief Definition for value of EVENT_KEY_SCREEN_AUTOROTATE_STATE.
748 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
750 #define EVENT_VAL_SCREEN_AUTOROTATE_OFF "off"
753 * @brief Definition for system-event of setting : state of mobile data.
754 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
755 * @see EVENT_KEY_MOBILE_DATA_STATE
757 #define SYSTEM_EVENT_MOBILE_DATA_STATE "tizen.system.event.mobile_data_state"
760 * @brief Definition for key of SYSTEM_EVENT_MOBILE_DATA_STATE.
761 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
762 * @see EVENT_VAL_MOBILE_DATA_OFF
763 * @see EVENT_VAL_MOBILE_DATA_ON
765 #define EVENT_KEY_MOBILE_DATA_STATE "mobile_data_state"
768 * @brief Definition for value of EVENT_KEY_MOBILE_DATA_STATE.
769 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
771 #define EVENT_VAL_MOBILE_DATA_OFF "off"
774 * @brief Definition for value of EVENT_KEY_MOBILE_DATA_STATE.
775 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
777 #define EVENT_VAL_MOBILE_DATA_ON "on"
780 * @brief Definition for system-event of setting : state of data roaming.
781 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
782 * @see EVENT_KEY_DATA_ROAMING_STATE
784 #define SYSTEM_EVENT_DATA_ROAMING_STATE "tizen.system.event.data_roaming_state"
787 * @brief Definition for key of SYSTEM_EVENT_DATA_ROAMING_STATE.
788 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
789 * @see EVENT_VAL_DATA_ROAMING_OFF
790 * @see EVENT_VAL_DATA_ROAMING_ON
792 #define EVENT_KEY_DATA_ROAMING_STATE "data_roaming_state"
795 * @brief Definition for value of EVENT_KEY_DATA_ROAMING_STATE.
796 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
798 #define EVENT_VAL_DATA_ROAMING_OFF "off"
801 * @brief Definition for value of EVENT_KEY_DATA_ROAMING_STATE.
802 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
804 #define EVENT_VAL_DATA_ROAMING_ON "on"
807 * @brief Definition for system-event of setting : font setting.
808 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
809 * @see EVENT_KEY_FONT_SET
811 #define SYSTEM_EVENT_FONT_SET "tizen.system.event.font_set"
814 * @brief Definition for key of SYSTEM_EVENT_FONT_SET.
815 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
816 * @remarks The value of this key is font name of string type by font-config.
818 #define EVENT_KEY_FONT_SET "font_set"
821 * @brief Definition for system-event of network : status of network.
823 * @see EVENT_KEY_NETWORK_STATUS
825 #define SYSTEM_EVENT_NETWORK_STATUS "tizen.system.event.network_status"
828 * @brief Definition for key of SYSTEM_EVENT_NETWORK_STATUS.
830 * @remarks The values of this event indicate the type of the current profile for data connection.
831 * @see EVENT_VAL_NETWORK_DISCONNECTED
832 * @see EVENT_VAL_NETWORK_WIFI
833 * @see EVENT_VAL_NETWORK_CELLULAR
834 * @see EVENT_VAL_NETWORK_ETHERNET
835 * @see EVENT_VAL_NETWORK_BT
836 * @see EVENT_VAL_NETWORK_NET_PROXY
838 #define EVENT_KEY_NETWORK_STATUS "network_status"
841 * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
844 #define EVENT_VAL_NETWORK_DISCONNECTED "disconnected"
847 * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
850 #define EVENT_VAL_NETWORK_WIFI "wifi"
853 * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
856 #define EVENT_VAL_NETWORK_CELLULAR "cellular"
859 * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
862 #define EVENT_VAL_NETWORK_ETHERNET "ethernet"
865 * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
868 #define EVENT_VAL_NETWORK_BT "bt"
871 * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
874 #define EVENT_VAL_NETWORK_NET_PROXY "net_proxy"
877 * @brief Adds the event handler for receiving event-data of interested events.
879 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
880 * @remarks If you want to add the privileged event, you MUST declare right privilge first. Unless that, this function returns #EVENT_ERROR_PERMISSION_DENIED. The privileged events are commented on remarks of it's definitions.
881 * @param[in] event_name The interested event name
882 * @param[in] callback The event callback called when the event occurs
883 * @param[in] user_data The user data for passing to callback
884 * @param[out] event_handler The event handler
885 * @return 0 on success, otherwise a negative error value
886 * @retval #EVENT_ERROR_NONE Successful
887 * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
888 * @retval #EVENT_ERROR_PERMISSION_DENIED Permission denied
889 * @retval #EVENT_ERROR_IO_ERROR Adding handler failed
890 * @retval #EVENT_ERROR_OUT_OF_MEMORY Out of memory
892 int event_add_event_handler(const char *event_name, event_cb callback, void *user_data,
893 event_handler_h *event_handler);
896 * @brief Removes the registered event handler.
898 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
899 * @param[in] event_handler The event handler
900 * @return 0 on success, otherwise a negative error value
901 * @retval #EVENT_ERROR_NONE Successful
902 * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
904 int event_remove_event_handler(event_handler_h event_handler);
907 * @brief Sends the User-Event to receiver applications.
909 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
910 * @remarks The format of User-Event's name MUST be "event.{sender's appid}.{user-defined name}", refer to 'The name-format of User-Event' section, If the event_name is invalid, the function returns #EVENT_ERROR_IO_ERROR.
911 * @param[in] event_name The event's name to send
912 * @param[in] event_data The event's data to send
913 * @return 0 on success, otherwise a negative error value
914 * @retval #EVENT_ERROR_NONE Successful
915 * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
916 * @retval #EVENT_ERROR_IO_ERROR Sending operation failed
918 int event_publish_app_event(const char *event_name, bundle *event_data);
921 * @brief Sends the User-Event to trusted receiver-applications.
923 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
924 * @remarks The application which has same certification with sender can receive the event.
925 * @remarks The format of User-Event's name MUST be "event.{sender's appid}.{user-defined name}", refer to 'The name-format of User-Event' section, If the event_name is invalid, the function returns #EVENT_ERROR_IO_ERROR.
926 * @param[in] event_name The event's name to send
927 * @param[in] event_data The event's data to send
928 * @return 0 on success, otherwise a negative error value
929 * @retval #EVENT_ERROR_NONE Successful
930 * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
931 * @retval #EVENT_ERROR_IO_ERROR Sending operation failed
933 int event_publish_trusted_app_event(const char *event_name, bundle *event_data);
936 * @brief Keeps last User-Event data for receiver applications.
939 * @remarks The receiver applications will receive this last event data after adding their new handlers via event_add_event_handler() API since the sender application called this API.
940 * @remarks If a sender application sends same event via trusted API and non-trusted API, then a trusted receiver will get latest data regardless of trusted or non-trusted, but non-trusted receiver will get the last data only from non-trusted API.
941 * @remarks The effect of this API continues during runtime. That means when the sender application process restarts, the sender application needs to call this api again to make the event to keep the last event.
942 * @param[in] event_name The event's name to keep last event data
943 * @return 0 on success, otherwise a negative error value
944 * @retval #EVENT_ERROR_NONE Successful
945 * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
946 * @retval #EVENT_ERROR_IO_ERROR Sending operation failed
947 * @retval #EVENT_ERROR_OUT_OF_MEMORY Out of memory
949 int event_keep_last_event_data(const char *event_name);
959 #endif /* __TIZEN_APPFW_EVENT_H__ */