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"
59 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
61 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
63 struct _IrrecoWebdbCache
67 IrrecoRetryLoop
*loop
;
68 IrrecoStringTable
*categories
;
69 IrrecoStringTable
*remote_categories
;
71 GHashTable
*conf_hash
;
72 GHashTable
*theme_id_hash
;
73 GHashTable
*remote_id_hash
;
77 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
79 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
83 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
85 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
86 IrrecoWebdbCache
*irreco_webdb_cache_new();
87 void irreco_webdb_cache_free(IrrecoWebdbCache
*self
);
88 const gchar
*irreco_webdb_cache_get_error(IrrecoWebdbCache
*self
);
89 gboolean
irreco_webdb_cache_add_user(IrrecoWebdbCache
*self
,
94 gboolean
irreco_webdb_cache_upload_configuration(IrrecoWebdbCache
*self
,
96 const gchar
*category
,
97 const gchar
*file_hash
,
98 const gchar
*file_name
,
99 const gchar
*manufacturer
,
101 const gchar
*password
,
105 gboolean
irreco_webdb_cache_get_categories(IrrecoWebdbCache
*self
,
106 IrrecoStringTable
**categories
);
108 gboolean
irreco_webdb_cache_get_all_categories(IrrecoWebdbCache
*self
,
109 IrrecoStringTable
**categories
);
111 gboolean
irreco_webdb_cache_get_manufacturers(IrrecoWebdbCache
*self
,
112 const gchar
*category
,
113 IrrecoStringTable
**manufacturers
);
115 gboolean
irreco_webdb_cache_get_all_manufacturers(IrrecoWebdbCache
*self
,
116 IrrecoStringTable
**manufacturers
);
118 gboolean
irreco_webdb_cache_get_models(IrrecoWebdbCache
*self
,
119 const gchar
*category
,
120 const gchar
*manufacturer
,
121 IrrecoStringTable
**models
);
123 gboolean
irreco_webdb_cache_get_configs(IrrecoWebdbCache
*self
,
124 const gchar
*category
,
125 const gchar
*manufacturer
,
127 IrrecoStringTable
**configs
);
129 gboolean
irreco_webdb_cache_get_configuration(IrrecoWebdbCache
*self
,
131 IrrecoWebdbConf
**config
);
133 gint
irreco_webdb_cache_get_config_id(IrrecoWebdbCache
*self
,
134 const gchar
*file_hash
,
135 const gchar
*file_name
);
137 gboolean
irreco_webdb_cache_get_file(IrrecoWebdbCache
*self
,
138 const gchar
*file_hash
,
139 const gchar
*file_name
,
140 GString
**file_data
);
142 gboolean
irreco_webdb_cache_get_user_exists(IrrecoWebdbCache
*self
,
144 gboolean
*user_exists
);
146 gint
irreco_webdb_cache_get_max_image_size(IrrecoWebdbCache
*self
);
147 gint
irreco_webdb_cache_create_theme(IrrecoWebdbCache
*self
,
149 const gchar
*comment
,
150 const gchar
*preview_button
,
153 const gchar
*password
);
154 gboolean
irreco_webdb_cache_set_theme_downloadable(IrrecoWebdbCache
*self
,
156 gboolean downloadable
,
158 const gchar
*password
);
159 gboolean
irreco_webdb_cache_login(IrrecoWebdbCache
*self
,
161 const gchar
*password
);
162 gboolean
irreco_webdb_cache_get_themes(IrrecoWebdbCache
*self
,
163 IrrecoStringTable
**theme
);
164 gboolean
irreco_webdb_cache_get_theme_by_id(IrrecoWebdbCache
*self
,
166 IrrecoWebdbTheme
**theme
);
167 gint
irreco_webdb_cache_get_theme_id_by_name_and_date(IrrecoWebdbCache
*self
,
170 gboolean
irreco_webdb_cache_get_preview_button(IrrecoWebdbCache
*self
,
172 IrrecoWebdbTheme
**theme
);
173 gint
irreco_webdb_cache_add_bg_to_theme(IrrecoWebdbCache
*self
,
175 const gchar
*image_hash
,
176 const gchar
*image_name
,
182 const gchar
*password
);
183 gboolean
irreco_webdb_cache_get_backgrounds(IrrecoWebdbCache
*self
,
185 IrrecoStringTable
**bg_list
);
186 gboolean
irreco_webdb_cache_get_bg_by_id(IrrecoWebdbCache
*self
,
188 const char *theme_bg_dir
);
189 gint
irreco_webdb_cache_add_button_to_theme(IrrecoWebdbCache
*self
,
192 const gchar
*text_format_up
,
193 const gchar
*text_format_down
,
197 const gchar
*image_up_hash
,
198 const gchar
*image_up_name
,
199 const guchar
*image_up
,
201 const gchar
*image_down_hash
,
202 const gchar
*image_down_name
,
203 const guchar
*image_down
,
208 const gchar
*password
);
209 gboolean
irreco_webdb_cache_get_buttons(IrrecoWebdbCache
*self
,
211 IrrecoStringTable
**button_list
);
212 gboolean
irreco_webdb_cache_get_button_by_id(IrrecoWebdbCache
*self
,
214 const char *theme_button_dir
);
215 gint
irreco_webdb_cache_create_new_remote(IrrecoWebdbCache
*self
,
216 const gchar
*comment
,
217 const gchar
*category
,
218 const gchar
*manufacturer
,
220 const gchar
*file_name
,
221 const gchar
*file_data
,
223 const gchar
*password
);
224 gboolean
irreco_webdb_cache_set_remote_downloadable(IrrecoWebdbCache
*self
,
226 gboolean downloadable
,
228 const gchar
*password
);
229 gboolean
irreco_webdb_cache_add_configuration_to_remote(IrrecoWebdbCache
*self
,
231 gint configuration_id
,
233 const gchar
*password
);
234 gboolean
irreco_webdb_cache_add_theme_to_remote(IrrecoWebdbCache
*self
,
238 const gchar
*password
);
239 gboolean
irreco_webdb_cache_get_remote_categories(IrrecoWebdbCache
*self
,
240 IrrecoStringTable
**categories
);
241 gboolean
irreco_webdb_cache_get_remote_manufacturers(IrrecoWebdbCache
*self
,
242 const gchar
*category
,
243 IrrecoStringTable
**manufacturers
);
244 gboolean
irreco_webdb_cache_get_remote_models(IrrecoWebdbCache
*self
,
245 const gchar
*category
,
246 const gchar
*manufacturer
,
247 IrrecoStringTable
**models
);
248 gboolean
irreco_webdb_cache_get_remote_creators(IrrecoWebdbCache
*self
,
249 const gchar
*category
,
250 const gchar
*manufacturer
,
252 IrrecoStringTable
**creators
);
253 gboolean
irreco_webdb_cache_get_remotes(IrrecoWebdbCache
*self
,
254 const gchar
*category
,
255 const gchar
*manufacturer
,
257 const gchar
*creator
,
258 GList
**remote_list
);
259 gboolean
irreco_webdb_cache_get_remote_by_id(IrrecoWebdbCache
*self
,
261 IrrecoWebdbRemote
**remote
);
262 gboolean
irreco_webdb_cache_get_configurations_of_remote(IrrecoWebdbCache
*self
,
265 gboolean
irreco_webdb_cache_get_themes_of_remote(IrrecoWebdbCache
*self
,
268 gboolean
irreco_webdb_cache_get_remote_data(IrrecoWebdbCache
*self
,
272 #endif /* __IRRECO_WEBDB_CACHE_H__ */