added irreco_webdb_client_add_bg_to_theme() and updated
[irreco.git] / irreco / trunk / src / webdb / irreco_webdb_client.h
blobcba194ffc5addcc627dd79498ddfc4da7acc3058
1 /*
2 * irreco - Ir Remote Control
3 * Copyright (C) 2007 Arto Karppinen (arto.karppinen@iki.fi)
4 *
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.
9 *
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 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
22 /* Typedef */
23 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
25 * Make sure that typedefs are available before we include anything elese.
27 * This makes sure that whatever other structures that depend on structures
28 * defined in this file will compile OK recardles of header inclusion order.
30 #ifndef __IRRECO_WEBDB_CLIENT_TYPEDEF__
31 #define __IRRECO_WEBDB_CLIENT_TYPEDEF__
32 typedef struct _IrrecoWebdbClient IrrecoWebdbClient;
33 #endif /* __IRRECO_WEBDB_CLIENT_TYPEDEF__ */
37 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
38 /* Include */
39 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
40 #ifndef __IRRECO_WEBDB_CLIENT__
41 #define __IRRECO_WEBDB_CLIENT__
42 #include "irreco_webdb.h"
44 #include <stdlib.h>
45 #include <stdio.h>
46 #include "irreco_webdb_conf.h"
47 #include <libsoup/soup.h>
48 #include <libsoup/soup-xmlrpc-message.h>
51 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
52 /* Datatypes */
53 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
55 struct _IrrecoWebdbClient
57 GString *error_msg;
62 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
63 /* Macro */
64 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
68 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
69 /* Prototypes */
70 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
71 IrrecoWebdbClient *irreco_webdb_client_new();
72 void irreco_webdb_client_free(IrrecoWebdbClient *self);
73 void irreco_webdb_client_get_error_msg(IrrecoWebdbClient *self, GString *msg);
74 gboolean irreco_webdb_client_add_user(IrrecoWebdbClient *self,
75 const gchar *name,
76 const gchar *email,
77 const gchar *passwd);
78 gboolean irreco_webdb_client_add_uber(IrrecoWebdbClient *self,
79 const gchar *name,
80 const gchar *email,
81 const gchar *passwd);
82 gboolean irreco_webdb_client_upload_configuration(IrrecoWebdbClient *self,
83 const gchar *backend,
84 const gchar *category,
85 const gchar *file_hash,
86 const gchar *file_name,
87 const gchar *manufacturer,
88 const gchar *model,
89 const gchar *password,
90 const gchar *user,
91 const gchar *data);
93 gboolean irreco_webdb_client_sum(IrrecoWebdbClient *self,
94 gint num_a,
95 gint num_b,
96 gint *sum);
97 gboolean irreco_webdb_client_get_categories(IrrecoWebdbClient *self,
98 IrrecoStringTable **category_list);
100 gboolean irreco_webdb_client_get_all_categories(IrrecoWebdbClient *self,
101 IrrecoStringTable **category_list);
103 gboolean irreco_webdb_client_get_manufacturers(IrrecoWebdbClient *self,
104 const gchar *category,
105 IrrecoStringTable **manufacturer_list);
107 gboolean irreco_webdb_client_get_all_manufacturers(IrrecoWebdbClient *self,
108 IrrecoStringTable **manufacturer_list);
110 gboolean irreco_webdb_client_get_models(IrrecoWebdbClient *self,
111 const gchar *category,
112 const gchar *manufacturer,
113 IrrecoStringTable **model_list);
115 gboolean irreco_webdb_client_get_configs(IrrecoWebdbClient *self,
116 const gchar *category,
117 const gchar *manufacturer,
118 const gchar *model,
119 IrrecoStringTable **config_list);
121 gboolean irreco_webdb_client_get_configuration(IrrecoWebdbClient *self,
122 gint id,
123 IrrecoWebdbConf **configuration);
125 gboolean irreco_webdb_client_get_file(IrrecoWebdbClient *self,
126 const gchar *file_hash,
127 const gchar *file_name,
128 GString **file_data);
130 gboolean irreco_webdb_client_get_user_exists(IrrecoWebdbClient *self,
131 const gchar *name, gboolean *user_exists);
133 gint irreco_webdb_client_create_theme(IrrecoWebdbClient *self,
134 const gchar *name,
135 const gchar *comment,
136 const gchar *preview_button,
137 const gchar *folder,
138 const gchar *user,
139 const gchar *password);
141 gint irreco_webdb_client_add_bg_to_theme(IrrecoWebdbClient *self,
142 const gchar *name,
143 const gchar *image_hash,
144 const gchar *image_name,
145 const gchar *image,
146 const gchar *folder,
147 gint theme_id,
148 const gchar *user,
149 const gchar *password);
151 gint irreco_webdb_client_add_button_to_theme(IrrecoWebdbClient *self,
152 const gchar *name,
153 gboolean allow_text,
154 const gchar *text_format_up,
155 const gchar *text_format_down,
156 gint text_padding,
157 const gchar *image_up_hash,
158 const gchar *image_up_name,
159 const gchar *image_up,
160 const gchar *image_down_hash,
161 const gchar *image_down_name,
162 const gchar *image_down,
163 const gchar *folder,
164 gint theme_id,
165 const gchar *user,
166 const gchar *password);
168 gboolean irreco_webdb_client_login(IrrecoWebdbClient *self,
169 const gchar *user,
170 const gchar *password);
172 #endif /* __IRRECO_WEBDB_CLIENT__ */