Mostly minor fixes up until version 0.8.10.
[irreco.git] / irreco / src / webdb / irreco_webdb_client.h
blob69714a54c2c00f3bd3f192756939eb650d1bbde1
1 /*
2 * irreco - Ir Remote Control
3 * Copyright (C) 2007 Arto Karppinen (arto.karppinen@iki.fi)
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 /**
21 * @addtogroup IrrecoWebdbClient
22 * @{
25 /**
26 * @file
27 * Header file of @ref IrrecoWebdbClient.
31 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
32 /* Typedef */
33 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
35 * Make sure that typedefs are available before we include anything elese.
37 * This makes sure that whatever other structures that depend on structures
38 * defined in this file will compile OK recardles of header inclusion order.
40 #ifndef __IRRECO_WEBDB_CLIENT_TYPEDEF__
41 #define __IRRECO_WEBDB_CLIENT_TYPEDEF__
42 typedef struct _IrrecoWebdbClient IrrecoWebdbClient;
43 #endif /* __IRRECO_WEBDB_CLIENT_TYPEDEF__ */
47 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
48 /* Include */
49 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
50 #ifndef __IRRECO_WEBDB_CLIENT__
51 #define __IRRECO_WEBDB_CLIENT__
52 #include "irreco_webdb.h"
54 #include <stdlib.h>
55 #include <stdio.h>
56 #include "irreco_webdb_conf.h"
57 #include "irreco_webdb_theme.h"
58 #include "irreco_webdb_remote.h"
59 #include <libsoup/soup.h>
60 /*#include <libsoup/soup-xmlrpc.h>*/
62 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
63 /* Datatypes */
64 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
66 struct _IrrecoWebdbClient
68 GString *error_msg;
73 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
74 /* Macro */
75 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
79 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
80 /* Prototypes */
81 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
82 IrrecoWebdbClient *irreco_webdb_client_new();
83 void irreco_webdb_client_free(IrrecoWebdbClient *self);
84 void irreco_webdb_client_get_error_msg(IrrecoWebdbClient *self, GString *msg);
85 gboolean irreco_webdb_client_add_user(IrrecoWebdbClient *self,
86 const gchar *name,
87 const gchar *email,
88 const gchar *passwd);
89 gboolean irreco_webdb_client_add_uber(IrrecoWebdbClient *self,
90 const gchar *name,
91 const gchar *email,
92 const gchar *passwd);
93 gboolean irreco_webdb_client_upload_configuration(IrrecoWebdbClient *self,
94 const gchar *backend,
95 const gchar *category,
96 const gchar *file_hash,
97 const gchar *file_name,
98 const gchar *manufacturer,
99 const gchar *model,
100 const gchar *password,
101 const gchar *user,
102 const gchar *data);
104 gboolean irreco_webdb_client_sum(IrrecoWebdbClient *self,
105 gint num_a,
106 gint num_b,
107 glong *sum);
108 gboolean irreco_webdb_client_get_categories(IrrecoWebdbClient *self,
109 IrrecoStringTable **category_list);
111 gboolean irreco_webdb_client_get_all_categories(IrrecoWebdbClient *self,
112 IrrecoStringTable **category_list);
114 gboolean irreco_webdb_client_get_manufacturers(IrrecoWebdbClient *self,
115 const gchar *category,
116 IrrecoStringTable **manufacturer_list);
118 gboolean irreco_webdb_client_get_all_manufacturers(IrrecoWebdbClient *self,
119 IrrecoStringTable **manufacturer_list);
121 gboolean irreco_webdb_client_get_models(IrrecoWebdbClient *self,
122 const gchar *category,
123 const gchar *manufacturer,
124 IrrecoStringTable **model_list);
126 gboolean irreco_webdb_client_get_configs(IrrecoWebdbClient *self,
127 const gchar *manufacturer,
128 const gchar *model,
129 IrrecoStringTable **config_list);
131 gboolean irreco_webdb_client_get_configuration(IrrecoWebdbClient *self,
132 gint id,
133 IrrecoWebdbConf **configuration);
135 gint irreco_webdb_client_get_config_id_by_file_hash_and_file_name(
136 IrrecoWebdbClient *self,
137 const gchar *file_hash,
138 const gchar *file_name);
140 gboolean irreco_webdb_client_get_file(IrrecoWebdbClient *self,
141 const gchar *file_hash,
142 const gchar *file_name,
143 GString **file_data);
145 gboolean irreco_webdb_client_get_user_exists(IrrecoWebdbClient *self,
146 const gchar *name, gboolean *user_exists);
148 gint irreco_webdb_client_get_max_image_size(IrrecoWebdbClient *self);
150 gint irreco_webdb_client_create_theme(IrrecoWebdbClient *self,
151 const gchar *name,
152 const gchar *comment,
153 const gchar *preview_button,
154 const gchar *folder,
155 const gchar *user,
156 const gchar *password);
158 gboolean irreco_webdb_client_set_theme_downloadable(IrrecoWebdbClient *self,
159 gint id,
160 gboolean downloadable,
161 const gchar *user,
162 const gchar *password);
164 gboolean irreco_webdb_client_get_themes(IrrecoWebdbClient *self,
165 IrrecoStringTable **theme_list);
167 gboolean irreco_webdb_client_get_theme_by_id(IrrecoWebdbClient *self,
168 gint theme_id,
169 IrrecoWebdbTheme **theme);
171 gboolean irreco_webdb_client_get_theme_versions_by_name(IrrecoWebdbClient *self,
172 const char *name,
173 IrrecoStringTable **theme_list);
175 gchar *irreco_webdb_client_get_theme_date_by_id(IrrecoWebdbClient *self,
176 gint theme_id);
178 gint irreco_webdb_client_get_theme_id_by_name_and_date(IrrecoWebdbClient *self,
179 const gchar *name,
180 const gchar *date);
182 gint irreco_webdb_client_add_bg_to_theme(IrrecoWebdbClient *self,
183 const gchar *name,
184 const gchar *image_hash,
185 const gchar *image_name,
186 const guchar *image,
187 gint image_len,
188 const gchar *folder,
189 gint theme_id,
190 const gchar *user,
191 const gchar *password);
193 gboolean irreco_webdb_client_get_backgrounds(IrrecoWebdbClient *self,
194 gint theme_id,
195 IrrecoStringTable **bg_list);
197 gboolean irreco_webdb_client_get_bg_by_id(IrrecoWebdbClient *self,
198 gint bg_id,
199 const char *theme_bg_dir);
201 gint irreco_webdb_client_add_button_to_theme(IrrecoWebdbClient *self,
202 const gchar *name,
203 gboolean allow_text,
204 const gchar *text_format_up,
205 const gchar *text_format_down,
206 gint text_padding,
207 gfloat text_h_align,
208 gfloat text_v_align,
209 const gchar *image_up_hash,
210 const gchar *image_up_name,
211 const guchar *image_up,
212 gint image_up_len,
213 const gchar *image_down_hash,
214 const gchar *image_down_name,
215 const guchar *image_down,
216 gint image_down_len,
217 const gchar *folder,
218 gint theme_id,
219 const gchar *user,
220 const gchar *password);
222 gboolean irreco_webdb_client_get_buttons(IrrecoWebdbClient *self,
223 gint theme_id,
224 IrrecoStringTable **button_list);
226 gboolean irreco_webdb_client_get_button_by_id(IrrecoWebdbClient *self,
227 gint button_id,
228 const char *theme_button_dir);
230 gboolean irreco_webdb_client_get_preview_button(IrrecoWebdbClient *self,
231 gint theme_id,
232 GdkPixbuf **preview_button);
234 gboolean irreco_webdb_client_login(IrrecoWebdbClient *self,
235 const gchar *user,
236 const gchar *password);
238 gint irreco_webdb_client_create_new_remote(IrrecoWebdbClient *self,
239 const gchar *comment,
240 const gchar *category,
241 const gchar *manufacturer,
242 const gchar *model,
243 const gchar *file_name,
244 const gchar *file_data,
245 const gchar *user,
246 const gchar *password);
248 gboolean irreco_webdb_client_set_remote_downloadable(IrrecoWebdbClient *self,
249 gint id,
250 gboolean downloadable,
251 const gchar *user,
252 const gchar *password);
254 gboolean irreco_webdb_client_add_configuration_to_remote(
255 IrrecoWebdbClient *self,
256 gint remote_id,
257 gint configuration_id,
258 const gchar *user,
259 const gchar *password);
261 gboolean irreco_webdb_client_add_theme_to_remote(IrrecoWebdbClient *self,
262 gint remote_id,
263 gint theme_id,
264 const gchar *user,
265 const gchar *password);
267 gboolean irreco_webdb_client_get_remote_categories(IrrecoWebdbClient *self,
268 IrrecoStringTable **category_list);
270 gboolean irreco_webdb_client_get_remote_manufacturers(IrrecoWebdbClient *self,
271 const gchar *category,
272 IrrecoStringTable **manufacturer_list);
274 gboolean irreco_webdb_client_get_remote_models(IrrecoWebdbClient *self,
275 const gchar *category,
276 const gchar *manufacturer,
277 IrrecoStringTable **model_list);
279 gboolean irreco_webdb_client_get_remote_creators(IrrecoWebdbClient *self,
280 const gchar *category,
281 const gchar *manufacturer,
282 const gchar *model,
283 IrrecoStringTable **creators);
285 gboolean irreco_webdb_client_get_remotes(IrrecoWebdbClient *self,
286 const gchar *category,
287 const gchar *manufacturer,
288 const gchar *model,
289 const gchar *creator,
290 GList **remote_list);
292 gboolean irreco_webdb_client_get_remote_by_id(IrrecoWebdbClient *self,
293 gint id,
294 IrrecoWebdbRemote **remote);
296 gboolean irreco_webdb_client_get_themes_of_remote(IrrecoWebdbClient *self,
297 gint remote_id,
298 GList **themes);
300 gboolean irreco_webdb_client_get_configurations_of_remote(
301 IrrecoWebdbClient *self,
302 gint remote_id,
303 GList **configs);
305 gboolean irreco_webdb_client_get_remote_data(IrrecoWebdbClient *self,
306 gint remote_id,
307 gchar **file_data);
308 gboolean irreco_webdb_client_get_lirc_dirs(IrrecoWebdbClient *self,
309 IrrecoStringTable **dir_list);
310 gboolean irreco_webdb_client_get_lirc_manufacturers(IrrecoWebdbClient *self,
311 const gchar *range,
312 IrrecoStringTable **manufacturer_list);
313 gboolean irreco_webdb_client_get_lirc_models(IrrecoWebdbClient *self,
314 const gchar *manufacturer,
315 IrrecoStringTable **model_list);
316 gboolean irreco_webdb_client_get_lirc_file(IrrecoWebdbClient *self,
317 const gchar *model,
318 IrrecoStringTable **file);
321 #endif /* __IRRECO_WEBDB_CLIENT__ */
323 /** @} */