d34944f1a77484a8978ef045443f832592504105
[profile/ivi/gsignond.git] / include / gsignond / gsignond-dictionary.h
1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /*
4  * This file is part of gsignond
5  *
6  * Copyright (C) 2012-2013 Intel Corporation.
7  *
8  * Contact: Alexander Kanavin <alex.kanavin@gmail.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23  * 02110-1301 USA
24  */
25
26 #ifndef __GSIGNOND_DICTIONARY_H__
27 #define __GSIGNOND_DICTIONARY_H__
28
29 #include <glib.h>
30 #include <glib-object.h>
31
32 G_BEGIN_DECLS
33
34 #define GSIGNOND_TYPE_DICTIONARY (G_TYPE_HASH_TABLE)
35
36 #define GSIGNOND_DICTIONARY(obj)  (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
37                                            GSIGNOND_TYPE_DICTIONARY, \
38                                            GSignondDictionary))
39 #define GSIGNOND_IS_DICTIONARY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
40                                            GSIGNOND_TYPE_DICTIONARY))
41
42 typedef GHashTable GSignondDictionary;
43
44 GSignondDictionary *
45 gsignond_dictionary_new (void);
46
47 GSignondDictionary *
48 gsignond_dictionary_ref (GSignondDictionary *dict);
49
50 void
51 gsignond_dictionary_unref (GSignondDictionary *dict);
52
53 GSignondDictionary *
54 gsignond_dictionary_copy (GSignondDictionary *other);
55
56 GSignondDictionary *
57 gsignond_dictionary_new_from_variant (GVariant *variant);
58
59 GVariant *
60 gsignond_dictionary_to_variant (GSignondDictionary *dict);
61
62 GVariant *
63 gsignond_dictionary_get (GSignondDictionary *dict, const gchar *key);
64
65 gboolean
66 gsignond_dictionary_set (GSignondDictionary *dict, 
67     const gchar *key, GVariant *value);
68
69 gboolean
70 gsignond_dictionary_get_boolean (GSignondDictionary *dict, const gchar *key,
71                                  gboolean *value);
72
73 gboolean
74 gsignond_dictionary_set_boolean (GSignondDictionary *dict, const gchar *key,
75                                  gboolean value);
76
77 gboolean
78 gsignond_dictionary_get_int32 (GSignondDictionary *dict, const gchar *key,
79                                gint *value);
80
81 gboolean
82 gsignond_dictionary_set_int32 (GSignondDictionary *dict, const gchar *key,
83                                gint value);
84
85 gboolean
86 gsignond_dictionary_get_uint32 (GSignondDictionary *dict, const gchar *key,
87                                 guint *value);
88
89 gboolean
90 gsignond_dictionary_set_uint32 (GSignondDictionary *dict, const gchar *key,
91                                 guint32 value);
92
93 gboolean
94 gsignond_dictionary_get_int64 (GSignondDictionary *dict, const gchar *key,
95                                gint64 *value);
96
97 gboolean
98 gsignond_dictionary_set_int64 (GSignondDictionary *dict, const gchar *key,
99                                gint64 value);
100
101 gboolean
102 gsignond_dictionary_get_uint64 (GSignondDictionary *dict, const gchar *key,
103                                 guint64 *value);
104
105 gboolean
106 gsignond_dictionary_set_uint64 (GSignondDictionary *dict, const gchar *key,
107                                 guint64 value);
108
109 const gchar *
110 gsignond_dictionary_get_string (GSignondDictionary *dict, const gchar *key);
111
112 gboolean
113 gsignond_dictionary_set_string (GSignondDictionary *dict, const gchar *key,
114                                 const gchar *value);
115
116 gboolean
117 gsignond_dictionary_remove (GSignondDictionary *dict, const gchar *key);
118
119 G_END_DECLS
120
121 #endif /* __GSIGNOND_DICTIONARY_H__ */