diff options
Diffstat (limited to 'vfs/uVFSprototypes.pas')
| -rw-r--r-- | vfs/uVFSprototypes.pas | 75 |
1 files changed, 44 insertions, 31 deletions
diff --git a/vfs/uVFSprototypes.pas b/vfs/uVFSprototypes.pas index ba848e9..43190a4 100644 --- a/vfs/uVFSprototypes.pas +++ b/vfs/uVFSprototypes.pas @@ -69,7 +69,8 @@ const VFS_ASK_PASSWORD_NEED_DOMAIN = 1 shl 2; VFS_ASK_PASSWORD_SAVING_SUPPORTED = 1 shl 3; // Plugin reports if gnome-keyring is available VFS_ASK_PASSWORD_ANONYMOUS_SUPPORTED = 1 shl 4; - VFS_ASK_PASSWORD_SAVE_INTERNAL = 1 shl 15; // Save password into internal Connection Manager + VFS_ASK_PASSWORD_SAVE_INTERNAL = 1 shl 14; // Save password into internal Connection Manager + VFS_ASK_PASSWORD_ARCHIVE_MODE = 1 shl 15; // Callback from archive, change the UI a little bit type @@ -145,6 +146,38 @@ type end; type + // Return index of the choice selected or negative number when dialog has been cancelled + // cancel_choice: index which represents the cancellation choice. Set to -1 (e.g.) to disable this feature + PVFSAskQuestionCallback = ^TVFSAskQuestionCallback; + TVFSAskQuestionCallback = procedure (const AMessage: PChar; + const Choices: PPChar; + choice: PInteger; + cancel_choice: Integer; + user_data: Pointer); cdecl; + + PVFSAskPasswordCallback = ^TVFSAskPasswordCallback; + // Remember to allocate passed strings separately (use strdup() when setting reply) + // Modules are eligible for keeping passwords during one session; calling callback again means the last password was wrong and user should enter new one + // Returns True (1) if succeeded or False (0) if cancelled + TVFSAskPasswordCallback = function (const AMessage: PChar; + const default_user: PChar; + const default_domain: PChar; + const default_password: PChar; + flags: TVFSAskPasswordFlags; + username: PPChar; + password: PPChar; + anonymous: PInteger; + domain: PPChar; + password_save: PVFSPasswordSave; + user_data: Pointer): LongBool; cdecl; + + // Return False to break the operation + PVFSProgressCallback = ^TVFSProgressCallback; + TVFSProgressCallback = function (position: Int64; + max: Int64; + user_data: Pointer): LongBool; cdecl; + +type // Log function which could plugin call - the application must handle the messages (e.g. write them to the stdout) PVFSLogFunc = ^TVFSLogFunc; TVFSLogFunc = procedure(S: PChar); cdecl; @@ -177,8 +210,6 @@ type TVFSOpen = function (g:TVFSGlobs; const sName: PChar): TVFSResult; cdecl; // TODO: Opens the location (file or URI/URL) // In case of URI, do not supply password encoded in the string; plugin will automatically spawn the TVFSAskPasswordCallback callback - TVFSLogin = function (g:TVFSGlobs; const User, Pass: PChar): TVFSResult; cdecl; - // TODO: Performs login to the server TVFSClose = function (g:TVFSGlobs): TVFSResult; cdecl; // Closes the file or connection to the server TVFSMkDir = function (g:TVFSGlobs; const sDirName: PChar): TVFSResult; cdecl; @@ -214,19 +245,20 @@ type // TODO: Runs the command read from inside the archive (typically installing the rpm package) - TVFSCopyCallBackFunc = function (iPos, iMax: Int64; data: Pointer):LongBool; cdecl; - // Callback function used during the copy process; return False to break the copy process - - TVFSCopyOut = function (g:TVFSGlobs; const sSrcName, sDstName: PChar; pCallBackProgress: TVFSCopyCallBackFunc; data: Pointer; Append: LongBool): TVFSResult; cdecl; + TVFSCopyOut = function (g:TVFSGlobs; const sSrcName, sDstName: PChar; Append: LongBool): TVFSResult; cdecl; // Performs the copy process from inside of module to the file in the local system // (thus sSrcName is a path from inside of module and sDstName is path in the local filesystem where the file should be copied) // The data pointer is then used to call the callback function in // Note: if you need to transfer a file between two VFS modules, you need to do it manually - either first copy to local FS or use the Open, Read, Write functions of the module (NOTE: both VFS modules have to support these functions) - TVFSCopyIn = function (g:TVFSGlobs; const sSrcName, sDstName: PChar; pCallBackProgress: TVFSCopyCallBackFunc; data: Pointer; Append: LongBool): TVFSResult; cdecl; + TVFSCopyIn = function (g:TVFSGlobs; const sSrcName, sDstName: PChar; Append: LongBool): TVFSResult; cdecl; // Performs the copy process from the local filesystem into the module + // Prototype function for packing new files into archive + TVFSPack = function (g:TVFSGlobs; const sSrcName, sDstName: PChar; CompressionLevel: integer; const Password: PChar): TVFSResult; cdecl; + + // This is the set of basic functions which can manipulate with the data // There is a TVFSFileDes object which identifies the processed file (filedescriptor) // All these functions needs a pointer to an int variable to store the error code @@ -253,7 +285,6 @@ type TVFSFileInfo = function (g:TVFSGlobs; AFileName: PChar; VFSItem: PVFSItem): TVFSResult; cdecl; // Gets a single info item without need to list a whole directory - TVFSSetPassword = function (g:TVFSGlobs; pass: PChar): TVFSResult; cdecl; TVFSGetPasswordRequired = function (g:TVFSGlobs): LongBool; cdecl; /// pridat neco jako set_loglevel ?? @@ -261,29 +292,11 @@ type //// pridat typ pluginu - jestli archive nebo protocol - prip. jeste pridat ktery protokoly je to schopno handlovat - // Return index of the choice selected or negative number when dialog has been cancelled - // cancel_choice: index which represents the cancellation choice. Set to -1 (e.g.) to disable this feature - PVFSAskQuestionCallback = ^TVFSAskQuestionCallback; - TVFSAskQuestionCallback = procedure (const AMessage: PChar; - const Choices: PPChar; - choice: PInteger; - cancel_choice: Integer; - user_data: Pointer); cdecl; - - PVFSAskPasswordCallback = ^TVFSAskPasswordCallback; - // Remember to allocate passed strings separately (use strdup() when setting reply) - TVFSAskPasswordCallback = function (const AMessage: PChar; - const default_user: PChar; - const default_domain: PChar; - flags: TVFSAskPasswordFlags; - username: PPChar; - password: PPChar; - anonymous: PInteger; - domain: PPChar; - password_save: PVFSPasswordSave; - user_data: Pointer): LongBool; cdecl; - TVFSSetCallbacks = procedure (g: TVFSGlobs; ask_question_callback: PVFSAskQuestionCallback; ask_password_callback: PVFSAskPasswordCallback; Data: Pointer); cdecl; + TVFSSetCallbacks = procedure (g: TVFSGlobs; ask_question_callback: PVFSAskQuestionCallback; + ask_password_callback: PVFSAskPasswordCallback; + progress_func: PVFSProgressCallback; + user_data: Pointer); cdecl; |
