Update to upstream 1.0.1
[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 GVariantBuilder *
63 gsignond_dictionary_to_variant_builder (GSignondDictionary *dict);
64
65 GVariant *
66 gsignond_dictionary_get (GSignondDictionary *dict, const gchar *key);
67
68 gboolean
69 gsignond_dictionary_set (GSignondDictionary *dict, 
70     const gchar *key, GVariant *value);
71
72 gboolean
73 gsignond_dictionary_get_boolean (GSignondDictionary *dict, const gchar *key,
74                                  gboolean *value);
75
76 gboolean
77 gsignond_dictionary_set_boolean (GSignondDictionary *dict, const gchar *key,
78                                  gboolean value);
79
80 gboolean
81 gsignond_dictionary_get_int32 (GSignondDictionary *dict, const gchar *key,
82                                gint *value);
83
84 gboolean
85 gsignond_dictionary_set_int32 (GSignondDictionary *dict, const gchar *key,
86                                gint value);
87
88 gboolean
89 gsignond_dictionary_get_uint32 (GSignondDictionary *dict, const gchar *key,
90                                 guint *value);
91
92 gboolean
93 gsignond_dictionary_set_uint32 (GSignondDictionary *dict, const gchar *key,
94                                 guint32 value);
95
96 gboolean
97 gsignond_dictionary_get_int64 (GSignondDictionary *dict, const gchar *key,
98                                gint64 *value);
99
100 gboolean
101 gsignond_dictionary_set_int64 (GSignondDictionary *dict, const gchar *key,
102                                gint64 value);
103
104 gboolean
105 gsignond_dictionary_get_uint64 (GSignondDictionary *dict, const gchar *key,
106                                 guint64 *value);
107
108 gboolean
109 gsignond_dictionary_set_uint64 (GSignondDictionary *dict, const gchar *key,
110                                 guint64 value);
111
112 const gchar *
113 gsignond_dictionary_get_string (GSignondDictionary *dict, const gchar *key);
114
115 gboolean
116 gsignond_dictionary_set_string (GSignondDictionary *dict, const gchar *key,
117                                 const gchar *value);
118
119 gboolean
120 gsignond_dictionary_remove (GSignondDictionary *dict, const gchar *key);
121
122 gboolean
123 gsignond_dictionary_contains (GSignondDictionary *dict, const gchar *key);
124
125 G_END_DECLS
126
127 #endif /* __GSIGNOND_DICTIONARY_H__ */