1/* GIO - GLib Input, Output and Streaming Library
2 *
3 * Copyright (C) 2006-2007 Red Hat, Inc.
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 *
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.
11 *
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.
16 *
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/>.
19 *
20 * Author: Alexander Larsson <alexl@redhat.com>
21 */
22
23#ifndef __G_MOUNT_OPERATION_H__
24#define __G_MOUNT_OPERATION_H__
25
26#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
27#error "Only <gio/gio.h> can be included directly."
28#endif
29
30#include <gio/giotypes.h>
31
32G_BEGIN_DECLS
33
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))
40
41typedef struct _GMountOperationClass GMountOperationClass;
42typedef struct _GMountOperationPrivate GMountOperationPrivate;
43
44struct _GMountOperation
45{
46 GObject parent_instance;
47
48 GMountOperationPrivate *priv;
49};
50
51struct _GMountOperationClass
52{
53 GObjectClass parent_class;
54
55 /* signals: */
56
57 void (* ask_password) (GMountOperation *op,
58 const char *message,
59 const char *default_user,
60 const char *default_domain,
61 GAskPasswordFlags flags);
62
63 /**
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
69 *
70 * Virtual implementation of #GMountOperation::ask-question.
71 */
72 void (* ask_question) (GMountOperation *op,
73 const char *message,
74 const char *choices[]);
75
76 void (* reply) (GMountOperation *op,
77 GMountOperationResult result);
78
79 void (* aborted) (GMountOperation *op);
80
81 /**
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
86 * the operation
87 * @choices: (array zero-terminated=1) (element-type utf8): an array of
88 * strings for each possible choice
89 *
90 * Virtual implementation of #GMountOperation::show-processes.
91 *
92 * Since: 2.22
93 */
94 void (* show_processes) (GMountOperation *op,
95 const gchar *message,
96 GArray *processes,
97 const gchar *choices[]);
98
99 void (* show_unmount_progress) (GMountOperation *op,
100 const gchar *message,
101 gint64 time_left,
102 gint64 bytes_left);
103
104 /*< private >*/
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);
115};
116
117GIO_AVAILABLE_IN_ALL
118GType g_mount_operation_get_type (void) G_GNUC_CONST;
119GIO_AVAILABLE_IN_ALL
120GMountOperation * g_mount_operation_new (void);
121
122GIO_AVAILABLE_IN_ALL
123const char * g_mount_operation_get_username (GMountOperation *op);
124GIO_AVAILABLE_IN_ALL
125void g_mount_operation_set_username (GMountOperation *op,
126 const char *username);
127GIO_AVAILABLE_IN_ALL
128const char * g_mount_operation_get_password (GMountOperation *op);
129GIO_AVAILABLE_IN_ALL
130void g_mount_operation_set_password (GMountOperation *op,
131 const char *password);
132GIO_AVAILABLE_IN_ALL
133gboolean g_mount_operation_get_anonymous (GMountOperation *op);
134GIO_AVAILABLE_IN_ALL
135void g_mount_operation_set_anonymous (GMountOperation *op,
136 gboolean anonymous);
137GIO_AVAILABLE_IN_ALL
138const char * g_mount_operation_get_domain (GMountOperation *op);
139GIO_AVAILABLE_IN_ALL
140void g_mount_operation_set_domain (GMountOperation *op,
141 const char *domain);
142GIO_AVAILABLE_IN_ALL
143GPasswordSave g_mount_operation_get_password_save (GMountOperation *op);
144GIO_AVAILABLE_IN_ALL
145void g_mount_operation_set_password_save (GMountOperation *op,
146 GPasswordSave save);
147GIO_AVAILABLE_IN_ALL
148int g_mount_operation_get_choice (GMountOperation *op);
149GIO_AVAILABLE_IN_ALL
150void g_mount_operation_set_choice (GMountOperation *op,
151 int choice);
152GIO_AVAILABLE_IN_ALL
153void g_mount_operation_reply (GMountOperation *op,
154 GMountOperationResult result);
155GIO_AVAILABLE_IN_2_58
156gboolean g_mount_operation_get_is_tcrypt_hidden_volume (GMountOperation *op);
157GIO_AVAILABLE_IN_2_58
158void g_mount_operation_set_is_tcrypt_hidden_volume (GMountOperation *op,
159 gboolean hidden_volume);
160GIO_AVAILABLE_IN_2_58
161gboolean g_mount_operation_get_is_tcrypt_system_volume (GMountOperation *op);
162GIO_AVAILABLE_IN_2_58
163void g_mount_operation_set_is_tcrypt_system_volume (GMountOperation *op,
164 gboolean system_volume);
165GIO_AVAILABLE_IN_2_58
166guint g_mount_operation_get_pim (GMountOperation *op);
167GIO_AVAILABLE_IN_2_58
168void g_mount_operation_set_pim (GMountOperation *op,
169 guint pim);
170
171G_END_DECLS
172
173#endif /* __G_MOUNT_OPERATION_H__ */
174