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))
41 typedef struct _GMountOperationClass GMountOperationClass;
42 typedef struct _GMountOperationPrivate GMountOperationPrivate;
44 struct _GMountOperation
46 GObject parent_instance;
48 GMountOperationPrivate *priv;
51 struct _GMountOperationClass
53 GObjectClass parent_class;
57 void (* ask_password) (GMountOperation *op,
59 const char *default_user,
60 const char *default_domain,
61 GAskPasswordFlags flags);
64 * GMountOperationClass::ask_question:
65 * @op: a #GMountOperation
66 * @message: string containing a message to display to the user
67 * @choices: (array zero-terminated=1) (element-type utf8): an array of
68 * strings for each possible choice
70 * Virtual implementation of #GMountOperation::ask-question.
72 void (* ask_question) (GMountOperation *op,
74 const char *choices[]);
76 void (* reply) (GMountOperation *op,
77 GMountOperationResult result);
79 void (* aborted) (GMountOperation *op);
82 * GMountOperationClass::show_processes:
83 * @op: a #GMountOperation
84 * @message: string containing a message to display to the user
85 * @processes: (element-type GPid): an array of #GPid for processes blocking
87 * @choices: (array zero-terminated=1) (element-type utf8): an array of
88 * strings for each possible choice
90 * Virtual implementation of #GMountOperation::show-processes.
94 void (* show_processes) (GMountOperation *op,
97 const gchar *choices[]);
99 void (* show_unmount_progress) (GMountOperation *op,
100 const gchar *message,
105 /* Padding for future expansion */
106 void (*_g_reserved1) (void);
107 void (*_g_reserved2) (void);
108 void (*_g_reserved3) (void);
109 void (*_g_reserved4) (void);
110 void (*_g_reserved5) (void);
111 void (*_g_reserved6) (void);
112 void (*_g_reserved7) (void);
113 void (*_g_reserved8) (void);
114 void (*_g_reserved9) (void);
118 GType g_mount_operation_get_type (void) G_GNUC_CONST;
120 GMountOperation * g_mount_operation_new (void);
123 const char * g_mount_operation_get_username (GMountOperation *op);
125 void g_mount_operation_set_username (GMountOperation *op,
126 const char *username);
128 const char * g_mount_operation_get_password (GMountOperation *op);
130 void g_mount_operation_set_password (GMountOperation *op,
131 const char *password);
133 gboolean g_mount_operation_get_anonymous (GMountOperation *op);
135 void g_mount_operation_set_anonymous (GMountOperation *op,
138 const char * g_mount_operation_get_domain (GMountOperation *op);
140 void g_mount_operation_set_domain (GMountOperation *op,
143 GPasswordSave g_mount_operation_get_password_save (GMountOperation *op);
145 void g_mount_operation_set_password_save (GMountOperation *op,
148 int g_mount_operation_get_choice (GMountOperation *op);
150 void g_mount_operation_set_choice (GMountOperation *op,
153 void g_mount_operation_reply (GMountOperation *op,
154 GMountOperationResult result);
155 GIO_AVAILABLE_IN_2_58
156 gboolean g_mount_operation_get_is_tcrypt_hidden_volume (GMountOperation *op);
157 GIO_AVAILABLE_IN_2_58
158 void g_mount_operation_set_is_tcrypt_hidden_volume (GMountOperation *op,
159 gboolean hidden_volume);
160 GIO_AVAILABLE_IN_2_58
161 gboolean g_mount_operation_get_is_tcrypt_system_volume (GMountOperation *op);
162 GIO_AVAILABLE_IN_2_58
163 void g_mount_operation_set_is_tcrypt_system_volume (GMountOperation *op,
164 gboolean system_volume);
165 GIO_AVAILABLE_IN_2_58
166 guint g_mount_operation_get_pim (GMountOperation *op);
167 GIO_AVAILABLE_IN_2_58
168 void g_mount_operation_set_pim (GMountOperation *op,
173 #endif /* __G_MOUNT_OPERATION_H__ */