summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/app_context.h151
-rwxr-xr-xinclude/app_info.h502
-rw-r--r--include/app_info_internal.h66
-rwxr-xr-xinclude/app_manager.h353
-rw-r--r--[-rwxr-xr-x]include/app_manager_internal.h (renamed from include/app_manager_private.h)39
5 files changed, 746 insertions, 365 deletions
diff --git a/include/app_context.h b/include/app_context.h
index 79e8eb1..c4aa724 100755
--- a/include/app_context.h
+++ b/include/app_context.h
@@ -11,10 +11,10 @@
* 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.
*/
-
+
#ifndef __TIZEN_APPFW_APP_CONTEXT_H
#define __TIZEN_APPFW_APP_CONTEXT_H
@@ -25,41 +25,42 @@
extern "C" {
#endif
-
/**
- * @defgroup CAPI_APP_CONTEXT_MODULE Application Context
- * @ingroup CAPI_APPLICATION_MANAGER_MODULE
+ * @file app_context.h
*/
-
/**
- * @addtogroup CAPI_APP_CONTEXT_MODULE
+ * @addtogroup CAPI_APP_CONTEXT_MODULE
* @{
*/
/**
- * @brief Application context handle.
+ * @brief Application context handle.
+ * @since_tizen 2.3
*/
typedef struct app_context_s *app_context_h;
/**
- * @brief Enumerations of event type for the application context event
+ * @brief Enumeration for Application Context Event.
+ * @since_tizen 2.3
*/
typedef enum
{
- APP_CONTEXT_EVENT_LAUNCHED, /**< The application is launched */
- APP_CONTEXT_EVENT_TERMINATED, /**< The application is terminated */
+ APP_CONTEXT_EVENT_LAUNCHED, /**< The application is launched */
+ APP_CONTEXT_EVENT_TERMINATED, /**< The application is terminated */
} app_context_event_e;
/**
- * @brief Destroys the application context handle and releases all its resources.
- * @param [in] app_context The application context handle
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @brief Destroys the application context handle and releases all its resources.
+ * @since_tizen 2.3
+ * @param[in] app_context The application context handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
* @see app_manager_foreach_app_context()
* @see app_manager_get_app_context()
*/
@@ -67,83 +68,97 @@ int app_context_destroy(app_context_h app_context);
/**
- * @brief Gets the package with the given application context.
- * @remark This function is @b deprecated. Use app_context_get_app_id() instead.
- * @remarks @a package must be released with free() by you.
- * @param [in] app_context The application context
- * @param [out] package The package of the given application context
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Gets the package with the given application context.
+ * @since_tizen 2.3
+ * @remarks This function is @b deprecated. Use app_context_get_app_id() instead. \n
+ * You must release @a package using free().
+ * @param[in] app_context The application context
+ * @param[out] package The package of the given application context
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
int app_context_get_package(app_context_h app_context, char **package);
/**
- * @brief Gets the application ID with the given application context.
- * @remarks @a app_id must be released with free() by you.
- * @param [in] app_context The application context
- * @param [out] app_id The application ID of the given application context
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Gets the application ID with the given application context.
+ * @since_tizen 2.3
+ * @remarks You must release @a app_id using free().
+ * @param[in] app_context The application context
+ * @param[out] app_id The application ID of the given application context
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
int app_context_get_app_id(app_context_h app_context, char **app_id);
/**
- * @brief Gets the process ID with the given application context.
- * @param [in] app_context The application context
- * @param [out] pid The process ID of the given application context
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Gets the process ID with the given application context.
+ * @since_tizen 2.3
+ * @param[in] app_context The application context
+ * @param[out] pid The process ID of the given application context
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
int app_context_get_pid(app_context_h app_context, pid_t *pid);
/**
- * @brief Checks whether the application with the given application context is terminated.
- * @param [in] app_context The application context
- * @param [out] terminated true if the application is terminated, false if the application is running
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Checks whether the application with the given application context is terminated.
+ * @since_tizen 2.3
+ * @param[in] app_context The application context
+ * @param[out] terminated @c true if the application is terminated, \n
+ * otherwise @c false if the application is running
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
int app_context_is_terminated(app_context_h app_context, bool *terminated);
/**
- * @brief Checks whether two application contexts are equal.
- * @param [in] lhs The first application context to compare
- * @param [in] rhs The second application context to compare
- * @param [out] equal true if the application contexts are equal, otherwise false
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Checks whether two application contexts are equal.
+ * @since_tizen 2.3
+ * @param[in] lhs The first application context to compare
+ * @param[in] rhs The second application context to compare
+ * @param[out] equal @c true if the application contexts are equal, \n
+ * otherwise @c false if they are not equal
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
int app_context_is_equal(app_context_h lhs, app_context_h rhs, bool *equal);
/**
- * @brief Clones the application context handle.
- * @param [out] clone If successful, a newly created application context handle will be returned.
- * @param [in] app_context The application context
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Clones the application context handle.
+ * @since_tizen 2.3
+ * @param[out] clone The newly created application context handle, if cloning is successful
+ * @param[in] app_context The application context
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
int app_context_clone(app_context_h *clone, app_context_h app_context);
diff --git a/include/app_info.h b/include/app_info.h
index 484f6a0..fb1e1b8 100755
--- a/include/app_info.h
+++ b/include/app_info.h
@@ -11,10 +11,10 @@
* 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.
*/
-
+
#ifndef __TIZEN_APPFW_APP_INFO_H
#define __TIZEN_APPFW_APP_INFO_H
@@ -24,159 +24,459 @@
extern "C" {
#endif
+/**
+ * @file app_info.h
+ */
+
+/**
+* @addtogroup CAPI_APP_INFO_MODULE
+* @{
+*/
+
+/** @brief Definition for string property for filtering based on app info. */
+#define PACKAGE_INFO_PROP_APP_ID "PACKAGE_INFO_PROP_APP_ID"
+#define PACKAGE_INFO_PROP_APP_TYPE "PACKAGE_INFO_PROP_APP_TYPE"
+#define PACKAGE_INFO_PROP_APP_CATEGORY "PACKAGE_INFO_PROP_APP_CATEGORY"
+
+/** @brief Definition for boolean property for filtering based on app info. */
+#define PACKAGE_INFO_PROP_APP_NODISPLAY "PACKAGE_INFO_PROP_APP_NODISPLAY"
+#define PACKAGE_INFO_PROP_APP_TASKMANAGE "PACKAGE_INFO_PROP_APP_TASKMANAGE"
/**
* @brief Application information handle.
+ * @since_tizen 2.3
*/
typedef struct app_info_s *app_info_h;
+/**
+ * @brief Application filter handle.
+ * @since_tizen 2.3
+ */
+typedef struct app_info_filter_s *app_info_filter_h;
+
+/**
+ * @brief Application metadata filter handle.
+ * @since_tizen 2.3
+ */
+typedef struct app_info_metadata_filter_s *app_info_metadata_filter_h;
+
+/**
+ * @brief Called to get the application information once for each installed application.
+ * @since_tizen 2.3
+ * @param[in] app_info The application information of each installed application
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n
+ * otherwise @c false to break out of the loop
+ * @pre app_manager_foreach_app_info() will invoke this callback.
+ * @see app_manager_foreach_app_info()
+ */
+typedef bool (*app_info_filter_cb) (app_info_h app_info, void *user_data);
+
+/**
+ * @brief Called to get application metadata in app_info_foreach_metadata().
+ * @since_tizen 2.3
+ * @param[in] metadata_name The name of the metadata
+ * @param[in] metadata_value The value of the metadata
+ * @param[in] user_data The user data passed to app_info_foreach_metadata()
+ * @return @c true to continue with the next iteration of the loop, \n
+ * otherwise @c false to break out of the loop
+ * @pre app_info_foreach_metadata() will invoke this callback.
+ * @see app_info_foreach_metadata()
+ */
+typedef bool (*app_info_metadata_cb) (const char *metadata_key, const char *metadata_value, void *user_data);
/**
- * @brief Enumerations of event type for the application information event
+ * @brief Enumeration for Application Information Event.
+ * @since_tizen 2.3
*/
typedef enum
{
- APP_INFO_EVENT_INSTALLED, /**< The application is newly installed */
- APP_INFO_EVENT_UNINSTALLED, /**< The application is uninstalled */
- APP_INFO_EVENT_UPDATED, /**< The application is updated */
+ APP_INFO_EVENT_INSTALLED, /**< The application is newly installed */
+ APP_INFO_EVENT_UNINSTALLED, /**< The application is uninstalled */
+ APP_INFO_EVENT_UPDATED, /**< The application is updated */
} app_info_event_e;
+/**
+ * @brief Creates the application information handle.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @param[in] app_id The application ID
+ * @param[out] app_info The application information handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_NO_SUCH_APP The app is not installed
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @see app_manager_foreach_app_info()
+ * @see app_manager_get_app_info()
+ */
+int app_info_create(const char *app_id, app_info_h *app_info);
/**
- * @brief Destroys the application information handle and releases all its resources.
- * @param [in] app_info The application information handle
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @brief Destroys the application information handle and releases all its resources.
+ * @since_tizen 2.3
+ * @param[in] app_info The application information handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
* @see app_manager_foreach_app_info()
* @see app_manager_get_app_info()
*/
int app_info_destroy(app_info_h app_info);
-
/**
- * @brief Gets the application ID with the given application context.
- * @remarks @a app_id must be released with free() by you.
- * @param [in] app_info The application information
- * @param [out] app_id The application ID of the given application context
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Gets the application ID with the given application context.
+ * @since_tizen 2.3
+ * @remarks You must release @a app_id using free().
+ * @param[in] app_info The application information
+ * @param[out] app_id The application ID of the given application context
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
int app_info_get_app_id(app_info_h app_info, char **app_id);
+/**
+ * @brief Gets the executable path of the application
+ * @since_tizen 2.3
+ * @remarks You must release @a exec path using free().
+ * @param[in] app_info The application information
+ * @param[out] exec The executable path of the application
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int app_info_get_exec(app_info_h app_info, char **exec);
/**
- * @brief Gets the name of the application
- * @remarks @a name must be released with free() by you.
- * @param [in] app_info The application information
- * @param [out] name The label of the application
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Gets the label of the application.
+ * @since_tizen 2.3
+ * @remarks You must release @a label using free().
+ * @param[in] app_info The application information
+ * @param[out] label The label of the application
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
int app_info_get_label(app_info_h app_info, char **label);
+/**
+ * @brief Gets the localed name of the application.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @remarks You must release localed name using free().
+ * @param[in] app_id The application ID
+ * @param[in] locale The locale information
+ * @param[out] label The localed name of the application
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ */
+int app_info_get_localed_label(const char *app_id, const char *locale, char **label);
/**
- * @brief Gets the absolute path to the icon image
- * @remarks @a path must be released with free() by you.
- * @param [in] app_info The application information
- * @param [out] path The absolute path to the icon
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Gets the absolute path to the icon image.
+ * @since_tizen 2.3
+ * @remarks You must release @a path using free().
+ * @param[in] app_info The application information
+ * @param[out] path The absolute path to the icon
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
int app_info_get_icon(app_info_h app_info, char **path);
+/**
+ * @brief Gets the package name.
+ * @since_tizen 2.3
+ * @remarks You must release @a package name using free().
+ * @param[in] app_info The application information
+ * @param[out] package The package name
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int app_info_get_package(app_info_h app_info, char **package);
/**
- * @brief Checks whether two application information are equal.
- * @param [in] lhs The first application information to compare
- * @param [in] rhs The second application information to compare
- * @param [out] equal true if the application information are equal, otherwise false
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Gets the package type name.
+ * @since_tizen 2.3
+ * @remarks You must release package @a type name using free().
+ * @param[in] app_info The application information
+ * @param[out] type The package type
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int app_info_get_type(app_info_h app_info, char **type);
+
+/**
+ * @brief Gets the list of metadata for a particular application.
+ * @since_tizen 2.3
+ * @param[in] app_info The application information
+ * @param[in] callback The callback function for list
+ * @param[in] user_data The user data to be passed to callback function
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int app_info_foreach_metadata(app_info_h app_info, app_info_metadata_cb callback, void *user_data);
+
+/**
+ * @brief Checks whether application information is nodisplay.
+ * @since_tizen 2.3
+ * @param[in] app_info The application information
+ * @param[out] nodisplay @c true if the application is nodisplay, \n
+ * otherwise @c false
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int app_info_is_nodisplay(app_info_h app_info, bool *nodisplay);
+
+/**
+ * @brief Checks whether two application information are equal.
+ * @since_tizen 2.3
+ * @param[in] lhs The first application information to compare
+ * @param[in] rhs The second application information to compare
+ * @param[out] equal @c true if the application information are equal, \n
+ * otherwise @c false
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
int app_info_is_equal(app_info_h lhs, app_info_h rhs, bool *equal);
+/**
+ * @brief Checks whether application is enabled.
+ * @since_tizen 2.3
+ * @param[in] app_info The application information
+ * @param[out] enabled @c true if the application is enabled, \n
+ * otherwise @c false
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int app_info_is_enabled(app_info_h app_info, bool *enabled);
+
+/**
+ * @brief Checks whether application is launched on booting time.
+ * @since_tizen 2.3
+ * @param[in] app_info The application information
+ * @param[out] onboot @c true if the application is launched on booting time, \n
+ * otherwise @c false
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int app_info_is_onboot(app_info_h app_info, bool *onboot);
+
+/**
+ * @brief Checks whether application is preloaded.
+ * @since_tizen 2.3
+ * @param[in] app_info The application information
+ * @param[out] preload @c true if the application is preloaded, \n
+ * otherwise @c false
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int app_info_is_preload(app_info_h app_info, bool *preload);
/**
- * @brief Clones the application information handle.
- * @param [out] clone If successful, a newly created application information handle will be returned.
- * @param [in] app_info The application information
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Clones the application information handle.
+ * @since_tizen 2.3
+ * @param[out] clone A newly created application information handle, if successfully cloned
+ * @param[in] app_info The application information
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
int app_info_clone(app_info_h *clone, app_info_h app_info);
+/**
+ * @brief Creates the application information filter handle from DB.
+ * All filter properties will be ANDed.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @param[out] handle The pointer to the application info filter handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ */
+int app_info_filter_create(app_info_filter_h *handle);
/**
- * @brief Gets the absolute path to the icon image
- * @remarks @a path must be released with free() by you.
- * @param [in] app_info The application information
- * @param [out] package The package name
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Destroys the application information filter handle, freeing up all the resources.
+ * @since_tizen 2.3
+ * @param[in] handle The pointer to the application info filter handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
-int app_info_get_package(app_info_h app_info, char **package);
+int app_info_filter_destroy(app_info_filter_h handle);
+/**
+ * @brief Adds a boolean filter property to the filter handle.
+ * @since_tizen 2.3
+ * @param[in] handle The pointer to the application info filter handle
+ * @param[in] property The integer property name
+ * @param[in] value The value corresponding to the property
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int app_info_filter_add_bool(app_info_filter_h handle, const char *property, const bool value);
/**
- * @brief Gets the absolute path to the icon image
- * @remarks @a path must be released with free() by you.
- * @param [in] app_info The application information
- * @param [out] type The package type
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Adds a string filter property to the filter handle.
+ * @since_tizen 2.3
+ * @param[in] handle The pointer to the application info filter handle
+ * @param[in] property The integer property name
+ * @param[in] value The value corresponding to the property
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
*/
-int app_info_get_type(app_info_h app_info, char **type);
+int app_info_filter_add_string(app_info_filter_h handle, const char *property, const char *value);
+/**
+ * @brief Gets the count of filtered apps.
+ * @since_tizen 2.3
+ * @param[in] handle The pointer to the application info filter handle
+ * @param[out] count The pointer to the variable for count
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_IO_ERROR I/O error
+ */
+int app_info_filter_count_appinfo(app_info_filter_h handle, int *count);
+
+/**
+ * @brief Executes the user supplied callback function for each application that satisfy the filter conditions.
+ * @since_tizen 2.3
+ * @param[in] handle The pointer to the application info filter handle
+ * @param[in] callback The callback function
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int app_info_filter_foreach_appinfo(app_info_filter_h handle, app_info_filter_cb callback, void * user_data);
+
+/**
+ * @brief Creates the application's metadata information filter handle from DB.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @param[out] handle The pointer to the application metadata info filter handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ */
+int app_info_metadata_filter_create(app_info_metadata_filter_h *handle);
+
+/**
+ * @brief Destroys the application's metadata information filter handle.
+ * @since_tizen 2.3
+ * @param[in] handle The pointer to the application info filter handle
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int app_info_metadata_filter_destroy(app_info_metadata_filter_h handle);
-#define __START_OF_DEPRECATED_API
-int app_info_get_name(app_info_h app_info, char **name);
-
-typedef struct ui_app_info_s *ui_app_info_h;
-typedef struct service_app_info_s *service_app_info_h;
-int ui_app_info_destroy(ui_app_info_h ui_app_info);
-int ui_app_info_get_app_id(ui_app_info_h ui_app_info, char **app_id);
-int ui_app_info_get_label(ui_app_info_h ui_app_info, char **label);
-int ui_app_info_get_icon(ui_app_info_h ui_app_info, char **iconpath);
-int ui_app_info_is_equal(ui_app_info_h lhs, ui_app_info_h rhs, bool *equal);
-int ui_app_info_clone(ui_app_info_h *clone, ui_app_info_h ui_app_info);
-int ui_app_info_get_package(ui_app_info_h ui_app_info, char **package);
-int ui_app_info_get_type(ui_app_info_h ui_app_info, char **type);
-//int ui_app_info_get_category(ui_app_info_h ui_app_info, char **category);
-int service_app_info_destroy(service_app_info_h service_app_info);
-int service_app_info_get_app_id(service_app_info_h service_app_info, char **app_id);
-int service_app_info_get_label(service_app_info_h service_app_info, char **label);
-int service_app_info_get_icon(service_app_info_h service_app_info, char **iconpath);
-int service_app_info_is_equal(service_app_info_h lhs, service_app_info_h rhs, bool *equal);
-int service_app_info_clone(service_app_info_h *clone, service_app_info_h service_app_info);
-int service_app_info_get_package(service_app_info_h service_app_info, char **package);
-int service_app_info_get_type(service_app_info_h service_app_info, char **type);
-int service_app_info_is_onboot(service_app_info_h service_app_info, bool *onboot);
-int service_app_info_is_autorestart(service_app_info_h service_app_info, bool *autorestart);
-#define __END_OF_DEPRECATED_API
+/**
+ * @brief Adds filter condition for the query API.
+ * @details The query will search the entire application metadata information collected from
+ * the manifest file of all the installed packages. You can specify value as @c NULL to search based on key only.
+ * @since_tizen 2.3
+ * @param[in] handle The pointer to the application metadata info filter handle
+ * @param[in] key The pointer to metadata key
+ * @param[in] value The pointer to metadata value
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int app_info_metadata_filter_add(app_info_metadata_filter_h handle, const char *key, const char *value);
+/**
+ * @brief Executes the filter query.
+ * @details The query will search the entire application metadata information collected from
+ * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
+ * negative value, no more callbacks will be called and API will return.
+ * @since_tizen 2.3
+ * @param[in] handle The pointer to the application metadata info filter handle
+ * @param[in] callback The function pointer to callback
+ * @param[in] user_data The pointer to user data
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ */
+int app_info_metadata_filter_foreach(app_info_metadata_filter_h handle, app_info_filter_cb callback, void *user_data);
+
+
+/**
+* @}
+*/
#ifdef __cplusplus
}
diff --git a/include/app_info_internal.h b/include/app_info_internal.h
new file mode 100644
index 0000000..6381431
--- /dev/null
+++ b/include/app_info_internal.h
@@ -0,0 +1,66 @@
+/*
+ * 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_INFO_INTERNAL_H
+#define __TIZEN_APPFW_APP_INFO_INTERNAL_H
+
+#include "app_info.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+* @addtogroup CAPI_APP_INFO_MODULE
+* @{
+*/
+
+#define __START_OF_DEPRECATED_API
+int app_info_get_name(app_info_h app_info, char **name);
+
+typedef struct ui_app_info_s *ui_app_info_h;
+typedef struct service_app_info_s *service_app_info_h;
+int ui_app_info_destroy(ui_app_info_h ui_app_info);
+int ui_app_info_get_app_id(ui_app_info_h ui_app_info, char **app_id);
+int ui_app_info_get_label(ui_app_info_h ui_app_info, char **label);
+int ui_app_info_get_icon(ui_app_info_h ui_app_info, char **iconpath);
+int ui_app_info_is_equal(ui_app_info_h lhs, ui_app_info_h rhs, bool *equal);
+int ui_app_info_clone(ui_app_info_h *clone, ui_app_info_h ui_app_info);
+int ui_app_info_get_package(ui_app_info_h ui_app_info, char **package);
+int ui_app_info_get_type(ui_app_info_h ui_app_info, char **type);
+//int ui_app_info_get_category(ui_app_info_h ui_app_info, char **category);
+int service_app_info_destroy(service_app_info_h service_app_info);
+int service_app_info_get_app_id(service_app_info_h service_app_info, char **app_id);
+int service_app_info_get_label(service_app_info_h service_app_info, char **label);
+int service_app_info_get_icon(service_app_info_h service_app_info, char **iconpath);
+int service_app_info_is_equal(service_app_info_h lhs, service_app_info_h rhs, bool *equal);
+int service_app_info_clone(service_app_info_h *clone, service_app_info_h service_app_info);
+int service_app_info_get_package(service_app_info_h service_app_info, char **package);
+int service_app_info_get_type(service_app_info_h service_app_info, char **type);
+int service_app_info_is_onboot(service_app_info_h service_app_info, bool *onboot);
+int service_app_info_is_autorestart(service_app_info_h service_app_info, bool *autorestart);
+#define __END_OF_DEPRECATED_API
+
+/**
+* @}
+*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TIZEN_APPFW_APP_INFO_INTERNAL_H */
diff --git a/include/app_manager.h b/include/app_manager.h
index 2b98188..fb0b412 100755
--- a/include/app_manager.h
+++ b/include/app_manager.h
@@ -11,10 +11,9 @@
* 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.
*/
-
#ifndef __TIZEN_APPFW_APP_MANAGER_H
#define __TIZEN_APPFW_APP_MANAGER_H
@@ -23,258 +22,258 @@
#include <app_context.h>
#include <app_info.h>
-
#ifdef __cplusplus
extern "C" {
#endif
/**
+ * @file app_manager.h
+ */
+
+/**
* @addtogroup CAPI_APPLICATION_MANAGER_MODULE
* @{
*/
-
/**
- * @brief Enumerations of error code for Application Manager.
+ * @brief Enumerations for Application Manager Error .
+ * @since_tizen 2.3
*/
typedef enum
{
- APP_MANAGER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
- APP_MANAGER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
- APP_MANAGER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
- APP_MANAGER_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< Internal I/O error */
- APP_MANAGER_ERROR_NO_SUCH_APP = TIZEN_ERROR_APPLICATION_MANAGER | 0x01, /**< No such application */
-
- APP_MANAGER_ERROR_DB_FAILED = TIZEN_ERROR_APPLICATION_MANAGER | 0x03, /**< Database error */
- APP_MANAGER_ERROR_INVALID_PACKAGE = TIZEN_ERROR_APPLICATION_MANAGER | 0x04, /**< Invalid package name */
- APP_MANAGER_ERROR_APP_NO_RUNNING = TIZEN_ERROR_APPLICATION_MANAGER | 0x05, /**< App is not running */
- APP_MANAGER_ERROR_REQUEST_FAILED = TIZEN_ERROR_APPLICATION_MANAGER | 0x06, /**< Internal aul request error */
- APP_MANAGER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED /**< Permission denied */
+ APP_MANAGER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ APP_MANAGER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ APP_MANAGER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ APP_MANAGER_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< Internal I/O error */
+ APP_MANAGER_ERROR_NO_SUCH_APP = TIZEN_ERROR_APPLICATION_MANAGER | 0x01, /**< No such application */
+
+ APP_MANAGER_ERROR_DB_FAILED = TIZEN_ERROR_APPLICATION_MANAGER | 0x03, /**< Database error */
+ APP_MANAGER_ERROR_INVALID_PACKAGE = TIZEN_ERROR_APPLICATION_MANAGER | 0x04, /**< Invalid package name */
+ APP_MANAGER_ERROR_APP_NO_RUNNING = TIZEN_ERROR_APPLICATION_MANAGER | 0x05, /**< App is not running */
+ APP_MANAGER_ERROR_REQUEST_FAILED = TIZEN_ERROR_APPLICATION_MANAGER | 0x06, /**< Internal aul request error */
+ APP_MANAGER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED /**< Permission denied */
} app_manager_error_e;
-
/**
- * @brief Called when an application gets launched or termiated.
- * @param[in] app_context The application context of the application launched or termiated
- * @param[in] event The application context event
- * @param[in] user_data The user data passed from the foreach function
- * @pre This function is called when an application gets launched or terminated after you register this callback using app_manager_set_app_context_event_cb()
+ * @internal
+ * @brief Called when an application is launched or terminated.
+ * @since_tizen 2.3
+ * @param[in] app_context The application context of the application launched or terminated
+ * @param[in] event The application context event
+ * @param[in] user_data The user data passed from the foreach function
+ * @pre This function is called when an application gets launched or terminated, after you register this callback using app_manager_set_app_context_event_cb().
* @see app_manager_set_app_context_event_cb()
* @see app_manager_unset_app_context_event_cb()
*/
typedef void (*app_manager_app_context_event_cb) (app_context_h app_context, app_context_event_e event, void *user_data);
-
/**
- * @brief Called to get the application context once for each running application.
- * @param[in] app_context The application context of each running application
- * @param[in] user_data The user data passed from the foreach function
- * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop.
+ * @brief Called to get the application context once for each running application.
+ * @since_tizen 2.3
+ * @param[in] app_context The application context of each running application
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n
+ * otherwise @c false to break out of the loop
* @pre app_manager_foreach_app_context() will invoke this callback.
* @see app_manager_foreach_app_context()
*/
typedef bool (*app_manager_app_context_cb) (app_context_h app_context, void *user_data);
-
/**
- * @internal
- * @brief Called when an application gets installed, terminated or updated.
- * @param[in] app_info The application information of the application installed, terminated or updated
- * @param[in] event The application information event
- * @param[in] user_data The user data passed from the foreach function
- * @pre This function is called when an application gets installed, uninstalled or updated after you register this callback using app_manager_set_app_info_event_cb()
- * @see app_manager_set_app_info_event_cb()
- * @see app_manager_unset_app_info_event_cb()
- */
-typedef void (*app_manager_app_info_event_cb) (app_info_h app_info, app_info_event_e event, void *user_data);
-
-
-/**
- * @internal
- * @brief Called to get the application information once for each installed application.
- * @param[in] app_info The application information of each installed application
- * @param[in] user_data The user data passed from the foreach function
- * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop.
+ * @brief Called to get the application information once for each installed application.
+ * @since_tizen 2.3
+ * @param[in] app_info The application information of each installed application
+ * @param[in] user_data The user data passed from the foreach function
+ * @return @c true to continue with the next iteration of the loop, \n
+ * otherwise @c false to break out of the loop
* @pre app_manager_foreach_app_info() will invoke this callback.
* @see app_manager_foreach_app_info()
*/
typedef bool (*app_manager_app_info_cb) (app_info_h app_info, void *user_data);
-
/**
- * @brief Registers a callback function to be invoked when the applications gets launched or termiated.
- * @param[in] callback The callback function to register
- * @param[in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE On Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
- * @post It will invoke app_manager_app_context_event_cb() when the application is launched or termiated.
+ * @internal
+ * @brief Registers a callback function to be invoked when the applications get launched or terminated.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @param[in] callback The callback function to register
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @post It will invoke app_manager_app_context_event_cb() when the application is launched or terminated.
* @see app_manager_unset_app_context_event_cb()
* @see app_manager_app_context_event_cb()
*/
int app_manager_set_app_context_event_cb(app_manager_app_context_event_cb callback, void *user_data);
-
/**
- * @brief Unregisters the callback function.
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @internal
+ * @brief Unregisters the callback function.
+ * @since_tizen 2.3
* @see app_manager_set_app_event_cb()
* @see app_manager_app_context_event_cb()
*/
void app_manager_unset_app_context_event_cb(void);
-
/**
- * @brief Retrieves all application contexts of running applications
- * @param [in] callback The callback function to invoke
- * @param [in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @post This function invokes app_manager_app_context_cb() repeatedly for each application context.
+ * @brief Retrieves all application contexts of running applications.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @post This function invokes app_manager_app_context_cb() for each application context.
* @see app_manager_app_context_cb()
*/
int app_manager_foreach_app_context(app_manager_app_context_cb callback, void *user_data);
-
/**
- * @brief Gets the application context for the given ID of the application
- * @remarks This function returns #APP_MANAGER_ERROR_NO_SUCH_APP if the application with the given application ID is not running \n
- * @a app_context must be released with app_context_destroy() by you.
- * @param [in] app_id The ID of the application
- * @param [out] app_context The application context of the given application ID
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #APP_MANAGER_ERROR_NO_SUCH_APP No such application
+ * @brief Gets the application context for the given ID of the application.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @remarks This function returns #APP_MANAGER_ERROR_NO_SUCH_APP if the application with the given application ID is not running. \n
+ * You must release @a app_context using app_context_destroy().
+ * @param[in] app_id The ID of the application
+ * @param[out] app_context The application context of the given application ID
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_MANAGER_ERROR_NO_SUCH_APP No such application
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
*/
int app_manager_get_app_context(const char *app_id, app_context_h *app_context);
-
-/**
- * @brief Gets the name of the application package for the given process ID of the application
- * @remark This function is @b deprecated. Use app_manager_get_app_id() instead.
- * @remarks This function returns #APP_MANAGER_ERROR_NO_SUCH_APP if the application with the given process ID is not valid \n
- * @a package must be released with free() by you.
- * @param [in] pid The process ID of the given application
- * @param [out] package The package name of the application
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #APP_MANAGER_ERROR_NO_SUCH_APP No such application
- */
-int app_manager_get_package(pid_t pid, char **package);
-
-
/**
- * @brief Gets the ID of the application for the given process ID
- * @remarks This function returns #APP_MANAGER_ERROR_NO_SUCH_APP if the application with the given process ID is not valid \n
- * @a app_id must be released with free() by you.
- * @param [in] pid The process ID of the application
- * @param [out] app_id The ID of the application
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #APP_MANAGER_ERROR_NO_SUCH_APP No such application
+ * @brief Gets the ID of the application for the given process ID.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @remarks This function returns #APP_MANAGER_ERROR_NO_SUCH_APP if the application with the given process ID is not valid. \n
+ * You must release @a app_id using free().
+ * @param[in] pid The process ID of the application
+ * @param[out] app_id The ID of the application
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_MANAGER_ERROR_NO_SUCH_APP No such application
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
*/
int app_manager_get_app_id(pid_t pid, char **app_id);
-
/**
- * @brief Checks whether the application with the given package name is running.
- * @param [in] app_id The ID of the application
- * @param [out] running @c true if the application is running, \n @c false if not running.
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @brief Checks whether the application with the given package name is running.
+ * @since_tizen 2.3
+ * @param[in] app_id The ID of the application
+ * @param[out] running @c true if the application is running, \n
+ * otherwise @c false if not running
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
*/
int app_manager_is_running(const char *app_id, bool *running);
-
/**
- * @brief Resume the application
- * @param [in] app_context The application context
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @brief Resumes the application.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/appmanager.launch
+ * @param[in] app_context The application context
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_APP_NO_RUNNING App is not running
+ * @retval #APP_MANAGER_ERROR_REQUEST_FAILED Internal resume error
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
*/
int app_manager_resume_app(app_context_h app_context);
-
-/**
- * @brief Terminate the application
- * @param [in] app_context The application context
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int app_manager_terminate_app(app_context_h app_context);
-
-
/**
* @internal
- * @brief Registers a callback function to be invoked when the applications gets installed, uninstalled or updated.
- * @param[in] callback The callback function to register
- * @param[in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE On Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
- * @post It will invoke app_manager_app_info_event_cb() when the application gets installed, uninstalled or updated.
- * @see app_manager_unset_app_info_event_cb()
- * @see app_manager_app_info_event_cb()
+ * @brief Opens the application.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/appmanager.launch
+ * @param[in] app_id The ID of the application
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_NO_SUCH_APP No such application
+ * @retval #APP_MANAGER_ERROR_REQUEST_FAILED Internal open error
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
*/
-int app_manager_set_app_info_event_cb(app_manager_app_info_event_cb callback, void *user_data);
-
+int app_manager_open_app(const char *app_id);
/**
* @internal
- * @brief Unregisters the callback function.
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @see app_manager_set_app_info_event_cb()
- * @see app_manager_app_info_event_cb()
+ * @brief Terminates the application.
+ * @since_tizen 2.3
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/appmanager.kill
+ * @param[in] app_context The application context
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_REQUEST_FAILED Internal terminate error
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
*/
-void app_manager_unset_app_info_event_cb(void);
-
+int app_manager_terminate_app(app_context_h app_context);
/**
- * @internal
- * @brief Retrieves all application information of installed applications
- * @param [in] callback The callback function to invoke
- * @param [in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @post This function invokes app_manager_app_info_cb() repeatedly for each application information.
+ * @brief Retrieves all installed applications information.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @param[in] callback The callback function to invoke
+ * @param[in] user_data The user data to be passed to the callback function
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
+ * @post This function invokes app_manager_app_info_cb() for each application information.
* @see app_manager_app_info_cb()
*/
int app_manager_foreach_app_info(app_manager_app_info_cb callback, void *user_data);
-
/**
- * @internal
- * @brief Gets the application information for the given application ID
- * @remarks @a app_info must be released with app_info_destroy() by you.
- * @param [in] app_id The ID of the application
- * @param [out] app_info The application information for the given application ID
- * @return 0 on success, otherwise a negative error value.
- * @retval #APP_MANAGER_ERROR_NONE Successful
- * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
- * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @brief Gets the application information for the given application ID.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/packagemanager.info
+ * @remarks You must release @a app_info using app_info_destroy().
+ * @param[in] app_id The ID of the application
+ * @param[out] app_info The application information for the given application ID
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #APP_MANAGER_ERROR_NONE Successful
+ * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #APP_MANAGER_ERROR_DB_FAILED Database error occurred
+ * @retval #APP_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #APP_MANAGER_ERROR_PERMISSION_DENIED Permission denied
*/
int app_manager_get_app_info(const char *app_id, app_info_h *app_info);
-
/**
* @brief Gets the absolute path to the shared data directory of the application specified
* with an application ID.
@@ -352,24 +351,12 @@ int app_manager_get_shared_trusted_path(const char *app_id, char **path);
*/
int app_manager_get_external_shared_data_path(const char *app_id, char **path);
-#define __START_OF_DEPRECATED_API
-typedef bool (*app_manager_ui_app_info_cb) (ui_app_info_h ui_app_info, void *user_data);
-typedef bool (*app_manager_service_app_info_cb) (service_app_info_h service_app_info, void *user_data);
-int app_manager_foreach_ui_app_info(app_manager_ui_app_info_cb callback, void *user_data);
-int app_manager_get_ui_app_info(const char *app_id, ui_app_info_h *ui_app_info);
-int app_manager_foreach_service_app_info(app_manager_service_app_info_cb callback, void *user_data);
-int app_manager_get_service_app_info(const char *app_id, service_app_info_h *service_app_info);
-#define __END_OF_DEPRECATED_API
-
-
/**
* @}
*/
-
#ifdef __cplusplus
}
#endif
#endif /* __TIZEN_APPFW_APP_MANAGER_H */
-
diff --git a/include/app_manager_private.h b/include/app_manager_internal.h
index 88a9208..e283e01 100755..100644
--- a/include/app_manager_private.h
+++ b/include/app_manager_internal.h
@@ -14,17 +14,34 @@
* limitations under the License.
*/
+#ifndef __TIZEN_APPFW_APP_MANAGER_INTERNAL_H
+#define __TIZEN_APPFW_APP_MANAGER_INTERNAL_H
-#ifndef __TIZEN_APPFW_APP_MANAGER_PRIVATE_H__
-#define __TIZEN_APPFW_APP_MANAGER_PRIVATE_H__
-
-#include <app_context.h>
-#include <app_info.h>
+#include "app_manager.h"
+#include "app_info_internal.h"
#ifdef __cplusplus
extern "C" {
#endif
+/**
+ * @file app_manager_internal.h
+ */
+
+/**
+ * @addtogroup CAPI_APPLICATION_MANAGER_MODULE
+ * @{
+ */
+
+#define __START_OF_DEPRECATED_API
+typedef void (*app_manager_app_info_event_cb) (app_info_h app_info, app_info_event_e event, void *user_data);
+int app_manager_get_ui_app_info(const char *app_id, ui_app_info_h *ui_app_info);
+int app_manager_get_service_app_info(const char *app_id, service_app_info_h *service_app_info);
+int app_manager_get_app_package(const char *app_id, app_context_h *app_context);
+int app_manager_set_app_info_event_cb(app_manager_app_info_event_cb callback, void *user_data);
+void app_manager_unset_app_info_event_cb(void);
+#define __END_OF_DEPRECATED_API
+
int app_manager_error(app_manager_error_e error, const char* function, const char *description);
int app_context_foreach_app_context(app_manager_app_context_cb callback, void *user_data);
@@ -43,16 +60,12 @@ int app_info_set_event_cb(app_manager_app_info_event_cb callback, void *user_dat
void app_info_unset_event_cb(void);
-
-#define __START_OF_DEPRECATED_API
-int ui_app_info_get_app_info(const char *app_id, ui_app_info_h *ui_app_info);
-int service_app_info_get_app_info(const char *app_id, service_app_info_h *service_app_info);
-#define __END_OF_DEPRECATED_API
-
+/**
+ * @}
+ */
#ifdef __cplusplus
}
#endif
-#endif /* __TIZEN_APPFW_APP_MANAGER_PRIVATE_H__ */
-
+#endif /* __TIZEN_APPFW_APP_MANAGER_INTERNAL_H */