1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library 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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 * Author: Alexander Larsson <alexl@redhat.com>
21 #ifndef __G_MOUNT_OPERATION_H__
22 #define __G_MOUNT_OPERATION_H__
24 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25 #error "Only <gio/gio.h> can be included directly."
28 #include <gio/giotypes.h>
32 #define G_TYPE_MOUNT_OPERATION (g_mount_operation_get_type ())
33 #define G_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_MOUNT_OPERATION, GMountOperation))
34 #define G_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_MOUNT_OPERATION, GMountOperationClass))
35 #define G_IS_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_MOUNT_OPERATION))
36 #define G_IS_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_MOUNT_OPERATION))
37 #define G_MOUNT_OPERATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_MOUNT_OPERATION, GMountOperationClass))
42 * Class for providing authentication methods for mounting operations,
43 * such as mounting a file locally, or authenticating with a server.
45 typedef struct _GMountOperationClass GMountOperationClass;
46 typedef struct _GMountOperationPrivate GMountOperationPrivate;
48 struct _GMountOperation
50 GObject parent_instance;
52 GMountOperationPrivate *priv;
55 struct _GMountOperationClass
57 GObjectClass parent_class;
61 void (* ask_password) (GMountOperation *op,
63 const char *default_user,
64 const char *default_domain,
65 GAskPasswordFlags flags);
68 * GMountOperationClass::ask_question:
69 * @op: a #GMountOperation
70 * @message: string containing a message to display to the user
71 * @choices: (array zero-terminated=1) (element-type utf8): an array of
72 * strings for each possible choice
74 * Virtual implementation of #GMountOperation::ask-question.
76 void (* ask_question) (GMountOperation *op,
78 const char *choices[]);
80 void (* reply) (GMountOperation *op,
81 GMountOperationResult result);
83 void (* aborted) (GMountOperation *op);
86 * GMountOperationClass::show_processes:
87 * @op: a #GMountOperation
88 * @message: string containing a message to display to the user
89 * @processes: (element-type GPid): an array of #GPid for processes blocking
91 * @choices: (array zero-terminated=1) (element-type utf8): an array of
92 * strings for each possible choice
94 * Virtual implementation of #GMountOperation::show-processes.
98 void (* show_processes) (GMountOperation *op,
101 const gchar *choices[]);
103 void (* show_unmount_progress) (GMountOperation *op,
104 const gchar *message,
109 /* Padding for future expansion */
110 void (*_g_reserved1) (void);
111 void (*_g_reserved2) (void);
112 void (*_g_reserved3) (void);
113 void (*_g_reserved4) (void);
114 void (*_g_reserved5) (void);
115 void (*_g_reserved6) (void);
116 void (*_g_reserved7) (void);
117 void (*_g_reserved8) (void);
118 void (*_g_reserved9) (void);
121 GLIB_AVAILABLE_IN_ALL
122 GType g_mount_operation_get_type (void) G_GNUC_CONST;
123 GLIB_AVAILABLE_IN_ALL
124 GMountOperation * g_mount_operation_new (void);
126 GLIB_AVAILABLE_IN_ALL
127 const char * g_mount_operation_get_username (GMountOperation *op);
128 GLIB_AVAILABLE_IN_ALL
129 void g_mount_operation_set_username (GMountOperation *op,
130 const char *username);
131 GLIB_AVAILABLE_IN_ALL
132 const char * g_mount_operation_get_password (GMountOperation *op);
133 GLIB_AVAILABLE_IN_ALL
134 void g_mount_operation_set_password (GMountOperation *op,
135 const char *password);
136 GLIB_AVAILABLE_IN_ALL
137 gboolean g_mount_operation_get_anonymous (GMountOperation *op);
138 GLIB_AVAILABLE_IN_ALL
139 void g_mount_operation_set_anonymous (GMountOperation *op,
141 GLIB_AVAILABLE_IN_ALL
142 const char * g_mount_operation_get_domain (GMountOperation *op);
143 GLIB_AVAILABLE_IN_ALL
144 void g_mount_operation_set_domain (GMountOperation *op,
146 GLIB_AVAILABLE_IN_ALL
147 GPasswordSave g_mount_operation_get_password_save (GMountOperation *op);
148 GLIB_AVAILABLE_IN_ALL
149 void g_mount_operation_set_password_save (GMountOperation *op,
151 GLIB_AVAILABLE_IN_ALL
152 int g_mount_operation_get_choice (GMountOperation *op);
153 GLIB_AVAILABLE_IN_ALL
154 void g_mount_operation_set_choice (GMountOperation *op,
156 GLIB_AVAILABLE_IN_ALL
157 void g_mount_operation_reply (GMountOperation *op,
158 GMountOperationResult result);
159 GLIB_AVAILABLE_IN_2_58
160 gboolean g_mount_operation_get_is_tcrypt_hidden_volume (GMountOperation *op);
161 GLIB_AVAILABLE_IN_2_58
162 void g_mount_operation_set_is_tcrypt_hidden_volume (GMountOperation *op,
163 gboolean hidden_volume);
164 GLIB_AVAILABLE_IN_2_58
165 gboolean g_mount_operation_get_is_tcrypt_system_volume (GMountOperation *op);
166 GLIB_AVAILABLE_IN_2_58
167 void g_mount_operation_set_is_tcrypt_system_volume (GMountOperation *op,
168 gboolean system_volume);
169 GLIB_AVAILABLE_IN_2_58
170 guint g_mount_operation_get_pim (GMountOperation *op);
171 GLIB_AVAILABLE_IN_2_58
172 void g_mount_operation_set_pim (GMountOperation *op,
177 #endif /* __G_MOUNT_OPERATION_H__ */