2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
25 * @brief Enumeration of API version
29 APP_INFO_VERSION_INVALID = -1,
30 APP_INFO_VERSION_1_0 = 100,
31 APP_INFO_VERSION_1_0_2 = 102,
32 APP_INFO_VERSION_1_1 = 110,
33 APP_INFO_VERSION_1_2 = 120,
34 APP_INFO_VERSION_2_0 = 200,
35 APP_INFO_VERSION_2_1 = 210,
36 APP_INFO_VERSION_2_2 = 220,
37 APP_INFO_VERSION_3_0 = 300,
38 APP_INFO_VERSION_MAX = 65535,
43 * @brief Enumerations of error code
47 APP_INFO_ERROR_NONE = 0, /**< Successful */
48 APP_INFO_ERROR_INVALID_ARG = -1, /**< Invalid argument */
52 * @brief Initializes the appinfo structure
54 * @param[in] appid The application id to initialize
55 * @param[in] is_invalid_appid @c 1 for invalid appid compatibility mode, @c 0 otherwise
56 * @return 0 on success, otherwise a negative error value
57 * @retval APP_INFO_ERROR_NONE Succesful
58 * @retval APP_INFO_ERROR_INVALID_ARG The appid is invalid
59 * @remarks It initialize the platform API version to APP_INFO_VERSION_3_0 and compat mode 0.
61 int appinfo_init(const char* appid, int is_invalid_appid);
64 * @brief Returns the API version
66 * @return app_info_version_e value
68 int appinfo_get_api_version(void);
71 * @brief Sets the API version for the current process
73 * @param[in] ver Given API version
74 * @return 0 on success, otherwise a negative error value
75 * @retval APP_INFO_ERROR_NONE Succesful
77 //int appinfo_set_api_version(int ver);
78 int appinfo_set_api_version(app_info_version_e ver);
81 * @brief Returns the API version string by given API version
83 * @param[in] ver Given API version
84 * @return the API version string by the given version
86 const char* appinfo_get_api_str_by_version(int ver);
89 * @brief Returns the API version by given version string
91 * @param[in] ver_str Given version string
92 * @return the API version
94 app_info_version_e appinfo_get_api_version_from_str(const char* ver_str);
97 * @brief Returns whether the application is compat mode or not
99 * @return @c 1 for compat mode, @c 0 otherwise
101 int appinfo_is_compat(void);
104 * @brief Sets the application compat mode
106 * @param[in] the compatibility mode
107 * @return 0 on success, otherwise a negative error value
108 * @retval APP_INFO_ERROR_NONE Succesful
109 * @retval APP_INFO_ERROR_INVALID_ARG compat should be either @c 0 or @c 1.
111 int appinfo_set_compat(int compat);
114 * @brief Returns the appid for the application
116 * @retval application ID if valid, @c NULL otherwise
118 const char* appinfo_get_appid(void);
121 * @brief Returns the exec name for the application
123 * @retval application exec name if valid, empty string otherwise
125 const char* appinfo_get_execname(void);
128 * @brief Returns the packageid for the application
130 * @retval package ID if valid, @c NULL otherwise
132 const char* appinfo_get_packageid(void);
135 * @brief Returns whether the appinfo is initialized or not
137 * @return @c 1 if initialized, @c 0 otherwise
139 int appinfo_is_initialized(void);
141 int appinfo_set_argv(int argc, char** argv);
143 int appinfo_get_argv(int* argc, char*** argv);
145 int appinfo_update_submode_execname_and_appid(const char* execname);
147 int appinfo_update_submode_appid(const char* appid);
153 #endif //_APP_INFO_H_