2 * irreco - Ir Remote Control
3 * Copyright (C) 2007,2008 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.
21 * @addtogroup IrrecoWebdbCache
27 * Header file of @ref IrrecoWebdbCache.
31 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
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_CACHE_H_TYPEDEF__
41 #define __IRRECO_WEBDB_CACHE_H_TYPEDEF__
42 typedef struct _IrrecoWebdbCache IrrecoWebdbCache
;
43 #endif /* __IRRECO_WEBDB_CACHE_H_TYPEDEF__ */
48 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
50 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
51 #ifndef __IRRECO_WEBDB_CACHE_H__
52 #define __IRRECO_WEBDB_CACHE_H__
53 #include "irreco_webdb.h"
54 #include <irreco_retry_loop.h>
55 #include "irreco_webdb_conf.h"
56 #include "irreco_webdb_theme.h"
57 #include "irreco_webdb_remote.h"
58 #include "irreco_webdb_client.h"
60 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
62 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
64 struct _IrrecoWebdbCache
68 IrrecoRetryLoop
*loop
;
69 IrrecoStringTable
*categories
;
70 IrrecoStringTable
*remote_categories
;
72 GHashTable
*conf_hash
;
73 GHashTable
*theme_id_hash
;
74 GHashTable
*remote_id_hash
;
78 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
80 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
84 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
86 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
87 IrrecoWebdbCache
*irreco_webdb_cache_new();
88 void irreco_webdb_cache_free(IrrecoWebdbCache
*self
);
89 const gchar
*irreco_webdb_cache_get_error(IrrecoWebdbCache
*self
);
90 gboolean
irreco_webdb_cache_add_user(IrrecoWebdbCache
*self
,
95 gboolean
irreco_webdb_cache_upload_configuration(IrrecoWebdbCache
*self
,
97 const gchar
*category
,
98 const gchar
*file_hash
,
99 const gchar
*file_name
,
100 const gchar
*manufacturer
,
102 const gchar
*password
,
106 gboolean
irreco_webdb_cache_get_categories(IrrecoWebdbCache
*self
,
107 IrrecoStringTable
**categories
);
109 gboolean
irreco_webdb_cache_get_all_categories(IrrecoWebdbCache
*self
,
110 IrrecoStringTable
**categories
);
112 gboolean
irreco_webdb_cache_get_manufacturers(IrrecoWebdbCache
*self
,
113 const gchar
*category
,
114 IrrecoStringTable
**manufacturers
);
116 gboolean
irreco_webdb_cache_get_all_manufacturers(IrrecoWebdbCache
*self
,
117 IrrecoStringTable
**manufacturers
);
119 gboolean
irreco_webdb_cache_get_models(IrrecoWebdbCache
*self
,
120 const gchar
*category
,
121 const gchar
*manufacturer
,
122 IrrecoStringTable
**models
);
124 gboolean
irreco_webdb_cache_get_configs(IrrecoWebdbCache
*self
,
125 const gchar
*category
,
126 const gchar
*manufacturer
,
128 IrrecoStringTable
**configs
);
130 gboolean
irreco_webdb_cache_get_configuration(IrrecoWebdbCache
*self
,
132 IrrecoWebdbConf
**config
);
134 gint
irreco_webdb_cache_get_config_id(IrrecoWebdbCache
*self
,
135 const gchar
*file_hash
,
136 const gchar
*file_name
);
138 gboolean
irreco_webdb_cache_get_file(IrrecoWebdbCache
*self
,
139 const gchar
*file_hash
,
140 const gchar
*file_name
,
141 GString
**file_data
);
143 gboolean
irreco_webdb_cache_get_user_exists(IrrecoWebdbCache
*self
,
145 gboolean
*user_exists
);
147 gint
irreco_webdb_cache_get_max_image_size(IrrecoWebdbCache
*self
);
148 gint
irreco_webdb_cache_create_theme(IrrecoWebdbCache
*self
,
150 const gchar
*comment
,
151 const gchar
*preview_button
,
154 const gchar
*password
);
155 gboolean
irreco_webdb_cache_set_theme_downloadable(IrrecoWebdbCache
*self
,
157 gboolean downloadable
,
159 const gchar
*password
);
160 gboolean
irreco_webdb_cache_login(IrrecoWebdbCache
*self
,
162 const gchar
*password
);
163 gboolean
irreco_webdb_cache_get_themes(IrrecoWebdbCache
*self
,
164 IrrecoStringTable
**theme
);
165 gboolean
irreco_webdb_cache_get_theme_by_id(IrrecoWebdbCache
*self
,
167 IrrecoWebdbTheme
**theme
);
168 gint
irreco_webdb_cache_get_theme_id_by_name_and_date(IrrecoWebdbCache
*self
,
171 gboolean
irreco_webdb_cache_get_preview_button(IrrecoWebdbCache
*self
,
173 IrrecoWebdbTheme
**theme
);
174 gint
irreco_webdb_cache_add_bg_to_theme(IrrecoWebdbCache
*self
,
176 const gchar
*image_hash
,
177 const gchar
*image_name
,
183 const gchar
*password
);
184 gboolean
irreco_webdb_cache_get_backgrounds(IrrecoWebdbCache
*self
,
186 IrrecoStringTable
**bg_list
);
187 gboolean
irreco_webdb_cache_get_bg_by_id(IrrecoWebdbCache
*self
,
189 const char *theme_bg_dir
);
190 gint
irreco_webdb_cache_add_button_to_theme(IrrecoWebdbCache
*self
,
193 const gchar
*text_format_up
,
194 const gchar
*text_format_down
,
198 const gchar
*image_up_hash
,
199 const gchar
*image_up_name
,
200 const guchar
*image_up
,
202 const gchar
*image_down_hash
,
203 const gchar
*image_down_name
,
204 const guchar
*image_down
,
209 const gchar
*password
);
210 gboolean
irreco_webdb_cache_get_buttons(IrrecoWebdbCache
*self
,
212 IrrecoStringTable
**button_list
);
213 gboolean
irreco_webdb_cache_get_button_by_id(IrrecoWebdbCache
*self
,
215 const char *theme_button_dir
);
216 gint
irreco_webdb_cache_create_new_remote(IrrecoWebdbCache
*self
,
217 const gchar
*comment
,
218 const gchar
*category
,
219 const gchar
*manufacturer
,
221 const gchar
*file_name
,
222 const gchar
*file_data
,
224 const gchar
*password
);
225 gboolean
irreco_webdb_cache_set_remote_downloadable(IrrecoWebdbCache
*self
,
227 gboolean downloadable
,
229 const gchar
*password
);
230 gboolean
irreco_webdb_cache_add_configuration_to_remote(IrrecoWebdbCache
*self
,
232 gint configuration_id
,
234 const gchar
*password
);
235 gboolean
irreco_webdb_cache_add_theme_to_remote(IrrecoWebdbCache
*self
,
239 const gchar
*password
);
240 gboolean
irreco_webdb_cache_get_remote_categories(IrrecoWebdbCache
*self
,
241 IrrecoStringTable
**categories
);
242 gboolean
irreco_webdb_cache_get_remote_manufacturers(IrrecoWebdbCache
*self
,
243 const gchar
*category
,
244 IrrecoStringTable
**manufacturers
);
245 gboolean
irreco_webdb_cache_get_remote_models(IrrecoWebdbCache
*self
,
246 const gchar
*category
,
247 const gchar
*manufacturer
,
248 IrrecoStringTable
**models
);
249 gboolean
irreco_webdb_cache_get_remote_creators(IrrecoWebdbCache
*self
,
250 const gchar
*category
,
251 const gchar
*manufacturer
,
253 IrrecoStringTable
**creators
);
254 gboolean
irreco_webdb_cache_get_remotes(IrrecoWebdbCache
*self
,
255 const gchar
*category
,
256 const gchar
*manufacturer
,
258 const gchar
*creator
,
259 GList
**remote_list
);
260 gboolean
irreco_webdb_cache_get_remote_by_id(IrrecoWebdbCache
*self
,
262 IrrecoWebdbRemote
**remote
);
263 gboolean
irreco_webdb_cache_get_configurations_of_remote(IrrecoWebdbCache
*self
,
266 gboolean
irreco_webdb_cache_get_themes_of_remote(IrrecoWebdbCache
*self
,
269 gboolean
irreco_webdb_cache_get_remote_data(IrrecoWebdbCache
*self
,
272 gboolean
irreco_webdb_cache_get_lirc_dirs(IrrecoWebdbCache
*self
,
273 IrrecoStringTable
**dir_list
);
274 gboolean
irreco_webdb_cache_get_lirc_manufacturers(IrrecoWebdbCache
*self
,
276 IrrecoStringTable
**manufacturer_list
);
277 gboolean
irreco_webdb_cache_get_lirc_models(IrrecoWebdbCache
*self
,
278 const gchar
*manufacturer
,
279 IrrecoStringTable
**model_list
);
280 gboolean
irreco_webdb_cache_get_lirc_file(IrrecoWebdbCache
*self
,
282 IrrecoStringTable
**file
);
284 #endif /* __IRRECO_WEBDB_CACHE_H__ */