Tizen Native API
6.5
|
The Event API provides functions to serve publication and subscription of the event.
Required Header
#include <app_event.h>
Overview
The Event API provides functions to broadcast user-defined event.
- event_publish_app_event()
- event_publish_trusted_app_event() If you want to send an event to trusted application, you can use event_publish_trusted_app_event() API. Only applications which have same signature with sender application can receive the event. The Event API provides functions to add and remove the event handler for event subscription. The event handler's function will be called when the interested event occurs. Adding multiple event handlers to one event is possible. There are two types of events:
- User-Event is user-defined event.
- System-Event is pre-defined platform event. See definitions for system event. NOTE: You can't receive the system-event which is not supported on the target device, even if you register event handler for that event. Some system-events require the privilege. (Refer to Privileged System-Events) The type of event data is bundle type.
- For System-Event, see definitions for key and value of system event.
The name-format of User-Event
The format of the User-Event's name MUST be "event.{sender's appid}.{user-defined name}", unless the API calls using event_name will fail. The {user-defined name} have some restrictions.
- Must have length of Min 1 byte and Max 127 bytes.
- Must only contain the characters("[A~Z][a~z][0~9]_") and not begin with a digit. For example, "event.org.tizen.testapp.user_event_1".
Launch-On-Event (Service Application only)
Service application can be launched by event triggering. For Launch-On-Event,
- The APP_CONTROL_OPERATION_LAUNCH_ON_EVENT must be defined in the manifest file.
- The URI name represents event name and the format is "event://{event name"}". For URI example, "event://tizen.system.event.battery_charger_status". (System-Event)
- The APP_CONTROL_OPERATION_LAUNCH_ON_EVENT can not be requested via app_control_send_launch_request(). How to know the triggered event after launch by event triggering.
- You can get the event name and data in the first call of app_control_cb, which is called after 'Created' of application states.
static void app_control(app_control_h app_control, void *data) { // Check "launch on event" int ret = 0; const char *event_uri = "event://tizen.system.event.battery_charger_status"; char *operation = NULL; char *uri = NULL; char *event_value = NULL; ret = app_control_get_operation(app_control, &operation); if (ret == APP_CONTROL_ERROR_NONE && operation && strcmp(operation, APP_CONTROL_OPERATION_LAUNCH_ON_EVENT) == 0) { ret = app_control_get_uri(app_control, &uri); if (ret == APP_CONTROL_ERROR_NONE && uri) { if (strncmp(uri, event_uri, strlen(event_uri) + 1) == 0) { ret = app_control_get_extra_data(app_control, "battery_charger_status", &event_value); if (ret == APP_CONTROL_ERROR_NONE && event_value) free(event_value); } free(uri); } free(operation); } }
- Use event_add_event_handler() API in the first called app_control_cb for further subscription of that event. NOTE: Only some of System-Events support Launch-On-Event. The System-Events and their Conditions which support Launch-On-Event are listed in the table below.
Name Condition SYSTEM_EVENT_BATTERY_CHARGER_STATUS When Charger CONNECTED SYSTEM_EVENT_USB_STATUS When USB CONNECTED SYSTEM_EVENT_EARJACK_STATUS When Earjack CONNECTED SYSTEM_EVENT_INCOMING_MSG When MSG_TYPE & MSG_ID exist
Privileged System-Events
There are some system-events which need the privilege for normal operation. You can know these privileged system-events from the 'privilege' comment of the definition of each system-event. If you try to add event handler for these events without privilege, you will get EVENT_ERROR_PERMISSION_DENIED return when you use the API for adding event handler. Also, if you declare app_control operation and URI in the manifest file for these events to enable 'Launch On Event' without privilege, there will be no real launch.
Supported System-Events.
The supported system-event's name, keys, and values of each event are listed in the table below.
Functions | |
int | event_add_event_handler (const char *event_name, event_cb callback, void *user_data, event_handler_h *event_handler) |
Adds the event handler for receiving event-data of interested events. | |
int | event_remove_event_handler (event_handler_h event_handler) |
Removes the registered event handler. | |
int | event_publish_app_event (const char *event_name, bundle *event_data) |
Sends the User-Event to receiver applications. | |
int | event_publish_trusted_app_event (const char *event_name, bundle *event_data) |
Sends the User-Event to trusted receiver-applications. | |
int | event_keep_last_event_data (const char *event_name) |
Keeps last User-Event data for receiver applications. | |
Typedefs | |
typedef struct event_handler * | event_handler_h |
Event handle. | |
typedef void(* | event_cb )(const char *event_name, bundle *event_data, void *user_data) |
Event callback. | |
Defines | |
#define | SYSTEM_EVENT_BATTERY_CHARGER_STATUS "tizen.system.event.battery_charger_status" |
Definition for system-event of battery : charger status. | |
#define | EVENT_KEY_BATTERY_CHARGER_STATUS "battery_charger_status" |
Definition for key of SYSTEM_EVENT_BATTERY_CHARGER_STATUS. | |
#define | EVENT_VAL_BATTERY_CHARGER_DISCONNECTED "disconnected" |
Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS. | |
#define | EVENT_VAL_BATTERY_CHARGER_CONNECTED "connected" |
Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS. | |
#define | EVENT_VAL_BATTERY_CHARGER_CHARGING "charging" |
Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS. | |
#define | EVENT_VAL_BATTERY_CHARGER_DISCHARGING "discharging" |
Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS. | |
#define | SYSTEM_EVENT_BATTERY_LEVEL_STATUS "tizen.system.event.battery_level_status" |
Definition for system-event of battery : level status. | |
#define | EVENT_KEY_BATTERY_LEVEL_STATUS "battery_level_status" |
Definition for key of SYSTEM_EVENT_BATTERY_LEVEL_STATUS. | |
#define | EVENT_VAL_BATTERY_LEVEL_EMPTY "empty" |
Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS. | |
#define | EVENT_VAL_BATTERY_LEVEL_CRITICAL "critical" |
Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS. | |
#define | EVENT_VAL_BATTERY_LEVEL_LOW "low" |
Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS. | |
#define | EVENT_VAL_BATTERY_LEVEL_HIGH "high" |
Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS. | |
#define | EVENT_VAL_BATTERY_LEVEL_FULL "full" |
Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS. | |
#define | SYSTEM_EVENT_USB_STATUS "tizen.system.event.usb_status" |
Definition for system-event of USB : status of USB connection. | |
#define | EVENT_KEY_USB_STATUS "usb_status" |
Definition for key of SYSTEM_EVENT_USB_STATUS. | |
#define | EVENT_VAL_USB_DISCONNECTED "disconnected" |
Definition for value of EVENT_KEY_USB_STATUS. | |
#define | EVENT_VAL_USB_CONNECTED "connected" |
Definition for value of EVENT_KEY_USB_STATUS. | |
#define | EVENT_VAL_USB_AVAILABLE "available" |
Definition for value of EVENT_KEY_USB_STATUS. | |
#define | SYSTEM_EVENT_EARJACK_STATUS "tizen.system.event.earjack_status" |
Definition for system-event of ear-jack : status of ear-jack connection. | |
#define | EVENT_KEY_EARJACK_STATUS "earjack_status" |
Definition for key of SYSTEM_EVENT_EARJACK_STATUS. | |
#define | EVENT_VAL_EARJACK_DISCONNECTED "disconnected" |
Definition for value of EVENT_KEY_EARJACK_STATUS. | |
#define | EVENT_VAL_EARJACK_CONNECTED "connected" |
Definition for value of EVENT_KEY_EARJACK_STATUS. | |
#define | SYSTEM_EVENT_DISPLAY_STATE "tizen.system.event.display_state" |
Definition for system-event of display : state of display. | |
#define | EVENT_KEY_DISPLAY_STATE "display_state" |
Definition for key of SYSTEM_EVENT_DISPLAY_STATE. | |
#define | EVENT_VAL_DISPLAY_NORMAL "normal" |
Definition for value of EVENT_KEY_DISPLAY_STATE. | |
#define | EVENT_VAL_DISPLAY_DIM "dim" |
Definition for value of EVENT_KEY_DISPLAY_STATE. | |
#define | EVENT_VAL_DISPLAY_OFF "off" |
Definition for value of EVENT_KEY_DISPLAY_STATE. | |
#define | SYSTEM_EVENT_BOOT_COMPLETED "tizen.system.event.boot_completed" |
Definition for system-event of system : boot completion. | |
#define | SYSTEM_EVENT_SYSTEM_SHUTDOWN "tizen.system.event.system_shutdown" |
Definition for system-event of system : shutdown. | |
#define | SYSTEM_EVENT_LOW_MEMORY "tizen.system.event.low_memory" |
Definition for system-event of system : low memory. | |
#define | EVENT_KEY_LOW_MEMORY "low_memory" |
Definition for key of SYSTEM_EVENT_LOW_MEMORY. | |
#define | EVENT_VAL_MEMORY_NORMAL "normal" |
Definition for value of EVENT_KEY_LOW_MEMORY. | |
#define | EVENT_VAL_MEMORY_SOFT_WARNING "soft_warning" |
Definition for value of EVENT_KEY_LOW_MEMORY. | |
#define | EVENT_VAL_MEMORY_HARD_WARNING "hard_warning" |
Definition for value of EVENT_KEY_LOW_MEMORY. | |
#define | SYSTEM_EVENT_WIFI_STATE "tizen.system.event.wifi_state" |
Definition for system-event of wifi : state of wifi. | |
#define | EVENT_KEY_WIFI_STATE "wifi_state" |
Definition for key of SYSTEM_EVENT_WIFI_STATE. | |
#define | EVENT_VAL_WIFI_OFF "off" |
Definition for value of EVENT_KEY_WIFI_STATE. | |
#define | EVENT_VAL_WIFI_ON "on" |
Definition for value of EVENT_KEY_WIFI_STATE. | |
#define | EVENT_VAL_WIFI_CONNECTED "connected" |
Definition for value of EVENT_KEY_WIFI_STATE. | |
#define | SYSTEM_EVENT_BT_STATE "tizen.system.event.bt_state" |
Definition for system-event of bluetooth : status of bluetooth. | |
#define | EVENT_KEY_BT_STATE "bt_state" |
Definition for key of SYSTEM_EVENT_BT_STATE. | |
#define | EVENT_VAL_BT_OFF "off" |
Definition for value of EVENT_KEY_BT_STATE. | |
#define | EVENT_VAL_BT_ON "on" |
Definition for value of EVENT_KEY_BT_STATE. | |
#define | EVENT_KEY_BT_LE_STATE "bt_le_state" |
Definition for key of SYSTEM_EVENT_BT_STATE. | |
#define | EVENT_VAL_BT_LE_OFF "off" |
Definition for value of EVENT_KEY_BT_LE_STATE. | |
#define | EVENT_VAL_BT_LE_ON "on" |
Definition for value of EVENT_KEY_BT_LE_STATE. | |
#define | EVENT_KEY_BT_TRANSFERING_STATE "bt_transfering_state" |
Definition for key of SYSTEM_EVENT_BT_STATE. | |
#define | EVENT_VAL_BT_NON_TRANSFERING "non_transfering" |
Definition for value of EVENT_KEY_BT_TRANSFERING_STATE. | |
#define | EVENT_VAL_BT_TRANSFERING "transfering" |
Definition for value of EVENT_KEY_BT_TRANSFERING_STATE. | |
#define | SYSTEM_EVENT_LOCATION_ENABLE_STATE "tizen.system.event.location_enable_state" |
Definition for system-event of location : enable state of location. | |
#define | EVENT_KEY_LOCATION_ENABLE_STATE "location_enable_state" |
Definition for key of SYSTEM_EVENT_LOCATION_ENABLE_STATE. | |
#define | EVENT_VAL_LOCATION_DISABLED "disabled" |
Definition for value of EVENT_KEY_LOCATION_ENABLE_STATE. | |
#define | EVENT_VAL_LOCATION_ENABLED "enabled" |
Definition for value of EVENT_KEY_LOCATION_ENABLE_STATE. | |
#define | SYSTEM_EVENT_GPS_ENABLE_STATE "tizen.system.event.gps_enable_state" |
Definition for system-event of location : enable state of gps. | |
#define | EVENT_KEY_GPS_ENABLE_STATE "gps_enable_state" |
Definition for key of SYSTEM_EVENT_GPS_ENABLE_STATE. | |
#define | EVENT_VAL_GPS_DISABLED "disabled" |
Definition for value of EVENT_KEY_GPS_ENABLE_STATE. | |
#define | EVENT_VAL_GPS_ENABLED "enabled" |
Definition for value of EVENT_KEY_GPS_ENABLE_STATE. | |
#define | SYSTEM_EVENT_NPS_ENABLE_STATE "tizen.system.event.nps_enable_state" |
Definition for system-event of location : enable state of nps. | |
#define | EVENT_KEY_NPS_ENABLE_STATE "nps_enable_state" |
Definition for key of SYSTEM_EVENT_NPS_ENABLE_STATE. | |
#define | EVENT_VAL_NPS_DISABLED "disabled" |
Definition for value of EVENT_KEY_NPS_ENABLE_STATE. | |
#define | EVENT_VAL_NPS_ENABLED "enabled" |
Definition for value of EVENT_KEY_NPS_ENABLE_STATE. | |
#define | SYSTEM_EVENT_INCOMING_MSG "tizen.system.event.incoming_msg" |
Definition for system-event of message : incoming msg. | |
#define | EVENT_KEY_MSG_TYPE "msg_type" |
Definition for key of SYSTEM_EVENT_INCOMING_MSG. | |
#define | EVENT_VAL_SMS "sms" |
Definition for value of EVENT_KEY_MSG_TYPE. | |
#define | EVENT_VAL_MMS "mms" |
Definition for value of EVENT_KEY_MSG_TYPE. | |
#define | EVENT_VAL_PUSH "push" |
Definition for value of EVENT_KEY_MSG_TYPE. | |
#define | EVENT_VAL_CB "cb" |
Definition for value of EVENT_KEY_MSG_TYPE. | |
#define | EVENT_KEY_MSG_ID "msg_id" |
Definition for key of SYSTEM_EVENT_INCOMING_MSG. | |
#define | SYSTEM_EVENT_OUTGOING_MSG "tizen.system.event.outgoing_msg" |
Definition for system-event of message : outgoing msg. | |
#define | EVENT_KEY_OUT_MSG_TYPE "msg_type" |
Definition for key of SYSTEM_EVENT_OUTGOING_MSG. | |
#define | EVENT_VAL_OUT_MSG_SMS "sms" |
Definition for value of EVENT_KEY_OUT_MSG_TYPE. | |
#define | EVENT_VAL_OUT_MSG_MMS "mms" |
Definition for value of EVENT_KEY_OUT_MSG_TYPE. | |
#define | EVENT_KEY_OUT_MSG_ID "msg_id" |
Definition for key of SYSTEM_EVENT_OUTGOING_MSG. | |
#define | SYSTEM_EVENT_TIME_CHANGED "tizen.system.event.time_changed" |
Definition for system-event of setting : time changed. | |
#define | SYSTEM_EVENT_TIME_ZONE "tizen.system.event.time_zone" |
Definition for system-event of setting : timezone setting. | |
#define | EVENT_KEY_TIME_ZONE "time_zone" |
Definition for key of SYSTEM_EVENT_TIME_ZONE. | |
#define | SYSTEM_EVENT_HOUR_FORMAT "tizen.system.event.hour_format" |
Definition for system-event of setting : hour format. | |
#define | EVENT_KEY_HOUR_FORMAT "hour_format" |
Definition for key of SYSTEM_EVENT_HOUR_FORMAT. | |
#define | EVENT_VAL_HOURFORMAT_12 "12" |
Definition for value of EVENT_KEY_HOUR_FORMAT. | |
#define | EVENT_VAL_HOURFORMAT_24 "24" |
Definition for value of EVENT_KEY_HOUR_FORMAT. | |
#define | SYSTEM_EVENT_LANGUAGE_SET "tizen.system.event.language_set" |
Definition for system-event of setting : language setting. | |
#define | EVENT_KEY_LANGUAGE_SET "language_set" |
Definition for key of SYSTEM_EVENT_LANGUAGE_SET. | |
#define | SYSTEM_EVENT_REGION_FORMAT "tizen.system.event.region_format" |
Definition for system-event of setting : region format. | |
#define | EVENT_KEY_REGION_FORMAT "region_format" |
Definition for key of SYSTEM_EVENT_REGION_FORMAT. | |
#define | SYSTEM_EVENT_SILENT_MODE "tizen.system.event.silent_mode" |
Definition for system-event of setting : silent_mode. | |
#define | EVENT_KEY_SILENT_MODE "silent_mode" |
Definition for key of SYSTEM_EVENT_SILENT_MODE. | |
#define | EVENT_VAL_SILENTMODE_ON "on" |
Definition for value of EVENT_KEY_SILENT_MODE. | |
#define | EVENT_VAL_SILENTMODE_OFF "off" |
Definition for value of EVENT_KEY_SILENT_MODE. | |
#define | SYSTEM_EVENT_VIBRATION_STATE "tizen.system.event.vibration_state" |
Definition for system-event of setting : state of vibration. | |
#define | EVENT_KEY_VIBRATION_STATE "vibration_state" |
Definition for key of SYSTEM_EVENT_VIBRATION_STATE. | |
#define | EVENT_VAL_VIBRATION_ON "on" |
Definition for value of EVENT_KEY_VIBRATION_STATE. | |
#define | EVENT_VAL_VIBRATION_OFF "off" |
Definition for value of EVENT_KEY_VIBRATION_STATE. | |
#define | SYSTEM_EVENT_SCREEN_AUTOROTATE_STATE "tizen.system.event.screen_autorotate_state" |
Definition for system-event of setting : state of screen's auto-rotation. | |
#define | EVENT_KEY_SCREEN_AUTOROTATE_STATE "screen_autorotate_state" |
Definition for key of SYSTEM_EVENT_SCREEN_AUTOROTATE_STATE. | |
#define | EVENT_VAL_SCREEN_AUTOROTATE_ON "on" |
Definition for value of EVENT_KEY_SCREEN_AUTOROTATE_STATE. | |
#define | EVENT_VAL_SCREEN_AUTOROTATE_OFF "off" |
Definition for value of EVENT_KEY_SCREEN_AUTOROTATE_STATE. | |
#define | SYSTEM_EVENT_MOBILE_DATA_STATE "tizen.system.event.mobile_data_state" |
Definition for system-event of setting : state of mobile data. | |
#define | EVENT_KEY_MOBILE_DATA_STATE "mobile_data_state" |
Definition for key of SYSTEM_EVENT_MOBILE_DATA_STATE. | |
#define | EVENT_VAL_MOBILE_DATA_OFF "off" |
Definition for value of EVENT_KEY_MOBILE_DATA_STATE. | |
#define | EVENT_VAL_MOBILE_DATA_ON "on" |
Definition for value of EVENT_KEY_MOBILE_DATA_STATE. | |
#define | SYSTEM_EVENT_DATA_ROAMING_STATE "tizen.system.event.data_roaming_state" |
Definition for system-event of setting : state of data roaming. | |
#define | EVENT_KEY_DATA_ROAMING_STATE "data_roaming_state" |
Definition for key of SYSTEM_EVENT_DATA_ROAMING_STATE. | |
#define | EVENT_VAL_DATA_ROAMING_OFF "off" |
Definition for value of EVENT_KEY_DATA_ROAMING_STATE. | |
#define | EVENT_VAL_DATA_ROAMING_ON "on" |
Definition for value of EVENT_KEY_DATA_ROAMING_STATE. | |
#define | SYSTEM_EVENT_FONT_SET "tizen.system.event.font_set" |
Definition for system-event of setting : font setting. | |
#define | EVENT_KEY_FONT_SET "font_set" |
Definition for key of SYSTEM_EVENT_FONT_SET. | |
#define | SYSTEM_EVENT_NETWORK_STATUS "tizen.system.event.network_status" |
Definition for system-event of network : status of network. | |
#define | EVENT_KEY_NETWORK_STATUS "network_status" |
Definition for key of SYSTEM_EVENT_NETWORK_STATUS. | |
#define | EVENT_VAL_NETWORK_DISCONNECTED "disconnected" |
Definition for value of EVENT_KEY_NETWORK_STATUS. | |
#define | EVENT_VAL_NETWORK_WIFI "wifi" |
Definition for value of EVENT_KEY_NETWORK_STATUS. | |
#define | EVENT_VAL_NETWORK_CELLULAR "cellular" |
Definition for value of EVENT_KEY_NETWORK_STATUS. | |
#define | EVENT_VAL_NETWORK_ETHERNET "ethernet" |
Definition for value of EVENT_KEY_NETWORK_STATUS. | |
#define | EVENT_VAL_NETWORK_BT "bt" |
Definition for value of EVENT_KEY_NETWORK_STATUS. | |
#define | EVENT_VAL_NETWORK_NET_PROXY "net_proxy" |
Definition for value of EVENT_KEY_NETWORK_STATUS. |
Define Documentation
#define EVENT_KEY_BATTERY_CHARGER_STATUS "battery_charger_status" |
Definition for key of SYSTEM_EVENT_BATTERY_CHARGER_STATUS.
- Since :
- 2.4
#define EVENT_KEY_BATTERY_LEVEL_STATUS "battery_level_status" |
Definition for key of SYSTEM_EVENT_BATTERY_LEVEL_STATUS.
- Since :
- 2.4
#define EVENT_KEY_BT_LE_STATE "bt_le_state" |
Definition for key of SYSTEM_EVENT_BT_STATE.
- Since :
- 2.4
- See also:
- EVENT_VAL_BT_LE_OFF
- EVENT_VAL_BT_LE_ON
#define EVENT_KEY_BT_STATE "bt_state" |
#define EVENT_KEY_BT_TRANSFERING_STATE "bt_transfering_state" |
Definition for key of SYSTEM_EVENT_BT_STATE.
- Since :
- 2.4
- Remarks:
- If it's already transferring state before you register this event, you can't receive the event regarding current transfer but you can receive the following transfers.
#define EVENT_KEY_DATA_ROAMING_STATE "data_roaming_state" |
Definition for key of SYSTEM_EVENT_DATA_ROAMING_STATE.
- Since :
- 2.4
#define EVENT_KEY_DISPLAY_STATE "display_state" |
Definition for key of SYSTEM_EVENT_DISPLAY_STATE.
- Since :
- 2.4
#define EVENT_KEY_EARJACK_STATUS "earjack_status" |
Definition for key of SYSTEM_EVENT_EARJACK_STATUS.
- Since :
- 2.4
#define EVENT_KEY_FONT_SET "font_set" |
Definition for key of SYSTEM_EVENT_FONT_SET.
- Since :
- 2.4
- Remarks:
- The value of this key is font name of string type by font-config.
#define EVENT_KEY_GPS_ENABLE_STATE "gps_enable_state" |
Definition for key of SYSTEM_EVENT_GPS_ENABLE_STATE.
- Since :
- 2.4
#define EVENT_KEY_HOUR_FORMAT "hour_format" |
Definition for key of SYSTEM_EVENT_HOUR_FORMAT.
- Since :
- 2.4
#define EVENT_KEY_LANGUAGE_SET "language_set" |
Definition for key of SYSTEM_EVENT_LANGUAGE_SET.
- Since :
- 2.4
- Remarks:
- The value of this key is full name of locale, for example, "ko_KR.UTF8" : in case of Korean language "en_US.UTF8" : in case of USA language, refer to linux locale info.
#define EVENT_KEY_LOCATION_ENABLE_STATE "location_enable_state" |
Definition for key of SYSTEM_EVENT_LOCATION_ENABLE_STATE.
- Since :
- 2.4
#define EVENT_KEY_LOW_MEMORY "low_memory" |
Definition for key of SYSTEM_EVENT_LOW_MEMORY.
- Since :
- 2.4
- 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.
#define EVENT_KEY_MOBILE_DATA_STATE "mobile_data_state" |
Definition for key of SYSTEM_EVENT_MOBILE_DATA_STATE.
- Since :
- 2.4
#define EVENT_KEY_MSG_ID "msg_id" |
Definition for key of SYSTEM_EVENT_INCOMING_MSG.
- Since :
- 2.4
- Remarks:
- The value of this key is a string of unsigned int value : new message id.
#define EVENT_KEY_MSG_TYPE "msg_type" |
Definition for key of SYSTEM_EVENT_INCOMING_MSG.
- Since :
- 2.4
- See also:
- EVENT_VAL_SMS
- EVENT_VAL_PUSH
- EVENT_VAL_CB
#define EVENT_KEY_NETWORK_STATUS "network_status" |
Definition for key of SYSTEM_EVENT_NETWORK_STATUS.
- Since :
- 3.0
- Remarks:
- The values of this event indicate the type of the current profile for data connection.
#define EVENT_KEY_NPS_ENABLE_STATE "nps_enable_state" |
Definition for key of SYSTEM_EVENT_NPS_ENABLE_STATE.
- Since :
- 2.4
#define EVENT_KEY_OUT_MSG_ID "msg_id" |
Definition for key of SYSTEM_EVENT_OUTGOING_MSG.
- Since :
- 3.0
- Remarks:
- The value of this key is a string of unsigned int value : new message id.
#define EVENT_KEY_OUT_MSG_TYPE "msg_type" |
Definition for key of SYSTEM_EVENT_OUTGOING_MSG.
- Since :
- 3.0
#define EVENT_KEY_REGION_FORMAT "region_format" |
Definition for key of SYSTEM_EVENT_REGION_FORMAT.
- Since :
- 2.4
- Remarks:
- The value of this key is full name of locale, for example, "ko_KR.UTF8" : in case of Korean region format "en_US.UTF8" : in case of USA region format, refer to linux locale info.
#define EVENT_KEY_SCREEN_AUTOROTATE_STATE "screen_autorotate_state" |
Definition for key of SYSTEM_EVENT_SCREEN_AUTOROTATE_STATE.
- Since :
- 2.4
#define EVENT_KEY_SILENT_MODE "silent_mode" |
Definition for key of SYSTEM_EVENT_SILENT_MODE.
- Since :
- 2.4
#define EVENT_KEY_TIME_ZONE "time_zone" |
Definition for key of SYSTEM_EVENT_TIME_ZONE.
- Since :
- 2.4
- Remarks:
- The value of this key is timezone value of tz database, for example, "Asia/Seoul", "America/New_York", refer to the Time Zone Database of IANA.
#define EVENT_KEY_USB_STATUS "usb_status" |
Definition for key of SYSTEM_EVENT_USB_STATUS.
- Since :
- 2.4
#define EVENT_KEY_VIBRATION_STATE "vibration_state" |
Definition for key of SYSTEM_EVENT_VIBRATION_STATE.
- Since :
- 2.4
#define EVENT_KEY_WIFI_STATE "wifi_state" |
Definition for key of SYSTEM_EVENT_WIFI_STATE.
- Since :
- 2.4
#define EVENT_VAL_BATTERY_CHARGER_CHARGING "charging" |
Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS.
- Since :
- 2.4
- Remarks:
- charging is enabled
#define EVENT_VAL_BATTERY_CHARGER_CONNECTED "connected" |
Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS.
- Since :
- 2.4
- Remarks:
- charger connected
#define EVENT_VAL_BATTERY_CHARGER_DISCHARGING "discharging" |
Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS.
- Since :
- 2.4
- Remarks:
- charging is disabled
#define EVENT_VAL_BATTERY_CHARGER_DISCONNECTED "disconnected" |
Definition for value of EVENT_KEY_BATTERY_CHARGER_STATUS.
- Since :
- 2.4
- Remarks:
- charger disconnected
#define EVENT_VAL_BATTERY_LEVEL_CRITICAL "critical" |
Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
- Since :
- 2.4
#define EVENT_VAL_BATTERY_LEVEL_EMPTY "empty" |
Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
- Since :
- 2.4
#define EVENT_VAL_BATTERY_LEVEL_FULL "full" |
Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
- Since :
- 2.4
#define EVENT_VAL_BATTERY_LEVEL_HIGH "high" |
Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
- Since :
- 2.4
#define EVENT_VAL_BATTERY_LEVEL_LOW "low" |
Definition for value of EVENT_KEY_BATTERY_LEVEL_STATUS.
- Since :
- 2.4
#define EVENT_VAL_BT_LE_OFF "off" |
Definition for value of EVENT_KEY_BT_LE_STATE.
- Since :
- 2.4
#define EVENT_VAL_BT_LE_ON "on" |
Definition for value of EVENT_KEY_BT_LE_STATE.
- Since :
- 2.4
#define EVENT_VAL_BT_NON_TRANSFERING "non_transfering" |
Definition for value of EVENT_KEY_BT_TRANSFERING_STATE.
- Since :
- 2.4
#define EVENT_VAL_BT_OFF "off" |
Definition for value of EVENT_KEY_BT_STATE.
- Since :
- 2.4
#define EVENT_VAL_BT_ON "on" |
Definition for value of EVENT_KEY_BT_STATE.
- Since :
- 2.4
#define EVENT_VAL_BT_TRANSFERING "transfering" |
Definition for value of EVENT_KEY_BT_TRANSFERING_STATE.
- Since :
- 2.4
#define EVENT_VAL_CB "cb" |
Definition for value of EVENT_KEY_MSG_TYPE.
- Since :
- 2.4
#define EVENT_VAL_DATA_ROAMING_OFF "off" |
Definition for value of EVENT_KEY_DATA_ROAMING_STATE.
- Since :
- 2.4
#define EVENT_VAL_DATA_ROAMING_ON "on" |
Definition for value of EVENT_KEY_DATA_ROAMING_STATE.
- Since :
- 2.4
#define EVENT_VAL_DISPLAY_DIM "dim" |
Definition for value of EVENT_KEY_DISPLAY_STATE.
- Since :
- 2.4
#define EVENT_VAL_DISPLAY_NORMAL "normal" |
Definition for value of EVENT_KEY_DISPLAY_STATE.
- Since :
- 2.4
#define EVENT_VAL_DISPLAY_OFF "off" |
Definition for value of EVENT_KEY_DISPLAY_STATE.
- Since :
- 2.4
#define EVENT_VAL_EARJACK_CONNECTED "connected" |
Definition for value of EVENT_KEY_EARJACK_STATUS.
- Since :
- 2.4
#define EVENT_VAL_EARJACK_DISCONNECTED "disconnected" |
Definition for value of EVENT_KEY_EARJACK_STATUS.
- Since :
- 2.4
#define EVENT_VAL_GPS_DISABLED "disabled" |
Definition for value of EVENT_KEY_GPS_ENABLE_STATE.
- Since :
- 2.4
#define EVENT_VAL_GPS_ENABLED "enabled" |
Definition for value of EVENT_KEY_GPS_ENABLE_STATE.
- Since :
- 2.4
#define EVENT_VAL_HOURFORMAT_12 "12" |
Definition for value of EVENT_KEY_HOUR_FORMAT.
- Since :
- 2.4
#define EVENT_VAL_HOURFORMAT_24 "24" |
Definition for value of EVENT_KEY_HOUR_FORMAT.
- Since :
- 2.4
#define EVENT_VAL_LOCATION_DISABLED "disabled" |
Definition for value of EVENT_KEY_LOCATION_ENABLE_STATE.
- Since :
- 2.4
#define EVENT_VAL_LOCATION_ENABLED "enabled" |
Definition for value of EVENT_KEY_LOCATION_ENABLE_STATE.
- Since :
- 2.4
#define EVENT_VAL_MEMORY_HARD_WARNING "hard_warning" |
Definition for value of EVENT_KEY_LOW_MEMORY.
- Since :
- 2.4
#define EVENT_VAL_MEMORY_NORMAL "normal" |
Definition for value of EVENT_KEY_LOW_MEMORY.
- Since :
- 2.4
#define EVENT_VAL_MEMORY_SOFT_WARNING "soft_warning" |
Definition for value of EVENT_KEY_LOW_MEMORY.
- Since :
- 2.4
#define EVENT_VAL_MMS "mms" |
Definition for value of EVENT_KEY_MSG_TYPE.
- Since :
- 3.0
#define EVENT_VAL_MOBILE_DATA_OFF "off" |
Definition for value of EVENT_KEY_MOBILE_DATA_STATE.
- Since :
- 2.4
#define EVENT_VAL_MOBILE_DATA_ON "on" |
Definition for value of EVENT_KEY_MOBILE_DATA_STATE.
- Since :
- 2.4
#define EVENT_VAL_NETWORK_BT "bt" |
Definition for value of EVENT_KEY_NETWORK_STATUS.
- Since :
- 3.0
#define EVENT_VAL_NETWORK_CELLULAR "cellular" |
Definition for value of EVENT_KEY_NETWORK_STATUS.
- Since :
- 3.0
#define EVENT_VAL_NETWORK_DISCONNECTED "disconnected" |
Definition for value of EVENT_KEY_NETWORK_STATUS.
- Since :
- 3.0
#define EVENT_VAL_NETWORK_ETHERNET "ethernet" |
Definition for value of EVENT_KEY_NETWORK_STATUS.
- Since :
- 3.0
#define EVENT_VAL_NETWORK_NET_PROXY "net_proxy" |
Definition for value of EVENT_KEY_NETWORK_STATUS.
- Since :
- 3.0
#define EVENT_VAL_NETWORK_WIFI "wifi" |
Definition for value of EVENT_KEY_NETWORK_STATUS.
- Since :
- 3.0
#define EVENT_VAL_NPS_DISABLED "disabled" |
Definition for value of EVENT_KEY_NPS_ENABLE_STATE.
- Since :
- 2.4
#define EVENT_VAL_NPS_ENABLED "enabled" |
Definition for value of EVENT_KEY_NPS_ENABLE_STATE.
- Since :
- 2.4
#define EVENT_VAL_OUT_MSG_MMS "mms" |
Definition for value of EVENT_KEY_OUT_MSG_TYPE.
- Since :
- 3.0
#define EVENT_VAL_OUT_MSG_SMS "sms" |
Definition for value of EVENT_KEY_OUT_MSG_TYPE.
- Since :
- 3.0
#define EVENT_VAL_PUSH "push" |
Definition for value of EVENT_KEY_MSG_TYPE.
- Since :
- 2.4
#define EVENT_VAL_SCREEN_AUTOROTATE_OFF "off" |
Definition for value of EVENT_KEY_SCREEN_AUTOROTATE_STATE.
- Since :
- 2.4
#define EVENT_VAL_SCREEN_AUTOROTATE_ON "on" |
Definition for value of EVENT_KEY_SCREEN_AUTOROTATE_STATE.
- Since :
- 2.4
#define EVENT_VAL_SILENTMODE_OFF "off" |
Definition for value of EVENT_KEY_SILENT_MODE.
- Since :
- 2.4
#define EVENT_VAL_SILENTMODE_ON "on" |
Definition for value of EVENT_KEY_SILENT_MODE.
- Since :
- 2.4
#define EVENT_VAL_SMS "sms" |
Definition for value of EVENT_KEY_MSG_TYPE.
- Since :
- 2.4
#define EVENT_VAL_USB_AVAILABLE "available" |
Definition for value of EVENT_KEY_USB_STATUS.
- Since :
- 2.4
#define EVENT_VAL_USB_CONNECTED "connected" |
Definition for value of EVENT_KEY_USB_STATUS.
- Since :
- 2.4
- Remarks:
- Connected but not-available.
#define EVENT_VAL_USB_DISCONNECTED "disconnected" |
Definition for value of EVENT_KEY_USB_STATUS.
- Since :
- 2.4
#define EVENT_VAL_VIBRATION_OFF "off" |
Definition for value of EVENT_KEY_VIBRATION_STATE.
- Since :
- 2.4
#define EVENT_VAL_VIBRATION_ON "on" |
Definition for value of EVENT_KEY_VIBRATION_STATE.
- Since :
- 2.4
#define EVENT_VAL_WIFI_CONNECTED "connected" |
Definition for value of EVENT_KEY_WIFI_STATE.
- Since :
- 2.4
#define EVENT_VAL_WIFI_OFF "off" |
Definition for value of EVENT_KEY_WIFI_STATE.
- Since :
- 2.4
#define EVENT_VAL_WIFI_ON "on" |
Definition for value of EVENT_KEY_WIFI_STATE.
- Since :
- 2.4
#define SYSTEM_EVENT_BATTERY_CHARGER_STATUS "tizen.system.event.battery_charger_status" |
Definition for system-event of battery : charger status.
- Since :
- 2.4
- 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.
- See also:
- EVENT_KEY_BATTERY_CHARGER_STATUS
#define SYSTEM_EVENT_BATTERY_LEVEL_STATUS "tizen.system.event.battery_level_status" |
Definition for system-event of battery : level status.
- Since :
- 2.4
- See also:
- EVENT_KEY_BATTERY_LEVEL_STATUS
#define SYSTEM_EVENT_BOOT_COMPLETED "tizen.system.event.boot_completed" |
Definition for system-event of system : boot completion.
- Since :
- 2.4
- Remarks:
- There is no corresponding key/value.
- You can treat the initial value as "false" before you receive this event.
- If it's already boot-completed state before you register event handler, you can receive the event as soon as you register the event handler.
#define SYSTEM_EVENT_BT_STATE "tizen.system.event.bt_state" |
Definition for system-event of bluetooth : status of bluetooth.
- Since :
- 2.4
#define SYSTEM_EVENT_DATA_ROAMING_STATE "tizen.system.event.data_roaming_state" |
Definition for system-event of setting : state of data roaming.
- Since :
- 2.4
- See also:
- EVENT_KEY_DATA_ROAMING_STATE
#define SYSTEM_EVENT_DISPLAY_STATE "tizen.system.event.display_state" |
Definition for system-event of display : state of display.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/display
- Remarks:
- If you want to receive this event, you must declare this privilege.
- See also:
- EVENT_KEY_DISPLAY_STATE
#define SYSTEM_EVENT_EARJACK_STATUS "tizen.system.event.earjack_status" |
Definition for system-event of ear-jack : status of ear-jack connection.
- Since :
- 2.4
- See also:
- EVENT_KEY_EARJACK_STATUS
#define SYSTEM_EVENT_FONT_SET "tizen.system.event.font_set" |
#define SYSTEM_EVENT_GPS_ENABLE_STATE "tizen.system.event.gps_enable_state" |
Definition for system-event of location : enable state of gps.
- Since :
- 2.4
- See also:
- EVENT_KEY_GPS_ENABLE_STATE
#define SYSTEM_EVENT_HOUR_FORMAT "tizen.system.event.hour_format" |
#define SYSTEM_EVENT_INCOMING_MSG "tizen.system.event.incoming_msg" |
Definition for system-event of message : incoming msg.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/message.read
- Remarks:
- If you want to receive this event, you must declare this privilege.
- See also:
- EVENT_KEY_MSG_TYPE
- EVENT_KEY_MSG_ID
#define SYSTEM_EVENT_LANGUAGE_SET "tizen.system.event.language_set" |
Definition for system-event of setting : language setting.
- Since :
- 2.4
- See also:
- EVENT_KEY_LANGUAGE_SET
#define SYSTEM_EVENT_LOCATION_ENABLE_STATE "tizen.system.event.location_enable_state" |
Definition for system-event of location : enable state of location.
- Since :
- 2.4
- See also:
- EVENT_KEY_LOCATION_ENABLE_STATE
#define SYSTEM_EVENT_LOW_MEMORY "tizen.system.event.low_memory" |
#define SYSTEM_EVENT_MOBILE_DATA_STATE "tizen.system.event.mobile_data_state" |
Definition for system-event of setting : state of mobile data.
- Since :
- 2.4
- See also:
- EVENT_KEY_MOBILE_DATA_STATE
#define SYSTEM_EVENT_NETWORK_STATUS "tizen.system.event.network_status" |
Definition for system-event of network : status of network.
- Since :
- 3.0
- See also:
- EVENT_KEY_NETWORK_STATUS
#define SYSTEM_EVENT_NPS_ENABLE_STATE "tizen.system.event.nps_enable_state" |
Definition for system-event of location : enable state of nps.
- Since :
- 2.4
- See also:
- EVENT_KEY_NPS_ENABLE_STATE
#define SYSTEM_EVENT_OUTGOING_MSG "tizen.system.event.outgoing_msg" |
Definition for system-event of message : outgoing msg.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/message.read
- Remarks:
- If you want to receive this event, you must declare this privilege.
#define SYSTEM_EVENT_REGION_FORMAT "tizen.system.event.region_format" |
#define SYSTEM_EVENT_SCREEN_AUTOROTATE_STATE "tizen.system.event.screen_autorotate_state" |
Definition for system-event of setting : state of screen's auto-rotation.
- Since :
- 2.4
- See also:
- EVENT_KEY_SCREEN_AUTOROTATE_STATE
#define SYSTEM_EVENT_SILENT_MODE "tizen.system.event.silent_mode" |
#define SYSTEM_EVENT_SYSTEM_SHUTDOWN "tizen.system.event.system_shutdown" |
Definition for system-event of system : shutdown.
- Since :
- 2.4
- Remarks:
- There is no corresponding key/value.
- You can treat the initial value as "false" before you receive this event.
- If it's already shutting-down state before you register event handler, you can receive the event as soon as you register the event handler.
#define SYSTEM_EVENT_TIME_CHANGED "tizen.system.event.time_changed" |
Definition for system-event of setting : time changed.
- Since :
- 2.4
- Remarks:
- There is no corresponding key/value.
- You can use a alarm_get_current_time() API for checking new time after receiving this event.
#define SYSTEM_EVENT_TIME_ZONE "tizen.system.event.time_zone" |
#define SYSTEM_EVENT_USB_STATUS "tizen.system.event.usb_status" |
Definition for system-event of USB : status of USB connection.
- Since :
- 2.4
- See also:
- EVENT_KEY_USB_STATUS
#define SYSTEM_EVENT_VIBRATION_STATE "tizen.system.event.vibration_state" |
Definition for system-event of setting : state of vibration.
- Since :
- 2.4
- See also:
- EVENT_KEY_VIBRATION_STATE
#define SYSTEM_EVENT_WIFI_STATE "tizen.system.event.wifi_state" |
Definition for system-event of wifi : state of wifi.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.get
- Remarks:
- If you want to receive this event, you must declare this privilege.
- See also:
- EVENT_KEY_WIFI_STATE
Typedef Documentation
Event callback.
- Since :
- 2.4
- Parameters:
-
[in] event_name The interested event name [in] event_data The data of interested event [in] user_data The user data set by event_add_event_handler()
- See also:
- event_add_event_handler()
typedef struct event_handler* event_handler_h |
Event handle.
- Since :
- 2.4
Enumeration Type Documentation
enum event_error_e |
Function Documentation
int event_add_event_handler | ( | const char * | event_name, |
event_cb | callback, | ||
void * | user_data, | ||
event_handler_h * | event_handler | ||
) |
Adds the event handler for receiving event-data of interested events.
- Since :
- 2.4
- Remarks:
- If you want to add the privileged event, you MUST declare right privilege first. Unless that, this function returns EVENT_ERROR_PERMISSION_DENIED. The privileged events are commented on remarks of it's definitions.
- Parameters:
-
[in] event_name The interested event name [in] callback The event callback called when the event occurs [in] user_data The user data for passing to callback [out] event_handler The event handler
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
EVENT_ERROR_NONE Successful EVENT_ERROR_PERMISSION_DENIED Permission denied EVENT_ERROR_INVALID_PARAMETER Invalid parameter EVENT_ERROR_IO_ERROR Adding handler failed EVENT_ERROR_OUT_OF_MEMORY Out of memory
int event_keep_last_event_data | ( | const char * | event_name | ) |
Keeps last User-Event data for receiver applications.
- Since :
- 3.0
- Remarks:
- The receiver applications will receive this last event data after adding their new handlers via event_add_event_handler() since the sender application called this function.
- 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.
- The effect of this function continues during runtime. That means when the sender application process restarts, the sender application needs to call this function again to make the event to keep the last event.
- Parameters:
-
[in] event_name The event's name to keep last event data
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
EVENT_ERROR_NONE Successful EVENT_ERROR_INVALID_PARAMETER Invalid parameter EVENT_ERROR_IO_ERROR Sending operation failed EVENT_ERROR_OUT_OF_MEMORY Out of memory
int event_publish_app_event | ( | const char * | event_name, |
bundle * | event_data | ||
) |
Sends the User-Event to receiver applications.
- Since :
- 2.4
- 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.
- Parameters:
-
[in] event_name The event's name to send [in] event_data The event's data to send
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
EVENT_ERROR_NONE Successful EVENT_ERROR_INVALID_PARAMETER Invalid parameter EVENT_ERROR_IO_ERROR Sending operation failed
int event_publish_trusted_app_event | ( | const char * | event_name, |
bundle * | event_data | ||
) |
Sends the User-Event to trusted receiver-applications.
- Since :
- 2.4
- Remarks:
- The application which has same certification with sender can receive the event.
- 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.
- Parameters:
-
[in] event_name The event's name to send [in] event_data The event's data to send
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
EVENT_ERROR_NONE Successful EVENT_ERROR_INVALID_PARAMETER Invalid parameter EVENT_ERROR_IO_ERROR Sending operation failed
int event_remove_event_handler | ( | event_handler_h | event_handler | ) |
Removes the registered event handler.
- Since :
- 2.4
- Parameters:
-
[in] event_handler The event handler
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
EVENT_ERROR_NONE Successful EVENT_ERROR_INVALID_PARAMETER Invalid parameter