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.
526 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
528 #define EVENT_VAL_PUSH "push"
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_CB "cb"
537 * @brief Definition for key of SYSTEM_EVENT_INCOMING_MSG.
538 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
539 * @remarks The value of this key is a string of unsigned int value : new message id.
541 #define EVENT_KEY_MSG_ID "msg_id"
544 * @brief Definition for system-event of setting : time changed.
545 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
546 * @remarks There is no corresponding key/value.
547 * @remarks You can use a @a alarm_get_current_time() API for checking new time after receiving this event.
549 #define SYSTEM_EVENT_TIME_CHANGED "tizen.system.event.time_changed"
552 * @brief Definition for system-event of setting : timezone setting.
553 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
554 * @see EVENT_KEY_TIME_ZONE
556 #define SYSTEM_EVENT_TIME_ZONE "tizen.system.event.time_zone"
559 * @brief Definition for key of SYSTEM_EVENT_TIME_ZONE.
560 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
561 * @remarks The value of this key is timezone value of tz database,
562 * for example, "Asia/Seoul", "America/New_York",
563 * refer to the Time Zone Database of IANA.
565 #define EVENT_KEY_TIME_ZONE "time_zone"
568 * @brief Definition for system-event of setting : hour format.
569 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
570 * @see EVENT_KEY_HOUR_FORMAT
572 #define SYSTEM_EVENT_HOUR_FORMAT "tizen.system.event.hour_format"
575 * @brief Definition for key of SYSTEM_EVENT_HOUR_FORMAT.
576 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
577 * @see EVENT_VAL_HOURFORMAT_12
578 * @see EVENT_VAL_HOURFORMAT_24
580 #define EVENT_KEY_HOUR_FORMAT "hour_format"
583 * @brief Definition for value of EVENT_KEY_HOUR_FORMAT.
584 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
586 #define EVENT_VAL_HOURFORMAT_12 "12"
589 * @brief Definition for value of EVENT_KEY_HOUR_FORMAT.
590 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
592 #define EVENT_VAL_HOURFORMAT_24 "24"
595 * @brief Definition for system-event of setting : language setting.
596 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
597 * @see EVENT_KEY_LANGUAGE_SET
599 #define SYSTEM_EVENT_LANGUAGE_SET "tizen.system.event.language_set"
602 * @brief Definition for key of SYSTEM_EVENT_LANGUAGE_SET.
603 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
604 * @remarks The value of this key is full name of locale, for example,
605 * "ko_KR.UTF8" : in case of Korean language
606 * "en_US.UTF8" : in case of USA language,
607 * refer to linux locale info.
609 #define EVENT_KEY_LANGUAGE_SET "language_set"
612 * @brief Definition for system-event of setting : region format.
613 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
614 * @see EVENT_KEY_REGION_FORMAT
616 #define SYSTEM_EVENT_REGION_FORMAT "tizen.system.event.region_format"
619 * @brief Definition for key of SYSTEM_EVENT_REGION_FORMAT.
620 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
621 * @remarks The value of this key is full name of locale, for example,
622 * "ko_KR.UTF8" : in case of Korean region format
623 * "en_US.UTF8" : in case of USA region format,
624 * refer to linux locale info.
626 #define EVENT_KEY_REGION_FORMAT "region_format"
629 * @brief Definition for system-event of setting : silent_mode.
630 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
631 * @see EVENT_KEY_SILENT_MODE
633 #define SYSTEM_EVENT_SILENT_MODE "tizen.system.event.silent_mode"
636 * @brief Definition for key of SYSTEM_EVENT_SILENT_MODE.
637 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
638 * @see EVENT_VAL_SILENTMODE_ON
639 * @see EVENT_VAL_SILENTMODE_OFF
641 #define EVENT_KEY_SILENT_MODE "silent_mode"
644 * @brief Definition for value of EVENT_KEY_SILENT_MODE.
645 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
647 #define EVENT_VAL_SILENTMODE_ON "on"
650 * @brief Definition for value of EVENT_KEY_SILENT_MODE.
651 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
653 #define EVENT_VAL_SILENTMODE_OFF "off"
656 * @brief Definition for system-event of setting : state of vibration.
657 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
658 * @see EVENT_KEY_VIBRATION_STATE
660 #define SYSTEM_EVENT_VIBRATION_STATE "tizen.system.event.vibration_state"
663 * @brief Definition for key of SYSTEM_EVENT_VIBRATION_STATE.
664 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
665 * @see EVENT_VAL_VIBRATION_ON
666 * @see EVENT_VAL_VIBRATION_OFF
668 #define EVENT_KEY_VIBRATION_STATE "vibration_state"
671 * @brief Definition for value of EVENT_KEY_VIBRATION_STATE.
672 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
674 #define EVENT_VAL_VIBRATION_ON "on"
677 * @brief Definition for value of EVENT_KEY_VIBRATION_STATE.
678 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
680 #define EVENT_VAL_VIBRATION_OFF "off"
683 * @brief Definition for system-event of setting : state of screen's auto-rotation.
684 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
685 * @see EVENT_KEY_SCREEN_AUTOROTATE_STATE
687 #define SYSTEM_EVENT_SCREEN_AUTOROTATE_STATE "tizen.system.event.screen_autorotate_state"
690 * @brief Definition for key of SYSTEM_EVENT_SCREEN_AUTOROTATE_STATE.
691 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
692 * @see EVENT_VAL_SCREEN_AUTOROTATE_ON
693 * @see EVENT_VAL_SCREEN_AUTOROTATE_OFF
695 #define EVENT_KEY_SCREEN_AUTOROTATE_STATE "screen_autorotate_state"
698 * @brief Definition for value of EVENT_KEY_SCREEN_AUTOROTATE_STATE.
699 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
701 #define EVENT_VAL_SCREEN_AUTOROTATE_ON "on"
704 * @brief Definition for value of EVENT_KEY_SCREEN_AUTOROTATE_STATE.
705 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
707 #define EVENT_VAL_SCREEN_AUTOROTATE_OFF "off"
710 * @brief Definition for system-event of setting : state of mobile data.
711 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
712 * @see EVENT_KEY_MOBILE_DATA_STATE
714 #define SYSTEM_EVENT_MOBILE_DATA_STATE "tizen.system.event.mobile_data_state"
717 * @brief Definition for key of SYSTEM_EVENT_MOBILE_DATA_STATE.
718 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
719 * @see EVENT_VAL_MOBILE_DATA_OFF
720 * @see EVENT_VAL_MOBILE_DATA_ON
722 #define EVENT_KEY_MOBILE_DATA_STATE "mobile_data_state"
725 * @brief Definition for value of EVENT_KEY_MOBILE_DATA_STATE.
726 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
728 #define EVENT_VAL_MOBILE_DATA_OFF "off"
731 * @brief Definition for value of EVENT_KEY_MOBILE_DATA_STATE.
732 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
734 #define EVENT_VAL_MOBILE_DATA_ON "on"
737 * @brief Definition for system-event of setting : state of data roaming.
738 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
739 * @see EVENT_KEY_DATA_ROAMING_STATE
741 #define SYSTEM_EVENT_DATA_ROAMING_STATE "tizen.system.event.data_roaming_state"
744 * @brief Definition for key of SYSTEM_EVENT_DATA_ROAMING_STATE.
745 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
746 * @see EVENT_VAL_DATA_ROAMING_OFF
747 * @see EVENT_VAL_DATA_ROAMING_ON
749 #define EVENT_KEY_DATA_ROAMING_STATE "data_roaming_state"
752 * @brief Definition for value of EVENT_KEY_DATA_ROAMING_STATE.
753 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
755 #define EVENT_VAL_DATA_ROAMING_OFF "off"
758 * @brief Definition for value of EVENT_KEY_DATA_ROAMING_STATE.
759 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
761 #define EVENT_VAL_DATA_ROAMING_ON "on"
764 * @brief Definition for system-event of setting : font setting.
765 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
766 * @see EVENT_KEY_FONT_SET
768 #define SYSTEM_EVENT_FONT_SET "tizen.system.event.font_set"
771 * @brief Definition for key of SYSTEM_EVENT_FONT_SET.
772 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
773 * @remarks The value of this key is font name of string type by font-config.
775 #define EVENT_KEY_FONT_SET "font_set"
778 * @brief Definition for system-event of network : status of network.
780 * @see EVENT_KEY_NETWORK_STATUS
782 #define SYSTEM_EVENT_NETWORK_STATUS "tizen.system.event.network_status"
785 * @brief Definition for key of SYSTEM_EVENT_NETWORK_STATUS.
787 * @remarks The values of this event indicate the type of the current profile for data connection.
788 * @see EVENT_VAL_NETWORK_DISCONNECTED
789 * @see EVENT_VAL_NETWORK_WIFI
790 * @see EVENT_VAL_NETWORK_CELLULAR
791 * @see EVENT_VAL_NETWORK_ETHERNET
792 * @see EVENT_VAL_NETWORK_BT
793 * @see EVENT_VAL_NETWORK_NET_PROXY
795 #define EVENT_KEY_NETWORK_STATUS "network_status"
798 * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
801 #define EVENT_VAL_NETWORK_DISCONNECTED "disconnected"
804 * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
807 #define EVENT_VAL_NETWORK_WIFI "wifi"
810 * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
813 #define EVENT_VAL_NETWORK_CELLULAR "cellular"
816 * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
819 #define EVENT_VAL_NETWORK_ETHERNET "ethernet"
822 * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
825 #define EVENT_VAL_NETWORK_BT "bt"
828 * @brief Definition for value of EVENT_KEY_NETWORK_STATUS.
831 #define EVENT_VAL_NETWORK_NET_PROXY "net_proxy"
834 * @brief Adds the event handler for receiving event-data of interested events.
836 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
837 * @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.
838 * @param[in] event_name The interested event name
839 * @param[in] callback The event callback called when the event occurs
840 * @param[in] user_data The user data for passing to callback
841 * @param[out] event_handler The event handler
842 * @return 0 on success, otherwise a negative error value
843 * @retval #EVENT_ERROR_NONE Successful
844 * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
845 * @retval #EVENT_ERROR_PERMISSION_DENIED Permission denied
846 * @retval #EVENT_ERROR_IO_ERROR Adding handler failed
847 * @retval #EVENT_ERROR_OUT_OF_MEMORY Out of memory
849 int event_add_event_handler(const char *event_name, event_cb callback, void *user_data,
850 event_handler_h *event_handler);
853 * @brief Removes the registered event handler.
855 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
856 * @param[in] event_handler The event handler
857 * @return 0 on success, otherwise a negative error value
858 * @retval #EVENT_ERROR_NONE Successful
859 * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
861 int event_remove_event_handler(event_handler_h event_handler);
864 * @brief Sends the User-Event to receiver applications.
866 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
867 * @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.
868 * @param[in] event_name The event's name to send
869 * @param[in] event_data The event's data to send
870 * @return 0 on success, otherwise a negative error value
871 * @retval #EVENT_ERROR_NONE Successful
872 * @retval #EVENT_ERROR_INVALID_PARAMETER Invalid parameter
873 * @retval #EVENT_ERROR_IO_ERROR Sending operation failed
875 int event_publish_app_event(const char *event_name, bundle *event_data);
878 * @brief Sends the User-Event to trusted receiver-applications.
880 * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
881 * @remarks The application which has same certification with sender can receive the event.
882 * @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.
883 * @param[in] event_name The event's name to send
884 * @param[in] event_data The event's data to send
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_IO_ERROR Sending operation failed
890 int event_publish_trusted_app_event(const char *event_name, bundle *event_data);
900 #endif /* __TIZEN_APPFW_EVENT_H__ */