1 /* cc-object-storage.h
2  *
3  * Copyright 2018 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 2 of the License, or
8  * (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.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 #include <glib-object.h>
22 #include <gio/gio.h>
23 
24 G_BEGIN_DECLS
25 
26 /* Default storage keys */
27 #define CC_OBJECT_NMCLIENT  "CcObjectStorage::nm-client"
28 
29 
30 #define CC_TYPE_OBJECT_STORAGE (cc_object_storage_get_type())
31 
32 G_DECLARE_FINAL_TYPE (CcObjectStorage, cc_object_storage, CC, OBJECT_STORAGE, GObject)
33 
34 gboolean cc_object_storage_has_object             (const gchar         *key);
35 
36 void     cc_object_storage_add_object             (const gchar         *key,
37                                                    gpointer             object);
38 
39 gpointer cc_object_storage_get_object             (const gchar         *key);
40 
41 gpointer cc_object_storage_create_dbus_proxy_sync (GBusType             bus_type,
42                                                    GDBusProxyFlags     flags,
43                                                    const gchar         *name,
44                                                    const gchar         *path,
45                                                    const gchar         *interface,
46                                                    GCancellable        *cancellable,
47                                                    GError             **error);
48 
49 void     cc_object_storage_create_dbus_proxy      (GBusType              bus_type,
50                                                    GDBusProxyFlags       flags,
51                                                    const gchar          *name,
52                                                    const gchar          *path,
53                                                    const gchar          *interface,
54                                                    GCancellable         *cancellable,
55                                                    GAsyncReadyCallback   callback,
56                                                    gpointer              user_data);
57 
58 gpointer cc_object_storage_create_dbus_proxy_finish (GAsyncResult       *result,
59                                                      GError            **error);
60 
61 void     cc_object_storage_initialize               (void);
62 
63 void     cc_object_storage_destroy                  (void);
64 
65 G_END_DECLS
66