summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2015-11-16 20:10:31 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2015-11-17 09:21:50 +0900
commitf0c85b37e8f5e9f5d6e0253baaae2c9fa751343a (patch)
tree84c118c5370b8d2a6f9e7da6244ea021d0156bcf /include
parent80e3b33f79f6b40bbb3a428284029eed1f77d9e8 (diff)
downloadapplication-f0c85b37e8f5e9f5d6e0253baaae2c9fa751343a.tar.gz
application-f0c85b37e8f5e9f5d6e0253baaae2c9fa751343a.tar.bz2
application-f0c85b37e8f5e9f5d6e0253baaae2c9fa751343a.zip
- revise doxygen - set appcore event cb only when the app register it - add an exception in alarm_get_app_control API - add app_event_get_suspended_state API - add app_get_preinitialized_window API - add app_get_preinitialized_background API - add app_get_preinitialized_conformant API Change-Id: I73d8dd2b83f2d97385876dc6ef603b53b99e78cd Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
Diffstat (limited to 'include')
-rw-r--r--include/app.h174
-rw-r--r--include/app_alarm.h43
-rw-r--r--include/app_common.h59
-rw-r--r--include/app_control.h6
-rw-r--r--include/app_control_internal.h21
-rw-r--r--include/app_event.h3
-rwxr-xr-xinclude/app_extension.h64
-rw-r--r--include/app_internal.h193
-rw-r--r--include/app_preference.h3
-rw-r--r--include/app_preference_internal.h33
-rw-r--r--include/app_resource_manager.h3
-rw-r--r--include/app_types.h3
12 files changed, 378 insertions, 227 deletions
diff --git a/include/app.h b/include/app.h
index c27a32c..4c4a7bb 100644
--- a/include/app.h
+++ b/include/app.h
@@ -11,7 +11,7 @@
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License.
+ * limitations under the License.
*/
@@ -117,117 +117,6 @@ typedef void (*app_terminate_cb) (void *user_data);
*/
typedef void (*app_control_cb) (app_control_h app_control, void *user_data);
-
-/**
- * @brief Called when other application send the launch request to the application.
- *
- * @details When the application is launched, this callback function is called after the main loop of application starts up.
- * The passed service handle describes the launch request and contains the information about why the application is launched.
- * If the launch request is sent to the application on running or pause state,
- * this callback function can be called again to notify that the application is asked to be launched.
- *
- * The application could be explicitly launched by the user from the application launcher or be launched to perform the specific operation by other application.
- * The application is responsible for handling the each launch request and responding appropriately.
- * Using the Service API, the application can get the information what has to perform.
- * If the application is launched from the application launcher or explicitly launched by other application,
- * the passed service handle may include only the default operation (#SERVICE_OPERATION_DEFAULT) without any data
- * For more information, see The @ref CAPI_SERVICE_MODULE API description.
- *
- * @param[in] service The handle to the service
- * @param[in] user_data The user data passed from the callback registration function
- * @see app_efl_main()
- * @see #app_event_callback_s
- * @see @ref CAPI_SERVICE_MODULE API
- */
-typedef void (*app_service_cb) (service_h service, void *user_data);
-
-
-/**
- * @brief Called when the system memory is running low.
- *
- * @details
- * When low memory event is dispatched, the application should immediately save state and release resources to save as much memory as possible. \n
- * If enough memory is not reclaimed during low memory conditions, the system will terminate some of the applications to reclaim the memory.
- *
- * @param[in] user_data The user data passed from the callback registration function
- * @see app_efl_main()
- * @see #app_event_callback_s
- */
-typedef void (*app_low_memory_cb) (void *user_data);
-
-
-/**
- * @brief Called when the battery power is running low.
- * @details When the battery level falls below 5%, it is called.
- *
- * @param[in] user_data The user data passed from the callback registration function
- * @see app_efl_main()
- * @see #app_event_callback_s
- */
-typedef void (*app_low_battery_cb) (void *user_data);
-
-
-/**
- * @brief Called when the orientation of device changes.
- *
- * @param[in] orientation The orientation of device
- * @param[in] user_data The user data passed from the callback registration function
- * @see app_efl_main()
- * @see #app_event_callback_s
- */
-typedef void (*app_device_orientation_cb) (app_device_orientation_e orientation, void *user_data);
-
-
-/**
- * @brief Called when language setting changes.
- *
- * @param [in] user_data The user data passed from the callback registration function
- * @see app_efl_main()
- * @see #app_event_callback_s
- */
-typedef void (*app_language_changed_cb) (void *user_data);
-
-
-/**
- * @brief Called when region format setting changes.
- *
- * @param [in] user_data The user data passed from the callback registration function
- * @see app_efl_main()
- * @see #app_event_callback_s
- */
-typedef void (*app_region_format_changed_cb) (void *user_data);
-
-
-/**
- * @brief The structure type to contain the set of callback functions for handling application events.
- * @details It is one of the input parameters of the app_efl_main() function.
- *
- * @see app_efl_main()
- * @see app_create_cb()
- * @see app_pause_cb()
- * @see app_resume_cb()
- * @see app_terminate_cb()
- * @see app_service_cb()
- * @see app_low_memory_cb()
- * @see app_low_battery_cb()
- * @see app_device_orientation_cb()
- * @see app_language_changed_cb()
- * @see app_region_format_changed_cb()
- */
-typedef struct
-{
- app_create_cb create; /**< This callback function is called at the start of the application. */
- app_terminate_cb terminate; /**< This callback function is called once after the main loop of application exits. */
- app_pause_cb pause; /**< This callback function is called each time the application is completely obscured by another application and becomes invisible to the user. */
- app_resume_cb resume; /**< This callback function is called each time the application becomes visible to the user. */
- app_service_cb service; /**< This callback function is called when other application send the launch request to the application. */
- app_low_memory_cb low_memory; /**< The registered callback function is called when the system runs low on memory. */
- app_low_battery_cb low_battery; /**< The registered callback function is called when battery is low. */
- app_device_orientation_cb device_orientation; /**< The registered callback function is called when the orientation of device changes */
- app_language_changed_cb language_changed; /**< The registered callback function is called when language setting changes. */
- app_region_format_changed_cb region_format_changed; /**< The registered callback function is called when region format setting is changes. */
-} app_event_callback_s;
-
/**
* @brief The structure type containing the set of callback functions for handling application lifecycle events.
* @details It is one of the input parameters of the ui_app_main() function.
@@ -240,8 +129,7 @@ typedef struct
* @see app_terminate_cb()
* @see app_control_cb()
*/
-typedef struct
-{
+typedef struct {
app_create_cb create; /**< This callback function is called at the start of the application. */
app_terminate_cb terminate; /**< This callback function is called once after the main loop of the application exits. */
app_pause_cb pause; /**< This callback function is called each time the application is completely obscured by another application and becomes invisible to the user. */
@@ -249,52 +137,6 @@ typedef struct
app_control_cb app_control; /**< This callback function is called when another application sends the launch request to the application. */
} ui_app_lifecycle_callback_s;
-
-/**
- * @brief Runs the main loop of application until app_efl_exit() is called
- *
- * @details This function is the main entry point of the Tizen application.
- * The app_create_cb() callback function is called to initialize the application before the main loop of application starts up.
- * After the app_create_cb() callback function returns true, the main loop starts up and the app_service_cb() callback function is subsequently called.
- * If the app_create_cb() callback function returns false, the main loop doesn't start up and app_terminate_cb() callback function is called
- *
- * @param [in] argc The argument count
- * @param [in] argv The argument vector
- * @param [in] callback The set of callback functions to handle application events
- * @param [in] user_data The user data to be passed to the callback functions
- *
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_ERROR_NONE Successful
- * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_ERROR_INVALID_CONTEXT The application is illegally launched, not launched by the launch system.
- * @retval #APP_ERROR_ALREADY_RUNNING The main loop already starts
- *
- * @see app_create_cb()
- * @see app_terminate_cb()
- * @see app_pause_cb()
- * @see app_resume_cb()
- * @see app_service_cb()
- * @see app_low_memory_cb()
- * @see app_low_battery_cb()
- * @see app_device_orientation_cb()
- * @see app_language_changed_cb()
- * @see app_region_format_changed_cb()
- * @see app_efl_exit()
- * @see #app_event_callback_s
- */
-int app_efl_main(int *argc, char ***argv, app_event_callback_s *callback, void *user_data);
-
-
-/**
- * @brief Exits the main loop of application.
- *
- * @details The main loop of application stops and app_terminate_cb() is invoked
- * @see app_efl_main()
- * @see app_terminate_cb()
- */
-void app_efl_exit(void);
-
-
/**
* @brief Gets the current device orientation.
*
@@ -303,18 +145,6 @@ void app_efl_exit(void);
*/
app_device_orientation_e app_get_device_orientation(void);
-
-/**
- * @brief Sets whether reclaiming system cache is enabled in the pause state.
- *
- * @details If the reclaiming system cache is enabled, the system caches are released as possible when the application's state changes to the pause state.
- *
- * @remarks The reclaiming system cache is enabled by default
- *
- * @param [in] enable whether reclaiming system cache is enabled
- */
-void app_set_reclaiming_system_cache_on_pause(bool enable);
-
/**
* @brief Runs the application's main loop until ui_app_exit() is called.
*
diff --git a/include/app_alarm.h b/include/app_alarm.h
index 96f78cf..7c7c518 100644
--- a/include/app_alarm.h
+++ b/include/app_alarm.h
@@ -45,13 +45,13 @@ extern "C" {
* @brief Enumeration for Alarm Error.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
+typedef enum {
ALARM_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
ALARM_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
ALARM_ERROR_INVALID_TIME = TIZEN_ERROR_APPLICATION | 0x05, /**< Invalid time */
ALARM_ERROR_INVALID_DATE = TIZEN_ERROR_APPLICATION | 0x06, /**< Invalid date */
ALARM_ERROR_CONNECTION_FAIL = TIZEN_ERROR_APPLICATION | 0x07, /**< The alarm service connection failed */
+ ALARM_ERROR_NOT_PERMITTED_APP = TIZEN_ERROR_APPLICATION | 0x08, /**< Application is not permitted. (Since 2.4) */
ALARM_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
ALARM_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED /**< Permission denied */
} alarm_error_e;
@@ -61,8 +61,7 @@ typedef enum
* @brief Enumeration for Alarm Week Flag, the days of the week.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
+typedef enum {
ALARM_WEEK_FLAG_SUNDAY = 0x01, /**< Sunday */
ALARM_WEEK_FLAG_MONDAY = 0x02, /**< Monday */
ALARM_WEEK_FLAG_TUESDAY = 0x04, /**< Tuesday */
@@ -96,11 +95,17 @@ typedef bool (*alarm_registered_alarm_cb)(int alarm_id, void *user_data);
* @privlevel public
* @privilege %http://tizen.org/privilege/alarm.set
* @remarks If the application is uninstalled after setting an alarm, the alarm is cancelled automatically.
+ * If the operation of @a app_control is not specified, #APP_CONTROL_OPERATION_DEFAULT is used for the launch request.
+ * If the operation of @a app_control is #APP_CONTROL_OPERATION_DEFAULT, the package information is mandatory to explicitly launch the application.
+ * Since 2.4, this api does not support exact period and delay for minimizing the wakeups of the device. The system can adjust when the alarm expires.
+ * If you want to trigger an alarm exactly, see @see alarm_schedule_once_after_delay()
+ * Since 2.4 If @a app_control is specified with service-application, the application is only allowed to run on which has Background Category.
+ * Since 2.4 If the appid of @a app_control is not specified, this api is not allowed. In other words, the explicit @a app_control is only allowed.
*
* @param[in] app_control The destination app_control to perform a specific task when the alarm is triggered
- * @param[in] delay The amount of time before the first execution (in seconds)
- * @param[in] period The amount of time between subsequent alarms (in seconds)
- * @param[out] alarm_id The alarm ID that uniquely identifies an alarm
+ * @param[in] delay The amount of time before the first execution (in seconds). Since 2.4, Although this is inexact, the alarm will not fire before this time
+ * @param[in] period The amount of time between subsequent alarms (in seconds). Since 2.4, This value does not guarantee the accuracy. The actual interval is calculated by the OS. The minimum value is 600sec
+ * @param[out] alarm_id The alarm ID that uniquely identifies an alarm.
* @return @c 0 on success,
* otherwise a negative error value
* @retval #ALARM_ERROR_NONE Successful
@@ -108,10 +113,10 @@ typedef bool (*alarm_registered_alarm_cb)(int alarm_id, void *user_data);
* @retval #ALARM_ERROR_INVALID_TIME Triggered time is invalid
* @retval #ALARM_ERROR_CONNECTION_FAIL Failed to connect to an alarm server
* @retval #ALARM_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #ALARM_ERROR_NOT_PERMITTED_APP @a app_control is not permitted
* @see alarm_cancel()
* @see alarm_cancel_all()
* @see alarm_get_scheduled_date()
- * @see alarm_get_scheduled_period()
*/
int alarm_schedule_after_delay(app_control_h app_control, int delay, int period, int *alarm_id);
@@ -156,6 +161,11 @@ int alarm_schedule_at_date(app_control_h app_control, struct tm *date, int perio
* @privlevel public
* @privilege %http://tizen.org/privilege/alarm.set
* @remarks If the application is uninstalled after setting an alarm, the alarm is cancelled automatically.
+ * If the operation of @a app_control is not specified, #APP_CONTROL_OPERATION_DEFAULT is used for the launch request.
+ * If the operation of @a app_control is #APP_CONTROL_OPERATION_DEFAULT, the package information is mandatory to explicitly launch the application.
+ * If the appid of @a app_control is not specified, this api is not allowed. In other words, the explicit @a app_control is only allowed.
+ * The @a app_control only supports UI application with this api. If @a app_control is not UI application, #ALARM_ERROR_NOT_PERMITTED_APP returned.
+ * When the alarm is expired, Alarm Manager will turn on LCD to prohibit background jobs.
*
* @param[in] app_control The destination app_control to perform a specific task when the alarm is triggered
* @param[in] delay The amount of time before the execution (in seconds)
@@ -167,10 +177,10 @@ int alarm_schedule_at_date(app_control_h app_control, struct tm *date, int perio
* @retval #ALARM_ERROR_INVALID_TIME Triggered time is invalid
* @retval #ALARM_ERROR_CONNECTION_FAIL Failed to connect to an alarm server
* @retval #ALARM_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #ALARM_ERROR_NOT_PERMITTED_APP @a app_control is not permitted. @a app_control for UI application is only permitted.
* @see alarm_cancel()
* @see alarm_cancel_all()
* @see alarm_get_scheduled_date()
- * @see alarm_get_scheduled_period()
*/
int alarm_schedule_once_after_delay(app_control_h app_control, int delay, int *alarm_id);
@@ -185,6 +195,9 @@ int alarm_schedule_once_after_delay(app_control_h app_control, int delay, int *a
* @remarks If application is uninstalled after setting an alarm, the alarm is cancelled automatically.
* If the operation of @a app_control is not specified, #APP_CONTROL_OPERATION_DEFAULT is used for the launch request.
* If the operation of @a app_control is #APP_CONTROL_OPERATION_DEFAULT, the package information is mandatory to explicitly launch the application.
+ * If the appid of @a app_control is not specified, this api is not allowed. In other words, the explicit @a app_control is only allowed.
+ * The @a app_control only supports UI application with this api. If @a app_control is not UI application, #ALARM_ERROR_NOT_PERMITTED_APP returned.
+ * When the alarm is expired, Alarm Manager will turn on LCD to prohibit background jobs.
*
* @param[in] app_control The destination app_control to perform specific work when the alarm is triggered
* @param[in] date The first active alarm time
@@ -196,10 +209,10 @@ int alarm_schedule_once_after_delay(app_control_h app_control, int delay, int *a
* @retval #ALARM_ERROR_INVALID_DATE Triggered date is invalid
* @retval #ALARM_ERROR_CONNECTION_FAIL Failed to connect to an alarm server
* @retval #ALARM_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #ALARM_ERROR_NOT_PERMITTED_APP @a app_control is not permitted. @a app_control for UI application is only permitted.
* @see alarm_cancel()
* @see alarm_cancel_all()
* @see alarm_get_scheduled_date()
- * @see alarm_get_scheduled_period()
*/
int alarm_schedule_once_at_date(app_control_h app_control, struct tm *date, int *alarm_id);
@@ -233,8 +246,7 @@ int alarm_schedule_once_at_date(app_control_h app_control, struct tm *date, int
* @see alarm_get_scheduled_date()
* @see #alarm_week_flag_e
*/
-int alarm_schedule_with_recurrence_week_flag(app_control_h app_control, struct tm *date, int week_flag,int *alarm_id);
-
+int alarm_schedule_with_recurrence_week_flag(app_control_h app_control, struct tm *date, int week_flag, int *alarm_id);
/**
* @brief Gets the recurrence days of the week.
@@ -245,13 +257,17 @@ int alarm_schedule_with_recurrence_week_flag(app_control_h app_control, struct t
* an error (error code #ALARM_ERROR_INVALID_PARAMETER) will occur because this alarm is scheduled with no recurrence.
* If the operation of @a app_control is not specified, #APP_CONTROL_OPERATION_DEFAULT is used for the launch request.
* If the operation of @a app_control is #APP_CONTROL_OPERATION_DEFAULT, the package information is mandatory to explicitly launch the application.
+ * Since 2.4, The @a app_control only supports UI application with this api. If @a app_control is not UI application, #ALARM_ERROR_NOT_PERMITTED_APP returned.
+ * When the alarm is expired, Alarm Manager will turn on LCD to prohibit background jobs.
+ * Since 2.4, If the appid of @a app_control is not specified, this api is not allowed. In other words, the explicit @a app_control is only allowed.
* @param[in] alarm_id The alarm ID returned when the alarm is scheduled
* @param[out] week_flag The recurrence days of the week, @a week_flag may be a combination of days, like #ALARM_WEEK_FLAG_TUESDAY | #ALARM_WEEK_FLAG_FRIDAY
* @return @c 0 on success,
* otherwise a negative error value
* @retval #ALARM_ERROR_NONE Successful
* @retval #ALARM_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #ALARM_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #ALARM_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #ALARM_ERROR_NOT_PERMITTED_APP @a app_control is not permitted. @a app_control for UI application is only permitted.
* @see alarm_schedule_with_recurrence_week_flag()
* @see #alarm_week_flag_e
*/
@@ -267,6 +283,7 @@ int alarm_get_scheduled_recurrence_week_flag(int alarm_id, int *week_flag);
* @return @c 0 on success,
* otherwise a negative error value
* @retval #ALARM_ERROR_NONE Successful
+ * @retval #ALARM_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #ALARM_ERROR_CONNECTION_FAIL Failed to connect to an alarm server
* @retval #ALARM_ERROR_PERMISSION_DENIED Permission denied
* @see alarm_schedule_at_date()
diff --git a/include/app_common.h b/include/app_common.h
index 5213880..992a4d3 100644
--- a/include/app_common.h
+++ b/include/app_common.h
@@ -38,51 +38,54 @@ extern "C" {
* @brief Enumeration for system events
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
+typedef enum {
APP_EVENT_LOW_MEMORY, /**< The low memory event */
APP_EVENT_LOW_BATTERY, /**< The low battery event */
APP_EVENT_LANGUAGE_CHANGED, /**< The system language changed event */
APP_EVENT_DEVICE_ORIENTATION_CHANGED, /**< The device orientation changed event */
APP_EVENT_REGION_FORMAT_CHANGED, /**< The region format changed event */
+ APP_EVENT_SUSPENDED_STATE_CHANGED, /**< The suspended state changed event of the application (since 2.4)
+ @see app_event_get_suspended_state */
} app_event_type_e;
-
/**
* @brief Enumeration for device orientation.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
+typedef enum {
APP_DEVICE_ORIENTATION_0 = 0, /**< The device is oriented in a natural position */
APP_DEVICE_ORIENTATION_90 = 90, /**< The device's left side is at the top */
APP_DEVICE_ORIENTATION_180 = 180, /**< The device is upside down */
APP_DEVICE_ORIENTATION_270 = 270, /**< The device's right side is at the top */
} app_device_orientation_e;
-
/**
* @brief Enumeration for low memory status.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
+typedef enum {
APP_EVENT_LOW_MEMORY_NORMAL = 0x01, /**< Normal status */
APP_EVENT_LOW_MEMORY_SOFT_WARNING = 0x02, /**< Soft warning status */
APP_EVENT_LOW_MEMORY_HARD_WARNING = 0x04, /**< Hard warning status */
} app_event_low_memory_status_e;
-
/**
* @brief Enumeration for battery status.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
+typedef enum {
APP_EVENT_LOW_BATTERY_POWER_OFF = 1, /**< The battery status is under 1% */
APP_EVENT_LOW_BATTERY_CRITICAL_LOW, /**< The battery status is under 5% */
} app_event_low_battery_status_e;
+/**
+ * @brief Enumeration for suspended state
+ * @since_tizen 2.4
+ */
+typedef enum {
+ APP_SUSPENDED_STATE_WILL_ENTER = 0, /**< Application will enter the suspended state */
+ APP_SUSPENDED_STATE_DID_EXIT, /**< Application did exit from the suspended state */
+} app_suspended_state_e;
/**
* @brief The event handler that returned from add event handler function
@@ -105,6 +108,7 @@ typedef struct app_event_handler* app_event_handler_h;
* @see app_event_get_language
* @see app_event_get_region_format
* @see app_event_get_device_orientation
+ * @see app_event_get_suspended_state
*/
typedef struct app_event_info* app_event_info_h;
@@ -118,6 +122,12 @@ typedef struct app_event_info* app_event_info_h;
*
* @see app_add_event_handler
* @see app_event_info_h
+ *
+ * @remarks If the given @a event_info has #APP_SUSPENDED_STATE_WILL_ENTER value,
+ * the application should not call any asynchronous operations in this callback.
+ * After the callback returns, process of the application will be changed to suspended
+ * state immediately. Thus, asynchronous operations may work incorrectly. (since 2.4)
+ *
*/
typedef void (*app_event_cb)(app_event_info_h event_info, void *user_data);
@@ -213,6 +223,25 @@ int app_event_get_device_orientation(app_event_info_h event_info, app_device_ori
/**
+ * @brief Gets the suspended state of the application from given event info.
+ *
+ * @since_tizen 2.4
+ * @param[in] event_info The handle for getting the suspended state
+ * @param[out] state The suspended state of the application
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #APP_ERROR_NONE Successful
+ * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_ERROR_INVALID_CONTEXT Invalid event context
+ *
+ * @remarks The application should not use any asynchronous operations in #APP_SUSPENDED_STATE_WILL_ENTER event.
+ * Because applications will be changed to suspended state just after #APP_SUSPENDED_STATE_WILL_ENTER,
+ * asynchronous calls are not guaranteed to work properly.
+ */
+int app_event_get_suspended_state(app_event_info_h event_info, app_suspended_state_e *state);
+
+
+/**
* @brief Gets the ID of the application.
*
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
@@ -362,6 +391,8 @@ char *app_get_shared_trusted_path(void);
* @remarks The returned path should be released. @n
* The important files stored in the application's external data directory should be
* encrypted because they can be exported via the external sdcard.
+ * @remarks To access the path returned by this function requires the privilege
+ * that is "http://tizen.org/privilege/externalstorage.appdata".
*
* @return The absolute path to the application's external data directory, @n
* otherwise a null pointer if the memory is insufficient
@@ -380,6 +411,8 @@ char *app_get_external_data_path(void);
* Setting application while the application is running. @n
* The important files stored in the application's external cache directory should be
* encrypted because they can be exported via the external sdcard.
+ * @remarks To access the path returned by this function requires the privilege
+ * that is "http://tizen.org/privilege/externalstorage.appdata".
*
* @return The absolute path to the application's external cache directory, @n
* otherwise a null pointer if the memory is insufficient
@@ -388,12 +421,16 @@ char *app_get_external_cache_path(void);
/**
+ * @deprecated Deprecated since 2.4.
* @brief Gets the absolute path to the application's external shared data directory which is
* used to share data with other applications.
* @details An application can read and write its own files in the application's external shared
* data directory and others can only read the files.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @remarks The specified @a path should be released.
+ * @remarks To access the path returned by this function requires the privilege
+ * that is "http://tizen.org/privilege/externalstorage.appdata".
+ * @remarks The function may not work as intended in certain devices due to some implementation issues.
*
* @return The absolute path to the application's external shared data directory, @n
* otherwise a null pointer if the memory is insufficient
diff --git a/include/app_control.h b/include/app_control.h
index 05cd669..38b6b12 100644
--- a/include/app_control.h
+++ b/include/app_control.h
@@ -48,8 +48,7 @@ typedef struct app_control_s* app_control_h;
* @brief Enumeration for App Control Error.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
+typedef enum {
APP_CONTROL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
APP_CONTROL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
APP_CONTROL_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
@@ -70,8 +69,7 @@ typedef enum
* @see app_control_enable_app_started_result_event()
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
+typedef enum {
APP_CONTROL_RESULT_APP_STARTED = 1, /**< Callee application launched actually (Since 2.4) */
APP_CONTROL_RESULT_SUCCEEDED = 0, /**< Operation succeeded */
APP_CONTROL_RESULT_FAILED = -1, /**< Operation failed by the callee */
diff --git a/include/app_control_internal.h b/include/app_control_internal.h
index 0da484a..54502c2 100644
--- a/include/app_control_internal.h
+++ b/include/app_control_internal.h
@@ -35,6 +35,27 @@ extern "C" {
*/
/**
+ * @brief Definition for app_control data: Connect the previous app with the next app when the sub-app is terminated.
+ * @details If a sub-app is terminated, framework will connect the previous app with the next app.
+ * By default, this flag is 'false'
+ */
+#define APP_CONTROL_DATA_REROUTE "__K_REROUTE__"
+
+/**
+ * @brief Definition for app_control data: The flag for attaching app.
+ * @details If this flag is set, callee app will be attached to caller app for a while and it will be detached when callee app is lowered.
+ * By default, this flag is 'false'
+ */
+#define APP_CONTROL_DATA_SHIFT_WINDOW "__K_SHIFT_WINDOW"
+
+/**
+ * @brief Definition for app_control data : The flag for supporting recycling processes.
+ * @details By default, this flag is 'false'. Once it is set to 'true', launched sub-app process will be reused even if it was lowered later.
+ *
+ */
+#define APP_CONTROL_DATA_RECYCLE "__K_RECYCLE"
+
+/**
* @brief Replaces all data in the app_control with the bundle
*
* @remarks This function clears all data in the app_control and adds all key-value pairs in the bundle into the app_control
diff --git a/include/app_event.h b/include/app_event.h
index 706b506..a61b777 100644
--- a/include/app_event.h
+++ b/include/app_event.h
@@ -55,8 +55,7 @@ typedef void (*event_cb)(const char *event_name, bundle *event_data, void *user_
* @brief Enumeration for Event Error.
* @since_tizen 2.4
*/
-typedef enum
-{
+typedef enum {
EVENT_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
EVENT_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
EVENT_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
diff --git a/include/app_extension.h b/include/app_extension.h
new file mode 100755
index 0000000..05cb2ee
--- /dev/null
+++ b/include/app_extension.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __TIZEN_APPFW_APP_EXTENSION_H__
+#define __TIZEN_APPFW_APP_EXTENSION_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Gets the preinitialized window object.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks This API only supports BASIC type window.
+ *
+ * @param[in] win_name The name to be set for the preinitialized window
+ *
+ * @return A @a window object on success,
+ * otherwise @c NULL
+ */
+void *app_get_preinitialized_window(const char *win_name);
+
+/**
+ * @brief Gets the preinitialized background object added to the preinitialized window.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks This API should be called after calling app_get_preinitizlized_window().
+ *
+ * @return A @a background object on success,
+ * otherwise @c NULL
+ */
+void *app_get_preinitialized_background(void);
+
+/**
+ * @brief Gets the preinitialized conformant widget added to the preinitialized window.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @remarks This API should be called after calling app_get_preinitizlized_window().
+ *
+ * @return A conformant object on success,
+ * otherwise @c NULL
+ */
+void *app_get_preinitialized_conformant(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TIZEN_APPFW_APP_EXTENSION_H__ */
diff --git a/include/app_internal.h b/include/app_internal.h
index 1bd73d5..8380602 100644
--- a/include/app_internal.h
+++ b/include/app_internal.h
@@ -18,16 +18,15 @@
#ifndef __TIZEN_APPFW_APP_INTERNAL_H__
#define __TIZEN_APPFW_APP_INTERNAL_H__
+#include <app.h>
#include <appcore-common.h>
#include <tzplatform_config.h>
-// GNU gettext macro is already defined at appcore-common.h
+/* GNU gettext macro is already defined at appcore-common.h */
#ifdef _
#undef _
#endif
-#include <app.h>
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -70,6 +69,194 @@ int app_finalizer_remove(app_finalizer_cb callback);
void app_finalizer_execute(void);
+int app_get_package(char **package);
+
+/**
+ * @internal
+ * @brief Called when the system memory is running low.
+ *
+ * @details When a low memory event is dispatched, the application should immediately save state and release resources to save as much memory as possible. \n
+ * If enough memory is not reclaimed during low memory conditions, the system will terminate some of the applications to reclaim the memory.
+ *
+ * @since_tizen 2.3
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see app_main()
+ * @see #app_event_callback_s
+ */
+typedef void (*app_low_memory_cb) (void *user_data);
+
+/**
+ * @internal
+ * @brief Called when the battery power is running low.
+ * @details When the battery level falls below 5%, it is called.
+ *
+ * @since_tizen 2.3
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see app_main()
+ * @see #app_event_callback_s
+ */
+typedef void (*app_low_battery_cb) (void *user_data);
+
+/**
+ * @internal
+ * @brief Called when the orientation of the device changes.
+ *
+ * @since_tizen 2.3
+ * @param[in] orientation The orientation of the device
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see app_main()
+ * @see #app_event_callback_s
+ */
+typedef void (*app_device_orientation_cb) (app_device_orientation_e orientation, void *user_data);
+
+/**
+ * @internal
+ * @brief Called when language setting changes.
+ *
+ * @since_tizen 2.3
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see app_main()
+ * @see #app_event_callback_s
+ */
+typedef void (*app_language_changed_cb) (void *user_data);
+
+/**
+ * @internal
+ * @brief Called when region format setting changes.
+ *
+ * @since_tizen 2.3
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see app_main()
+ * @see #app_event_callback_s
+ */
+typedef void (*app_region_format_changed_cb) (void *user_data);
+
+/**
+ * @internal
+ * @brief The structure type containing the set of callback functions for handling application events.
+ * @details It is one of the input parameters of the app_main() function.
+ *
+ * @since_tizen 2.3
+ * @see app_main()
+ * @see app_create_cb()
+ * @see app_pause_cb()
+ * @see app_resume_cb()
+ * @see app_terminate_cb()
+ * @see app_control_cb()
+ * @see app_low_memory_cb()
+ * @see app_low_battery_cb()
+ * @see app_device_orientation_cb()
+ * @see app_language_changed_cb()
+ * @see app_region_format_changed_cb()
+ */
+typedef struct {
+ app_create_cb create; /**< This callback function is called at the start of the application. */
+ app_terminate_cb terminate; /**< This callback function is called once after the main loop of the application exits. */
+ app_pause_cb pause; /**< This callback function is called each time the application is completely obscured by another application and becomes invisible to the user. */
+ app_resume_cb resume; /**< This callback function is called each time the application becomes visible to the user. */
+ app_control_cb app_control; /**< This callback function is called when another application sends the launch request to the application. */
+ app_low_memory_cb low_memory; /**< The registered callback function is called when the system runs low on memory. */
+ app_low_battery_cb low_battery; /**< The registered callback function is called when the battery is low. */
+ app_device_orientation_cb device_orientation; /**< The registered callback function is called when the orientation of the device changes */
+ app_language_changed_cb language_changed; /**< The registered callback function is called when language setting changes. */
+ app_region_format_changed_cb region_format_changed; /**< The registered callback function is called when region format setting changes. */
+} app_event_callback_s;
+
+/**
+ * @internal
+ * @brief Runs the application's main loop until app_exit() is called.
+ *
+ * @details This function is the main entry point of the Tizen application.
+ * The app_create_cb() callback function is called to initialize the application before the main loop of application starts up.
+ * After the app_create_cb() callback function returns true, the main loop starts up and the app_control_cb() callback function is subsequently called.
+ * If the app_create_cb() callback function returns false, the main loop doesn't start up and app_terminate_cb() callback function is called.
+ *
+ * @since_tizen 2.3
+ * @param[in] argc The argument count
+ * @param[in] argv The argument vector
+ * @param[in] callback The set of callback functions to handle application events
+ * @param[in] user_data The user data to be passed to the callback functions
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #APP_ERROR_NONE Successful
+ * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_ERROR_INVALID_CONTEXT The application is illegally launched, not launched by the launch system
+ * @retval #APP_ERROR_ALREADY_RUNNING The main loop already starts
+ *
+ * @see app_create_cb()
+ * @see app_terminate_cb()
+ * @see app_pause_cb()
+ * @see app_resume_cb()
+ * @see app_control_cb()
+ * @see app_low_memory_cb()
+ * @see app_low_battery_cb()
+ * @see app_device_orientation_cb()
+ * @see app_language_changed_cb()
+ * @see app_region_format_changed_cb()
+ * @see app_exit()
+ * @see #app_event_callback_s
+ */
+int app_main(int argc, char **argv, app_event_callback_s *callback, void *user_data);
+
+/**
+ * @internal
+ * @brief Runs the application's main loop until app_efl_exit() is called.
+ *
+ * @details This function is the main entry point of the Tizen application.
+ * The app_create_cb() callback function is called to initialize the application before the main loop of the application starts up.
+ * After the app_create_cb() callback function returns @c true, the main loop starts up and the app_control_cb() callback function is subsequently called.
+ * If the app_create_cb() callback function returns @c false, the main loop doesn't start up and the app_terminate_cb() callback function is called.
+ *
+ * @since_tizen 2.3
+ * @param[in] argc The argument count
+ * @param[in] argv The argument vector
+ * @param[in] callback The set of callback functions to handle application events
+ * @param[in] user_data The user data to be passed to the callback functions
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_ERROR_NONE Successful
+ * @retval #APP_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_ERROR_INVALID_CONTEXT The application is illegally launched, not launched by the launch system
+ * @retval #APP_ERROR_ALREADY_RUNNING The main loop has already started
+ *
+ * @see app_create_cb()
+ * @see app_terminate_cb()
+ * @see app_pause_cb()
+ * @see app_resume_cb()
+ * @see app_control_cb()
+ * @see app_low_memory_cb()
+ * @see app_low_battery_cb()
+ * @see app_device_orientation_cb()
+ * @see app_language_changed_cb()
+ * @see app_region_format_changed_cb()
+ * @see app_efl_exit()
+ * @see #app_event_callback_s
+ */
+int app_efl_main(int *argc, char ***argv, app_event_callback_s *callback, void *user_data);
+
+/**
+ * @internal
+ * @brief Exits the main loop of application.
+ *
+ * @details The main loop of application stops and app_terminate_cb() is invoked.
+ * @since_tizen 2.3
+ * @see app_main()
+ * @see app_terminate_cb()
+ */
+void app_exit(void);
+
+/**
+ * @internal
+ * @brief Exits the main loop of the application.
+ *
+ * @details The main loop of the application stops and app_terminate_cb() is invoked.
+ * @since_tizen 2.3
+ * @see app_efl_main()
+ * @see app_terminate_cb()
+ */
+void app_efl_exit(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/app_preference.h b/include/app_preference.h
index 8b2ff86..01e0136 100644
--- a/include/app_preference.h
+++ b/include/app_preference.h
@@ -38,8 +38,7 @@ extern "C" {
* @brief Enumeration for Preference Error.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
+typedef enum {
PREFERENCE_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
PREFERENCE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
PREFERENCE_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
diff --git a/include/app_preference_internal.h b/include/app_preference_internal.h
index cb670fe..12706ed 100644
--- a/include/app_preference_internal.h
+++ b/include/app_preference_internal.h
@@ -28,8 +28,8 @@ extern "C" {
#define BUF_LEN (4096)
#define PREF_DIR ".pref/"
-#define PREFERENCE_KEY_PATH_LEN 1024
-#define ERR_LEN 128
+#define PREFERENCE_KEY_PATH_LEN 1024
+#define ERR_LEN 128
#define PREF_DB_NAME ".pref.db"
#define PREF_TBL_NAME "pref"
@@ -91,8 +91,7 @@ extern "C" {
*/
#define PREFERENCE_ERROR_FILE_LOCK -29
-typedef enum
-{
+typedef enum {
PREFERENCE_TYPE_NONE = 0,
PREFERENCE_TYPE_STRING,
PREFERENCE_TYPE_INT,
@@ -100,7 +99,7 @@ typedef enum
PREFERENCE_TYPE_BOOLEAN,
} preference_type_e;
-typedef struct _pref_changed_cb_node_t{
+typedef struct _pref_changed_cb_node_t {
char *key;
preference_changed_cb cb;
void *user_data;
@@ -109,15 +108,15 @@ typedef struct _pref_changed_cb_node_t{
} pref_changed_cb_node_t;
typedef struct _keynode_t {
- char *keyname; /**< Keyname for keynode */
- int type; /**< Keynode type */
- union {
- int i; /**< Integer type */
- int b; /**< Bool type */
- double d; /**< Double type */
- char *s; /**< String type */
- } value; /**< Value for keynode */
- struct _keynode_t *next; /**< Next keynode */
+ char *keyname; /**< Keyname for keynode */
+ int type; /**< Keynode type */
+ union {
+ int i; /**< Integer type */
+ int b; /**< Bool type */
+ double d; /**< Double type */
+ char *s; /**< String type */
+ } value; /**< Value for keynode */
+ struct _keynode_t *next; /**< Next keynode */
} keynode_t;
/**
@@ -125,9 +124,9 @@ typedef struct _keynode_t {
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef struct _keylist_t {
- int num; /**< Number of list */
- keynode_t *head; /**< Head node */
- keynode_t *cursor; /**< Cursor node */
+ int num; /**< Number of list */
+ keynode_t *head; /**< Head node */
+ keynode_t *cursor; /**< Cursor node */
} keylist_t;
diff --git a/include/app_resource_manager.h b/include/app_resource_manager.h
index df58729..d0c8080 100644
--- a/include/app_resource_manager.h
+++ b/include/app_resource_manager.h
@@ -86,7 +86,8 @@ int app_resource_manager_init(void);
* otherwise a negative error value
* @retval #APP_RESOURCE_ERROR_NONE Successful
* @retval #APP_RESOURCE_ERROR_INVALID_PARAMETER Invalid Parameter
- * @retval #APP_RESOURCE_ERROR_IO_ERROR Internal I/O Error
+ * @retval #APP_RESOURCE_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_RESOURCE_ERROR_IO_ERROR Internal I/O Error or failed to find valid resource
* @see app_resource_manager_init()
*/
int app_resource_manager_get(app_resource_e type, const char *id, char **path);
diff --git a/include/app_types.h b/include/app_types.h
index 80c19d0..bef1f42 100644
--- a/include/app_types.h
+++ b/include/app_types.h
@@ -34,8 +34,7 @@
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
-typedef enum
-{
+typedef enum {
APP_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
APP_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
APP_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */