a5b7eba8d631f66df0830c03a8a7116ccb6b8d03
[platform/upstream/gsignond.git] / include / gsignond / gsignond-storage-manager.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 Intel Corporation.
7  *
8  * Contact: Jussi Laako <jussi.laako@linux.intel.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,
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.
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_STORAGE_MANAGER_H_
27 #define _GSIGNOND_STORAGE_MANAGER_H_
28
29 #include <glib.h>
30 #include <glib-object.h>
31
32 #include <gsignond/gsignond-config.h>
33
34 G_BEGIN_DECLS
35
36 #define GSIGNOND_TYPE_STORAGE_MANAGER \
37     (gsignond_storage_manager_get_type ())
38 #define GSIGNOND_STORAGE_MANAGER(obj) \
39     (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSIGNOND_TYPE_STORAGE_MANAGER, \
40                                  GSignondStorageManager))
41 #define GSIGNOND_IS_STORAGE_MANAGER(obj) \
42     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSIGNOND_TYPE_STORAGE_MANAGER))
43 #define GSIGNOND_STORAGE_MANAGER_CLASS(klass) \
44     (G_TYPE_CHECK_CLASS_CAST ((klass), GSIGNOND_TYPE_STORAGE_MANAGER, \
45                               GSignondStorageManagerClass))
46 #define GSIGNOND_IS_STORAGE_MANAGER_CLASS(klass) \
47     (G_TYPE_CHECK_CLASS_TYPE ((klass), GSIGNOND_TYPE_STORAGE_MANAGER))
48 #define GSIGNOND_STORAGE_MANAGER_GET_CLASS(obj) \
49     (G_TYPE_INSTANCE_GET_CLASS ((obj), GSIGNOND_TYPE_STORAGE_MANAGER, \
50                                 GSignondStorageManagerClass))
51
52 typedef struct _GSignondStorageManager GSignondStorageManager;
53 typedef struct _GSignondStorageManagerClass GSignondStorageManagerClass;
54 typedef struct _GSignondStorageManagerPrivate GSignondStorageManagerPrivate;
55
56 struct _GSignondStorageManager
57 {
58     GObject parent_instance;
59     GSignondConfig *config;
60     gchar *location;
61     GSignondStorageManagerPrivate *priv;
62 };
63
64 struct _GSignondStorageManagerClass
65 {
66     GObjectClass parent_class;
67
68     /**
69      * initialize_storage:
70      *
71      * See #gsignond_storage_manager_initialize_storage.
72      */
73     gboolean (*initialize_storage) (GSignondStorageManager *self);
74     /**
75      * delete_storage:
76      *
77      * See #gsignond_storage_manager_delete_storage.
78      */
79     gboolean (*delete_storage) (GSignondStorageManager *self);
80     /**
81      * storage_is_initialized:
82      *
83      * See #gsignond_storage_manager_storage_is_initialized.
84      */
85     gboolean (*storage_is_initialized) (GSignondStorageManager *self);
86     /**
87      * mount_filesystem:
88      *
89      * See #gsignond_storage_manager_mount_filesystem.
90      */
91     const gchar * (*mount_filesystem) (GSignondStorageManager *self);
92     /**
93      * unmount_filesystem:
94      *
95      * See #gsignond_storage_manager_unmount_filesystem.
96      */
97     gboolean (*unmount_filesystem) (GSignondStorageManager *self);
98     /**
99      * filesystem_is_mounted:
100      *
101      * See #gsignond_storage_manager_filesystem_is_mounted.
102      */
103     gboolean (*filesystem_is_mounted) (GSignondStorageManager *self);
104 };
105
106 GType gsignond_storage_manager_get_type ();
107
108 gboolean
109 gsignond_storage_manager_initialize_storage (GSignondStorageManager *self);
110
111 gboolean
112 gsignond_storage_manager_delete_storage (GSignondStorageManager *self);
113
114 gboolean
115 gsignond_storage_manager_storage_is_initialized (GSignondStorageManager *self);
116
117 const gchar *
118 gsignond_storage_manager_mount_filesystem (GSignondStorageManager *self);
119
120 gboolean
121 gsignond_storage_manager_unmount_filesystem (GSignondStorageManager *self);
122
123 gboolean
124 gsignond_storage_manager_filesystem_is_mounted (GSignondStorageManager *self);
125
126 G_END_DECLS
127
128 #endif  /* _GSIGNOND_STORAGE_MANAGER_H_ */
129