1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2  *
3  * Copyright (C) 2014 Richard Hughes <richard@hughsie.com>
4  *
5  * Licensed under the GNU General Public License Version 2
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #ifndef __CD_PROFILE_DB_H
23 #define __CD_PROFILE_DB_H
24 
25 #include <glib-object.h>
26 
27 G_BEGIN_DECLS
28 
29 #define CD_TYPE_PROFILE_DB (cd_profile_db_get_type ())
30 G_DECLARE_DERIVABLE_TYPE (CdProfileDb, cd_profile_db, CD, PROFILE_DB, GObject)
31 
32 struct _CdProfileDbClass
33 {
34 	GObjectClass	parent_class;
35 };
36 
37 GType		 cd_profile_db_get_type		(void);
38 CdProfileDb	*cd_profile_db_new		(void);
39 
40 gboolean	 cd_profile_db_load		(CdProfileDb	*pdb,
41 						 const gchar	*filename,
42 						 GError		**error)
43 						 G_GNUC_WARN_UNUSED_RESULT;
44 gboolean	 cd_profile_db_empty		(CdProfileDb	*pdb,
45 						 GError		**error)
46 						 G_GNUC_WARN_UNUSED_RESULT;
47 gboolean	 cd_profile_db_set_property	(CdProfileDb	*pdb,
48 						 const gchar	*profile_id,
49 						 const gchar	*property,
50 						 guint		 uid,
51 						 const gchar	*value,
52 						 GError		**error)
53 						 G_GNUC_WARN_UNUSED_RESULT;
54 gboolean	 cd_profile_db_get_property	(CdProfileDb	*pdb,
55 						 const gchar	*profile_id,
56 						 const gchar	*property,
57 						 guint		 uid,
58 						 gchar		**value,
59 						 GError		**error)
60 						 G_GNUC_WARN_UNUSED_RESULT;
61 gboolean	 cd_profile_db_remove		(CdProfileDb	*pdb,
62 						 const gchar	*profile_id,
63 						 const gchar	*property,
64 						 guint		 uid,
65 						 GError		**error)
66 						 G_GNUC_WARN_UNUSED_RESULT;
67 
68 G_END_DECLS
69 
70 #endif /* __CD_PROFILE_DB_H */
71