From fc649fb9d8d2edd3eef0ba6ba54b769c956ab3cb Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 12 Oct 2008 12:17:53 +0200 Subject: GVFS plugin: Implement question and password callbacks --- common/vfs_types.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'common') diff --git a/common/vfs_types.h b/common/vfs_types.h index 753f5c5..583ffe6 100644 --- a/common/vfs_types.h +++ b/common/vfs_types.h @@ -30,11 +30,47 @@ typedef int TVFSResult; +/* Compatible with gio/GAskPasswordFlags */ +typedef enum { + VFS_ASK_PASSWORD_NEED_PASSWORD = 1<<0, + VFS_ASK_PASSWORD_NEED_USERNAME = 1<<1, + VFS_ASK_PASSWORD_NEED_DOMAIN = 1<<2, + VFS_ASK_PASSWORD_SAVING_SUPPORTED = 1<<3, + VFS_ASK_PASSWORD_ANONYMOUS_SUPPORTED = 1<<4 +} TVFSAskPasswordFlags; + +/* Compatible with gio/GPasswordSave */ +typedef enum { + VFS_PASSWORD_SAVE_NEVER, + VFS_PASSWORD_SAVE_FOR_SESSION, + VFS_PASSWORD_SAVE_PERMANENTLY +} TVFSPasswordSave; + typedef void (* TVFSLogFunc)(char *s); typedef int (* TVFSCopyCallBackFunc)(u_int64_t iPos, u_int64_t iMax, void *data); typedef void *TVFSFileDes; +/* Return index of the choice selected or negative number when dialog has been cancelled */ +typedef void (* TVFSAskQuestionCallback) + (const char *message, + const char *choices[], + int *choice, + void *user_data); + +typedef int (* TVFSAskPasswordCallback) + (const char *message, + const char *default_user, + const char *default_domain, + TVFSAskPasswordFlags flags, + char **username, + char **password, + int *anonymous, + char **domain, + TVFSPasswordSave *password_save, + void *user_data); + + static const int cVFSVersion = 4; // current version of the VFS API // Capabilities -- cgit v1.2.3