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