1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
5 * SPDX-License-Identifier: LGPL-2.1-or-later
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
20 * Author: Alexander Larsson <alexl@redhat.com>
23 #ifndef __G_MOUNT_OPERATION_H__
24 #define __G_MOUNT_OPERATION_H__
26 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
27 #error "Only <gio/gio.h> can be included directly."
30 #include <gio/giotypes.h>
34 #define G_TYPE_MOUNT_OPERATION (g_mount_operation_get_type ())
35 #define G_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_MOUNT_OPERATION, GMountOperation))
36 #define G_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_MOUNT_OPERATION, GMountOperationClass))
37 #define G_IS_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_MOUNT_OPERATION))
38 #define G_IS_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_MOUNT_OPERATION))
39 #define G_MOUNT_OPERATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_MOUNT_OPERATION, GMountOperationClass))
44 * Class for providing authentication methods for mounting operations,
45 * such as mounting a file locally, or authenticating with a server.
47 typedef struct _GMountOperationClass GMountOperationClass;
48 typedef struct _GMountOperationPrivate GMountOperationPrivate;
50 struct _GMountOperation
52 GObject parent_instance;
54 GMountOperationPrivate *priv;
57 struct _GMountOperationClass
59 GObjectClass parent_class;
63 void (* ask_password) (GMountOperation *op,
65 const char *default_user,
66 const char *default_domain,
67 GAskPasswordFlags flags);
70 * GMountOperationClass::ask_question:
71 * @op: a #GMountOperation
72 * @message: string containing a message to display to the user
73 * @choices: (array zero-terminated=1) (element-type utf8): an array of
74 * strings for each possible choice
76 * Virtual implementation of #GMountOperation::ask-question.
78 void (* ask_question) (GMountOperation *op,
80 const char *choices[]);
82 void (* reply) (GMountOperation *op,
83 GMountOperationResult result);
85 void (* aborted) (GMountOperation *op);
88 * GMountOperationClass::show_processes:
89 * @op: a #GMountOperation
90 * @message: string containing a message to display to the user
91 * @processes: (element-type GPid): an array of #GPid for processes blocking
93 * @choices: (array zero-terminated=1) (element-type utf8): an array of
94 * strings for each possible choice
96 * Virtual implementation of #GMountOperation::show-processes.
100 void (* show_processes) (GMountOperation *op,
101 const gchar *message,
103 const gchar *choices[]);
105 void (* show_unmount_progress) (GMountOperation *op,
106 const gchar *message,
111 /* Padding for future expansion */
112 void (*_g_reserved1) (void);
113 void (*_g_reserved2) (void);
114 void (*_g_reserved3) (void);
115 void (*_g_reserved4) (void);
116 void (*_g_reserved5) (void);
117 void (*_g_reserved6) (void);
118 void (*_g_reserved7) (void);
119 void (*_g_reserved8) (void);
120 void (*_g_reserved9) (void);
124 GType g_mount_operation_get_type (void) G_GNUC_CONST;
126 GMountOperation * g_mount_operation_new (void);
129 const char * g_mount_operation_get_username (GMountOperation *op);
131 void g_mount_operation_set_username (GMountOperation *op,
132 const char *username);
134 const char * g_mount_operation_get_password (GMountOperation *op);
136 void g_mount_operation_set_password (GMountOperation *op,
137 const char *password);
139 gboolean g_mount_operation_get_anonymous (GMountOperation *op);
141 void g_mount_operation_set_anonymous (GMountOperation *op,
144 const char * g_mount_operation_get_domain (GMountOperation *op);
146 void g_mount_operation_set_domain (GMountOperation *op,
149 GPasswordSave g_mount_operation_get_password_save (GMountOperation *op);
151 void g_mount_operation_set_password_save (GMountOperation *op,
154 int g_mount_operation_get_choice (GMountOperation *op);
156 void g_mount_operation_set_choice (GMountOperation *op,
159 void g_mount_operation_reply (GMountOperation *op,
160 GMountOperationResult result);
161 GIO_AVAILABLE_IN_2_58
162 gboolean g_mount_operation_get_is_tcrypt_hidden_volume (GMountOperation *op);
163 GIO_AVAILABLE_IN_2_58
164 void g_mount_operation_set_is_tcrypt_hidden_volume (GMountOperation *op,
165 gboolean hidden_volume);
166 GIO_AVAILABLE_IN_2_58
167 gboolean g_mount_operation_get_is_tcrypt_system_volume (GMountOperation *op);
168 GIO_AVAILABLE_IN_2_58
169 void g_mount_operation_set_is_tcrypt_system_volume (GMountOperation *op,
170 gboolean system_volume);
171 GIO_AVAILABLE_IN_2_58
172 guint g_mount_operation_get_pim (GMountOperation *op);
173 GIO_AVAILABLE_IN_2_58
174 void g_mount_operation_set_pim (GMountOperation *op,
179 #endif /* __G_MOUNT_OPERATION_H__ */