1 /*
2  * libvirt-gobject-secret.c: libvirt gobject integration
3  *
4  * Copyright (C) 2010-2011 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: Daniel P. Berrange <berrange@redhat.com>
21  */
22 
23 #if !defined(__LIBVIRT_GOBJECT_H__) && !defined(LIBVIRT_GOBJECT_BUILD)
24 #error "Only <libvirt-gobject/libvirt-gobject.h> can be included directly."
25 #endif
26 
27 #ifndef __LIBVIRT_GOBJECT_SECRET_H__
28 #define __LIBVIRT_GOBJECT_SECRET_H__
29 
30 G_BEGIN_DECLS
31 
32 #define GVIR_TYPE_SECRET            (gvir_secret_get_type ())
33 #define GVIR_SECRET(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GVIR_TYPE_SECRET, GVirSecret))
34 #define GVIR_SECRET_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GVIR_TYPE_SECRET, GVirSecretClass))
35 #define GVIR_IS_SECRET(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GVIR_TYPE_SECRET))
36 #define GVIR_IS_SECRET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVIR_TYPE_SECRET))
37 #define GVIR_SECRET_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GVIR_TYPE_SECRET, GVirSecretClass))
38 
39 #define GVIR_TYPE_SECRET_HANDLE     (gvir_secret_handle_get_type())
40 
41 typedef struct _GVirSecret GVirSecret;
42 typedef struct _GVirSecretPrivate GVirSecretPrivate;
43 typedef struct _GVirSecretClass GVirSecretClass;
44 
45 struct _GVirSecret
46 {
47     GObject parent;
48 
49     GVirSecretPrivate *priv;
50 
51     /* Do not add fields to this struct */
52 };
53 
54 struct _GVirSecretClass
55 {
56     GObjectClass parent_class;
57 
58     gpointer padding[20];
59 };
60 
61 
62 GType gvir_secret_get_type(void);
63 GType gvir_secret_handle_get_type(void);
64 
65 const gchar *gvir_secret_get_name(GVirSecret *secret);
66 const gchar *gvir_secret_get_uuid(GVirSecret *secret);
67 
68 GVirConfigSecret *gvir_secret_get_config(GVirSecret *secret,
69                                          guint flags,
70                                          GError **err);
71 
72 G_END_DECLS
73 
74 #endif /* __LIBVIRT_GOBJECT_SECRET_H__ */
75