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 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, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: Alexander Larsson <alexl@redhat.com>
23 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24 #error "Only <gio/gio.h> can be included directly."
27 #ifndef __G_MOUNT_OPERATION_H__
28 #define __G_MOUNT_OPERATION_H__
32 #include <glib-object.h>
36 #define G_TYPE_MOUNT_OPERATION (g_mount_operation_get_type ())
37 #define G_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_MOUNT_OPERATION, GMountOperation))
38 #define G_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_MOUNT_OPERATION, GMountOperationClass))
39 #define G_IS_MOUNT_OPERATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_MOUNT_OPERATION))
40 #define G_IS_MOUNT_OPERATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_MOUNT_OPERATION))
41 #define G_MOUNT_OPERATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_MOUNT_OPERATION, GMountOperationClass))
46 * Class for providing authentication methods for mounting operations,
47 * such as mounting a file locally, or authenticating with a server.
49 typedef struct _GMountOperation GMountOperation;
50 typedef struct _GMountOperationClass GMountOperationClass;
51 typedef struct _GMountOperationPrivate GMountOperationPrivate;
53 struct _GMountOperation
55 GObject parent_instance;
57 GMountOperationPrivate *priv;
62 * @G_ASK_PASSWORD_NEED_PASSWORD: operation requires a password.
63 * @G_ASK_PASSWORD_NEED_USERNAME: operation requires a username.
64 * @G_ASK_PASSWORD_NEED_DOMAIN: operation requires a domain.
65 * @G_ASK_PASSWORD_SAVING_SUPPORTED: operation supports saving settings.
66 * @G_ASK_PASSWORD_ANONYMOUS_SUPPORTED: operation supports anonymous users.
68 * #GAskPasswordFlags are used to request specific information from the
69 * user, or to notify the user of their choices in an authentication
74 G_ASK_PASSWORD_NONE = 0,
75 G_ASK_PASSWORD_NEED_PASSWORD = 1<<0,
76 G_ASK_PASSWORD_NEED_USERNAME = 1<<1,
77 G_ASK_PASSWORD_NEED_DOMAIN = 1<<2,
78 G_ASK_PASSWORD_SAVING_SUPPORTED = 1<<3,
79 G_AKS_PASSWORD_ANONYMOUS_SUPPORTED = 1<<4
84 * @G_PASSWORD_SAVE_NEVER: never save a password.
85 * @G_PASSWORD_SAVE_FOR_SESSION: save a password for the session.
86 * @G_PASSWORD_SAVE_PERMANENTLY: save a password permanently.
88 * #GPasswordSave is used to indicate the lifespan of a saved password.
91 G_PASSWORD_SAVE_NEVER,
92 G_PASSWORD_SAVE_FOR_SESSION,
93 G_PASSWORD_SAVE_PERMANENTLY
96 struct _GMountOperationClass
98 GObjectClass parent_class;
102 gboolean (* ask_password) (GMountOperation *op,
104 const char *default_user,
105 const char *default_domain,
106 GAskPasswordFlags flags);
108 gboolean (* ask_question) (GMountOperation *op,
110 const char *choices[]);
112 void (* reply) (GMountOperation *op,
116 /* Padding for future expansion */
117 void (*_g_reserved1) (void);
118 void (*_g_reserved2) (void);
119 void (*_g_reserved3) (void);
120 void (*_g_reserved4) (void);
121 void (*_g_reserved5) (void);
122 void (*_g_reserved6) (void);
123 void (*_g_reserved7) (void);
124 void (*_g_reserved8) (void);
125 void (*_g_reserved9) (void);
126 void (*_g_reserved10) (void);
127 void (*_g_reserved11) (void);
128 void (*_g_reserved12) (void);
131 GType g_mount_operation_get_type (void) G_GNUC_CONST;
133 GMountOperation * g_mount_operation_new (void);
135 const char * g_mount_operation_get_username (GMountOperation *op);
136 void g_mount_operation_set_username (GMountOperation *op,
137 const char *username);
138 const char * g_mount_operation_get_password (GMountOperation *op);
139 void g_mount_operation_set_password (GMountOperation *op,
140 const char *password);
141 gboolean g_mount_operation_get_anonymous (GMountOperation *op);
142 void g_mount_operation_set_anonymous (GMountOperation *op,
144 const char * g_mount_operation_get_domain (GMountOperation *op);
145 void g_mount_operation_set_domain (GMountOperation *op,
147 GPasswordSave g_mount_operation_get_password_save (GMountOperation *op);
148 void g_mount_operation_set_password_save (GMountOperation *op,
150 int g_mount_operation_get_choice (GMountOperation *op);
151 void g_mount_operation_set_choice (GMountOperation *op,
153 void g_mount_operation_reply (GMountOperation *op,
158 #endif /* __G_MOUNT_OPERATION_H__ */