Add API for checking the enabled/disabled flag
[apps/livebox/livebox-service.git] / include / livebox-service.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
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
7  *
8  * http://www.tizenopensource.org/license
9  *
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.
15  */
16
17 #ifndef __LIVEBOX_SERVICE_H
18 #define __LIVEBOX_SERVICE_H
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 #define NR_OF_SIZE_LIST 10
25
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,
38 };
39
40 /*!
41  * \param[in] type
42  * \param[out] width
43  * \param[out] height
44  * \return 0 for success
45  */
46 extern int livebox_service_get_size(int type, int *width, int *height);
47
48 /*!
49  * \param[in] width
50  * \param[in] height
51  * \return Type of a livebox
52  */
53 extern int livebox_service_size_type(int width, int height);
54
55 /*!
56  * \param[in] pkgid Livebox's appid
57  * \return true(1) / false(0)
58  */
59 extern int livebox_service_mouse_event(const char *pkgid);
60
61 /*!
62  * \param[in] pkgid Livebox's appid
63  * \return true(1) / false(0)
64  */
65 extern int livebox_service_touch_effect(const char *pkgid);
66
67 /*!
68  */
69 extern int livebox_service_trigger_update(const char *pkgname, const char *cluster, const char *category);
70
71 /*!
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)
79  */
80 extern int livebox_service_get_pkglist(int (*cb)(const char *appid, const char *lbid, int is_prime, void *data), void *data);
81
82 /*!
83  * \brief Get the name(appid or pkgname) of a primary livebox.
84  * \param[in] appid
85  * \return pkgname String which is allocated on the heap
86  */
87 extern char *livebox_service_pkgname(const char *appid);
88
89
90 /*!
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)
94  */
95 extern char *livebox_service_provider_name(const char *lbid);
96
97 /*!
98  * \brief Get the setup app ID
99  * \param[in] Livebox AppId
100  * \return Setup AppId if exists or NULL
101  */
102 extern char *livebox_service_setup_appid(const char *lbid);
103
104 /*!
105  *\brief Get the application pkgname(appid) of given livebox package name, <manifest package="AAA">
106  * \param[in] pkgname
107  * \return appid String which is allocated on the heap
108  */
109 extern char *livebox_service_appid(const char *pkgname);
110
111 /*!
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.
117  */
118 extern char *livebox_service_i18n_name(const char *pkgid, const char *lang);
119
120 /*!
121  * \brief
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
125  */
126 extern char *livebox_service_preview(const char *pkgid, int size_type);
127
128 /*!
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
132  */
133 extern char *livebox_service_content(const char *pkgid);
134
135 /*!
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.
141  */
142 extern char *livebox_service_i18n_icon(const char *pkgid, const char *lang);
143
144 /*!
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
148  */
149 extern char *livebox_service_libexec(const char *appid);
150
151 /*!
152  * \brief Get the "nodisplay" value
153  * \param[in] pkgid Livebox package id.
154  * \return true/false
155  */
156 extern int livebox_service_nodisplay(const char *pkgid);
157
158 /*!
159  * \brief Check the status of the livebox
160  * \param[in] lbid Livebox Id
161  * \return int 1 enabled, 0 disabled
162  */
163 extern int livebox_service_is_enabled(const char *lbid);
164
165 /*!
166  * \brief
167  * \param[in]
168  * \return
169  */
170 extern char *livebox_service_lb_script_path(const char *pkgid);
171
172 /*!
173  * \brief
174  * \param[in]
175  * \return
176  */
177 extern char *livebox_service_lb_script_group(const char *pkgid);
178
179 /*!
180  * \brief
181  * \param[in]
182  * \return
183  */
184 extern char *livebox_service_pd_script_path(const char *pkgid);
185
186 /*!
187  * \brief
188  * \param[in]
189  * \return
190  */
191 extern char *livebox_service_pd_script_group(const char *pkgid);
192
193 /*!
194  * \brief
195  * \return
196  */
197 extern int livebox_service_get_supported_sizes(const char *pkgid, int *cnt, int *w, int *h);
198
199 /*!
200  * \brief
201  * \return
202  */
203 extern int livebox_service_get_supported_size_types(const char *pkgid, int *cnt, int *types);
204
205 /*!
206  */
207 extern int livebox_service_enumerate_category_list(const char *cluster, int (*cb)(const char *cluster, const char *category, void *data), void *data);
208
209 /*!
210  */
211 extern int livebox_service_enumerate_cluster_list(int (*cb)(const char *cluster, void *data), void *data);
212
213 /*!
214  * \brief
215  * \return
216  */
217 extern int livebox_service_init(void);
218
219 /*!
220  * \brief
221  * \return
222  */
223 extern int livebox_service_fini(void);
224
225 #ifdef __cplusplus
226 }
227 #endif
228
229 #endif
230 /* End of a file */