1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
4 * This file is part of gsignond
6 * Copyright (C) 2012 Intel Corporation.
8 * Contact: Jussi Laako <jussi.laako@linux.intel.com>
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.
15 * This library is distributed in the hope that it will be useful,
16 * but 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.
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
26 #ifndef _GSIGNOND_EXTENSION_INTERFACE_H_
27 #define _GSIGNOND_EXTENSION_INTERFACE_H_
29 #include <glib-object.h>
31 #include <gsignond/gsignond-config.h>
32 #include <gsignond/gsignond-storage-manager.h>
33 #include <gsignond/gsignond-secret-storage.h>
34 #include <gsignond/gsignond-access-control-manager.h>
38 #define GSIGNOND_TYPE_EXTENSION \
39 (gsignond_extension_get_type ())
40 #define GSIGNOND_EXTENSION(obj) \
41 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSIGNOND_TYPE_EXTENSION, \
43 #define GSIGNOND_IS_EXTENSION(obj) \
44 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSIGNOND_TYPE_EXTENSION))
45 #define GSIGNOND_EXTENSION_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_CAST ((klass), GSIGNOND_TYPE_EXTENSION, \
47 GSignondExtensionClass))
48 #define GSIGNOND_IS_EXTENSION_CLASS(klass) \
49 (G_TYPE_CHECK_CLASS_TYPE ((klass), GSIGNOND_TYPE_EXTENSION))
50 #define GSIGNOND_EXTENSION_GET_CLASS(obj) \
51 (G_TYPE_INSTANCE_GET_CLASS ((obj), GSIGNOND_TYPE_EXTENSION, \
52 GSignondExtensionClass))
54 typedef struct _GSignondExtension GSignondExtension;
55 typedef struct _GSignondExtensionClass GSignondExtensionClass;
56 typedef struct _GSignondExtensionPrivate GSignondExtensionPrivate;
57 typedef GSignondExtension * (*GSignondExtensionInit) (void);
59 struct _GSignondExtension
61 GObject parent_instance;
62 GSignondExtensionPrivate *priv;
65 struct _GSignondExtensionClass
67 GObjectClass parent_class;
71 * @self: object instance.
73 * Get human readable name of the extension.
75 * Returns: (transfer none) name of the extension.
77 const gchar * (*get_extension_name) (GSignondExtension *self);
79 * get_extension_version:
80 * @self: object instance.
82 * Get version of the extension, split into four bytes in order from MSB
83 * to LSB; major, minor, patchlevel, build.
85 guint32 (*get_extension_version) (GSignondExtension *self);
87 * get_storage_manager:
88 * @self: object instance.
89 * @config: configuration object instance.
91 * Factory method to get a singleton storage manager object.
93 * Returns: storage manager object instance.
95 GSignondStorageManager * (*get_storage_manager) (GSignondExtension *self,
96 GSignondConfig *config);
99 * @self: object instance.
100 * @config: configuration object instance.
102 * Factory method to get a singleton secret storage object.
104 * Returns: secret storage object instance.
106 GSignondSecretStorage * (*get_secret_storage) (GSignondExtension *self,
107 GSignondConfig *config);
109 * get_access_control_manager:
110 * @self: object instance.
111 * @config: configuration object instance.
113 * Factory method to get a singleton access control manager object.
115 * Returns: access control manager object instance.
117 GSignondAccessControlManager * (*get_access_control_manager) (
118 GSignondExtension *self,
119 GSignondConfig *config);
122 GType gsignond_extension_get_type ();
125 gsignond_extension_get_name (GSignondExtension *self);
128 gsignond_extension_get_version (GSignondExtension *self);
130 GSignondStorageManager *
131 gsignond_extension_get_storage_manager (GSignondExtension *self,
132 GSignondConfig *config);
134 GSignondSecretStorage *
135 gsignond_extension_get_secret_storage (GSignondExtension *self,
136 GSignondConfig *config);
138 GSignondAccessControlManager *
139 gsignond_extension_get_access_control_manager (GSignondExtension *self,
140 GSignondConfig *config);
143 default_extension_init ();
147 #endif /* _GSIGNOND_EXTENSION_INTERFACE_H_ */