Debian Codegraph @

govirt/ovirt-collection.h

raw symbols SCIP
1 /*
2 * ovirt-collection.h: generic oVirt collection
3 *
4 * Copyright (C) 2012, 2013 Red Hat, Inc.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see
18 * <http://www.gnu.org/licenses/>.
19 *
20 * Author: Christophe Fergeau <[email protected]>
21 */
22 #ifndef __OVIRT_COLLECTION_H__
23 #define __OVIRT_COLLECTION_H__
24
25 #include <gio/gio.h>
26 #include <glib-object.h>
27 #include <govirt/ovirt-types.h>
28 #include <govirt/ovirt-resource.h>
29
30 G_BEGIN_DECLS
31
32 #define OVIRT_TYPE_COLLECTION (ovirt_collection_get_type ())
33 #define OVIRT_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_COLLECTION, OvirtCollection))
34 #define OVIRT_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_COLLECTION, OvirtCollectionClass))
35 #define OVIRT_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_COLLECTION))
36 #define OVIRT_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_COLLECTION))
37 #define OVIRT_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_COLLECTION, OvirtCollectionClass))
38
39 typedef struct _OvirtCollectionPrivate OvirtCollectionPrivate;
40 typedef struct _OvirtCollectionClass OvirtCollectionClass;
41
42 struct _OvirtCollection
43 {
44 GObject parent;
45
46 OvirtCollectionPrivate *priv;
47
48 /* Do not add fields to this struct */
49 };
50
51 struct _OvirtCollectionClass
52 {
53 GObjectClass parent_class;
54
55 gpointer padding[20];
56 };
57
58 GType ovirt_collection_get_type(void);
59 GHashTable *ovirt_collection_get_resources(OvirtCollection *collection);
60
61 OvirtResource *ovirt_collection_lookup_resource(OvirtCollection *collection,
62 const char *name);
63 gboolean ovirt_collection_fetch(OvirtCollection *collection,
64 OvirtProxy *proxy,
65 GError **error);
66 void ovirt_collection_fetch_async(OvirtCollection *collection,
67 OvirtProxy *proxy,
68 GCancellable *cancellable,
69 GAsyncReadyCallback callback,
70 gpointer user_data);
71 gboolean ovirt_collection_fetch_finish(OvirtCollection *collection,
72 GAsyncResult *result,
73 GError **err);
74
75 G_END_DECLS
76
77 #endif /* __OVIRT_COLLECTION_H__ */