2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
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.
17 #ifndef __LIVEBOX_SERVICE_H
18 #define __LIVEBOX_SERVICE_H
24 #define NR_OF_SIZE_LIST 10
26 enum livebox_size_type {
27 LB_SIZE_TYPE_1x1 = 0x0001,
28 LB_SIZE_TYPE_2x1 = 0x0002,
29 LB_SIZE_TYPE_2x2 = 0x0004,
30 LB_SIZE_TYPE_4x1 = 0x0008,
31 LB_SIZE_TYPE_4x2 = 0x0010,
32 LB_SIZE_TYPE_4x3 = 0x0020,
33 LB_SIZE_TYPE_4x4 = 0x0040,
34 LB_SIZE_TYPE_EASY_1x1 = 0x0100,
35 LB_SIZE_TYPE_EASY_3x1 = 0x0200,
36 LB_SIZE_TYPE_EASY_3x3 = 0x0400,
37 LB_SIZE_TYPE_UNKNOWN = 0xFFFF,
44 * \return 0 for success
46 extern int livebox_service_get_size(int type, int *width, int *height);
51 * \return Type of a livebox
53 extern int livebox_service_size_type(int width, int height);
56 * \param[in] pkgid Livebox's appid
57 * \return true(1) / false(0)
59 extern int livebox_service_mouse_event(const char *pkgid);
62 * \param[in] pkgid Livebox's appid
63 * \return true(1) / false(0)
65 extern int livebox_service_touch_effect(const char *pkgid);
69 extern int livebox_service_trigger_update(const char *pkgname, const char *cluster, const char *category);
72 * \brief Synchronous package list getter
73 * callback (appid, lbid, is_prime)
74 * appid == Application Package ID (pkgname)
75 * lbid = Livebox Package ID
76 * is_prime = 1 if the livebox is default one for associated application package
77 * \param[in] cb Callback function
78 * \return Count of livebox packages or errno (-EIO, -EINVAL)
80 extern int livebox_service_get_pkglist(int (*cb)(const char *appid, const char *lbid, int is_prime, void *data), void *data);
83 * \brief Get the name(appid or pkgname) of a primary livebox.
85 * \return pkgname String which is allocated on the heap
87 extern char *livebox_service_pkgname(const char *appid);
91 * \brief Get the name of a livebox (provider name == livebox appid), you have to release the return value after use it
92 * \param[in] Livebox AppID
93 * \return Livebox AppId (Same with input)
95 extern char *livebox_service_provider_name(const char *lbid);
98 * \brief Get the setup app ID
99 * \param[in] Livebox AppId
100 * \return Setup AppId if exists or NULL
102 extern char *livebox_service_setup_appid(const char *lbid);
105 *\brief Get the application pkgname(appid) of given livebox package name, <manifest package="AAA">
107 * \return appid String which is allocated on the heap
109 extern char *livebox_service_appid(const char *pkgname);
112 * \brief Internationalized name of given livebox package.
113 * USER must has to do "free" after using the returned string.
114 * \param[in] pkgid App ID of a livebox. (It must has to be a livebox package ID. not the UI-APP and the PACKAGE.
115 * \param[in] lang locale(en-us, ko-kr, ...), if it is NULL, function will use the system locale automatically
116 * \return name if it fails to get name, returns NULL, or allocated heap address.
118 extern char *livebox_service_i18n_name(const char *pkgid, const char *lang);
122 * \param[in] pkgid livebox ID. NOT the UI-APP ID and PACKAGE ID
123 * \param[in] size_type
124 * \return path preview image path
126 extern char *livebox_service_preview(const char *pkgid, int size_type);
129 * \brief Get the default content string of the given livebox
130 * \param[in] pkgid Livebox ID. Not the UI-APP ID and PACKAGE ID
131 * \return content content string
133 extern char *livebox_service_content(const char *pkgid);
136 * \brief Internationalized icon path of given livebox package.
137 * USER must has to do "free" after using the returned string.
138 * \param[in] pkgid App ID of a livebox. (It must has to be a livebox package ID. not the UI-APP and the PACKAGE.
139 * \param[in] lang locale(en-us, ko-kr, ...), if it is NULL, function will use the system locale automatically
140 * \return name if it fails to get path of an icon, returns NULL, or allocated heap address.
142 extern char *livebox_service_i18n_icon(const char *pkgid, const char *lang);
145 * \brief Get the path of the plug-in module
146 * \param[in] appid Package name of a livebox
147 * \return path String which is allocated on the heap
149 extern char *livebox_service_libexec(const char *appid);
152 * \brief Get the "nodisplay" value
153 * \param[in] pkgid Livebox package id.
156 extern int livebox_service_nodisplay(const char *pkgid);
159 * \brief Check the status of the livebox
160 * \param[in] lbid Livebox Id
161 * \return int 1 enabled, 0 disabled
163 extern int livebox_service_is_enabled(const char *lbid);
170 extern char *livebox_service_lb_script_path(const char *pkgid);
177 extern char *livebox_service_lb_script_group(const char *pkgid);
184 extern char *livebox_service_pd_script_path(const char *pkgid);
191 extern char *livebox_service_pd_script_group(const char *pkgid);
197 extern int livebox_service_get_supported_sizes(const char *pkgid, int *cnt, int *w, int *h);
203 extern int livebox_service_get_supported_size_types(const char *pkgid, int *cnt, int *types);
207 extern int livebox_service_enumerate_category_list(const char *cluster, int (*cb)(const char *cluster, const char *category, void *data), void *data);
211 extern int livebox_service_enumerate_cluster_list(int (*cb)(const char *cluster, void *data), void *data);
217 extern int livebox_service_init(void);
223 extern int livebox_service_fini(void);