From 3562498c4833bae1de6f8fbf12cc1180660d4626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20V=C3=A1rady?= Date: Sun, 24 Dec 2023 01:15:45 +0100 Subject: [PATCH] spl_fs.h: translated --- src/plugins/shared/spl_fs.h | 1270 ++++++++++++++++++----------------- 1 file changed, 640 insertions(+), 630 deletions(-) diff --git a/src/plugins/shared/spl_fs.h b/src/plugins/shared/spl_fs.h index b95411019..2b5a92a5c 100644 --- a/src/plugins/shared/spl_fs.h +++ b/src/plugins/shared/spl_fs.h @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later - +// CommentsTranslationProject: TRANSLATED +// //**************************************************************************** // // Copyright (c) 2023 Open Salamander Authors @@ -12,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_fs) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_fs) // so that structures are independent of set alignment #pragma pack(4) #endif // _MSC_VER #ifdef __BORLANDC__ @@ -28,63 +29,64 @@ class CPluginDataInterfaceAbstract; // **************************************************************************** // CSalamanderForViewFileOnFSAbstract // -// sada metod ze Salamandera pro podporu provedeni ViewFile v CPluginFSInterfaceAbstract, -// platnost interfacu je omezena na metodu, ktere je interface predan jako parametr +// set of methods from Salamander for support of ViewFile in CPluginFSInterfaceAbstract, +// validity of interface is limited to the method to which the interface is passed as parameter class CSalamanderForViewFileOnFSAbstract { public: - // najde v disk-cache existujici kopii souboru nebo pokud jeste kopie souboru neni - // v disk-cache, rezervuje pro ni jmeno (cilovy soubor napr. pro download z FTP); - // 'uniqueFileName' je unikatni nazev originalniho souboru (podle tohoto nazvu - // se prohledava disk-cache; melo by stacit plne jmeno souboru v salamanderovske - // forme - "fs-name:fs-user-part"; POZOR: nazev se porovnava "case-sensitive", pokud - // plugin vyzaduje "case-insensitive", musi vsechny nazvy prevadet napr. na mala - // pismena - viz CSalamanderGeneralAbstract::ToLowerCase); 'nameInCache' je jmeno - // kopie souboru, ktera je umistena v disk-cache (ocekava se zde posledni - // cast jmena originalniho souboru, aby pozdeji v titulku viewru uzivateli pripominala - // originalni soubor); je-li 'rootTmpPath' NULL, je diskova cache ve Windows TEMP - // adresari, jinak je cesta do disk-cache v 'rootTmpPath'; pri systemove chybe vraci - // NULL (nemelo by vubec nastat), jinak vraci plne jmeno kopie souboru v disk-cache - // a ve 'fileExists' vraci TRUE pokud soubor v disk-cache existuje (napr. uz probehl - // download z FTP) nebo FALSE pokud je soubor teprve potreba pripravit (napr. provest - // jeho download); 'parent' je parent messageboxu s chybami (napriklad prilis dlouhy - // nazev souboru) - // POZOR: pokud nevratila NULL (nenastala systemova chyba), je nutne pozdeji zavolat - // FreeFileNameInCache (pro stejne 'uniqueFileName') - // POZN.: pokud FS vyuziva disk-cache, mel by alespon pri unloadu pluginu zavolat - // CSalamanderGeneralAbstract::RemoveFilesFromCache("fs-name:"), jinak budou - // jeho kopie souboru zbytecne prekazet v disk-cache + // searches for an existing copy of the file in the disk cache or if the copy of the file + // does not exist in the disk cache yet, reserves a name for it (target file for example + // for download from FTP); 'uniqueFileName' is unique name of the original file (the name + // is used for searching in the disk cache; it should be enough to use full name of the + // file in Salamander form - "fs-name:fs-user-part"; WARNING: the name is compared + // "case-sensitive", if the plugin requires "case-insensitive", it must convert all names + // to lower case - see CSalamanderGeneralAbstract::ToLowerCase); 'nameInCache' is name + // of the copy of the file which is placed in the disk cache (the last part of the name + // of the original file is expected here, so that it reminds the original file in the + // title of the viewer); if 'rootTmpPath' is NULL, the disk cache is in the Windows TEMP + // directory, otherwise it is path to the disk cache in 'rootTmpPath'; in case of system + // error returns NULL (it should not occur at all), otherwise returns full name of the + // copy of the file in the disk cache and in 'fileExists' returns TRUE if the file in + // the disk cache exists (for example download from FTP has already been done) or FALSE + // if the file is needed to be prepared (for example to perform its download); 'parent' + // is parent of messagebox with errors (for example too long name of the file) + // WARNING: if it does not return NULL (system error did not occur), it is necessary to + // call FreeFileNameInCache later (for the same 'uniqueFileName') + // NOTE: if FS uses disk cache, it should at least call + // CSalamanderGeneralAbstract::RemoveFilesFromCache("fs-name:") when unloading the + // plugin, otherwise its copies of files will unnecessarily disturb in the disk cache virtual const char* WINAPI AllocFileNameInCache(HWND parent, const char* uniqueFileName, const char* nameInCache, const char* rootTmpPath, BOOL& fileExists) = 0; - // otevre soubor 'fileName' z windowsove cesty v uzivatelem pozadovanem prohlizeci (bud - // pomoci asociace viewru nebo pres prikaz View With); 'parent' je parent messageboxu - // s chybami; neni-li 'fileLock' a 'fileLockOwner' NULL, vraci se v nich vazba na - // otevreny viewer (pouzije se jako parametr metody FreeFileNameInCache); vraci TRUE - // pokud byl viewer otevren + // opens file 'fileName' from Windows path in viewer chosen by user (either by association + // or by command View With); 'parent' is parent of messagebox with errors; if 'fileLock' + // and 'fileLockOwner' are not NULL, they return binding to the opened viewer (it is used + // as parameter of method FreeFileNameInCache); returns TRUE if the viewer was opened virtual BOOL WINAPI OpenViewer(HWND parent, const char* fileName, HANDLE* fileLock, BOOL* fileLockOwner) = 0; - // musi parovat s AllocFileNameInCache, vola se az po otevreni vieweru (nebo po chybe pri - // priprave kopie souboru nebo otevirani vieweru); 'uniqueFileName' je unikatni nazev - // originalniho souboru (pouzivat stejny retezec jako pri volani AllocFileNameInCache); - // 'fileExists' je FALSE pokud kopie souboru v disk-cache neexistovala a TRUE pokud - // jiz existovala (shodna hodnota s vystupnim parametrem 'fileExists' metody AllocFileNameInCache); - // je-li 'fileExists' TRUE, 'newFileOK' a 'newFileSize' se ignoruji, jinak 'newFileOK' je - // TRUE pokud byla kopie souboru uspesne pripravena (napr. download probehl uspesne) a - // v 'newFileSize' je velikost pripravene kopie souboru; je-li 'newFileOK' FALSE, je - // 'newFileSize' ignorovana; 'fileLock' a 'fileLockOwner' provazuji otevreny viewer - // s kopiemi souboru v disk-cache (po zavreni vieweru disk-cache dovoli zrusit kopii - // souboru - kdy dojde ke zruseni kopie zalezi na velikosti disk-cache na disku), oba - // tyto parametry lze ziskat pri volani metody OpenViewer; pokud se viewer - // nepodarilo otevrit (nebo se nepodarilo pripravit kopii souboru do disk-cache nebo viewer - // nema vazbu s disk-cache), nastavi se 'fileLock' na NULL a 'fileLockOwner' na FALSE; - // je-li 'fileExists' TRUE (kopie souboru existovala), hodnota 'removeAsSoonAsPossible' - // se ignoruje, jinak: je-li 'removeAsSoonAsPossible' TRUE, kopie souboru se v disk-cache - // nebude skladovat dele nez je nutne (po zavreni vieweru dojde hned k vymazu; pokud se - // viewer vubec neotevrel ('fileLock' je NULL), nedojde ke vlozeni souboru do disk-cache, - // ale k vymazu) + // must match with AllocFileNameInCache, called after opening the viewer (or after error + // during preparation of the copy of the file or opening the viewer); 'uniqueFileName' + // is unique name of the original file (use the same string as when calling + // AllocFileNameInCache); 'fileExists' is FALSE if the copy of the file in the disk cache + // did not exist and TRUE if it already existed (the same value as output parameter + // 'fileExists' of method AllocFileNameInCache); if 'fileExists' is TRUE, 'newFileOK' + // and 'newFileSize' are ignored, otherwise 'newFileOK' is TRUE if the copy of the file + // was successfully prepared (for example download was successful) and in 'newFileSize' + // is size of the prepared copy of the file; if 'newFileOK' is FALSE, 'newFileSize' is + // ignored; 'fileLock' and 'fileLockOwner' bind opened viewer with copies of files in + // the disk cache (after closing the viewer the disk cache allows to delete the copy + // of the file - when the copy of the file is deleted depends on size of the disk cache + // on the disk), both these parameters can be obtained when calling method OpenViewer; + // if the viewer could not be opened (or the copy of the file could not be prepared + // in the disk cache or the viewer does not have binding with the disk cache), 'fileLock' + // is set to NULL and 'fileLockOwner' to FALSE; if 'fileExists' is TRUE (the copy of the + // file existed), the value 'removeAsSoonAsPossible' is ignored, otherwise: if + // 'removeAsSoonAsPossible' is TRUE, the copy of the file in the disk cache will not be + // stored longer than necessary (after closing the viewer it will be deleted immediately; + // if the viewer was not opened at all ('fileLock' is NULL), the file will not be placed + // in the disk cache, but it will be deleted) virtual void WINAPI FreeFileNameInCache(const char* uniqueFileName, BOOL fileExists, BOOL newFileOK, const CQuadWord& newFileSize, HANDLE fileLock, BOOL fileLockOwner, BOOL removeAsSoonAsPossible) = 0; @@ -94,80 +96,78 @@ class CSalamanderForViewFileOnFSAbstract // **************************************************************************** // CPluginFSInterfaceAbstract // -// sada metod pluginu, ktere potrebuje Salamander pro praci s file systemem +// set of methods of plugin which are needed by Salamander for work with file system -// typ ikon v panelu pri listovani FS (pouziva se v CPluginFSInterfaceAbstract::ListCurrentPath()) -#define pitSimple 0 // jednoduche ikonky pro soubory a adresare - podle pripony (asociace) -#define pitFromRegistry 1 // ikonky nacitane z registry podle pripony souboru/adresaru -#define pitFromPlugin 2 // ikonky obstarava plugin (ikony ziskava pres CPluginDataInterfaceAbstract) +// type of icons in panel during browsing FS (used in CPluginFSInterfaceAbstract::ListCurrentPath()) +#define pitSimple 0 // simple icons for files and directories - according to extension (association) +#define pitFromRegistry 1 // icons loaded from registry according to file/directory extension +#define pitFromPlugin 2 // icons managed by plugin - plugin returns icons in CPluginDataInterfaceAbstract -// kody udalosti (a vyznam parametru 'param') na FS, prijima metoda CPluginFSInterfaceAbstract::Event(): -// CPluginFSInterfaceAbstract::TryCloseOrDetach vratil TRUE, ale novou cestu se nepodarilo -// otevrit, takze zustavame na soucasne ceste (FS, ktere prijme tuto zpravu); -// 'param' je panel obsahujici tento FS (PANEL_LEFT nebo PANEL_RIGHT) +// codes of events (and meaning of parameter 'param') sent to FS, received by method CPluginFSInterfaceAbstract::Event(): +// CPluginFSInterfaceAbstract::TryCloseOrDetach returned TRUE, but new path could not be opened, +// so we stay on current path (FS which receives this message); +// 'param' is panel containing this FS (PANEL_LEFT or PANEL_RIGHT) #define FSE_CLOSEORDETACHCANCELED 0 -// uspesne pripojeni noveho FS do panelu (po zmene cesty a jejim vylistovani) -// 'param' je panel obsahujici tento FS (PANEL_LEFT nebo PANEL_RIGHT) +// successful connection of new FS to panel (after change of path and its listing) +// 'param' is panel containing this FS (PANEL_LEFT or PANEL_RIGHT) #define FSE_OPENED 1 -// uspesne pridani do seznamu odpojenych FS (konec rezimu "panel" FS, zacatek rezimu "detached" FS); -// 'param' je panel obsahujici tento FS (PANEL_LEFT nebo PANEL_RIGHT) +// successful addition to the list of disconnected FS (end of "panel" FS mode, beginning of "detached" FS mode); +// 'param' is panel containing this FS (PANEL_LEFT or PANEL_RIGHT) #define FSE_DETACHED 2 -// uspesne pripojeni odpojeneho FS (konec rezimu "detached" FS, zacatek rezimu "panel" FS); -// 'param' je panel obsahujici tento FS (PANEL_LEFT nebo PANEL_RIGHT) +// successful connection of disconnected FS to panel (end of "detached" FS mode, beginning of "panel" FS mode); +// 'param' is panel containing this FS (PANEL_LEFT or PANEL_RIGHT) #define FSE_ATTACHED 3 -// aktivace hlavniho okna Salamandera (pri minimalizovanem oknu se ceka na restore/maximize, -// a pak se teprve zasle tato udalost, aby se pripadna chybova okna ukazovala nad Salamanderem), -// chodi jen do FS, ktery je v panelu (neni odpojen), pokud se zmeny na FS nemonitoruji automaticky, -// oznamuje tato udalost vhodny okamzik k refreshi; -// 'param' je panel obsahujici tento FS (PANEL_LEFT nebo PANEL_RIGHT) +// activation of main Salamander window (when window is minimized, it is waiting for restore/maximize +// and then this event is sent, so that any error windows are shown above Salamander), +// goes only to FS which is in panel (not detached), if changes on FS are not monitored automatically, +// this event announces suitable moment for refresh; +// 'param' is panel containing this FS (PANEL_LEFT or PANEL_RIGHT) #define FSE_ACTIVATEREFRESH 4 -// vyprsel timeout jednoho z timeru tohoto FS, 'param' je parametr tohoto timeru; -// POZOR: metoda CPluginFSInterfaceAbstract::Event() s kodem FSE_TIMER se vola -// z hlavniho threadu po doruceni zpravy WM_TIMER hlavnimu oknu (tedy napr. muze -// byt zrovna otevreny libovolny modalni dialog), takze reakce na timer by mela -// probehnout v tichosti (neotevirat zadna okna, atd.); k volani metody -// CPluginFSInterfaceAbstract::Event() s kodem FSE_TIMER muze dojit hned po -// volani metody CPluginInterfaceForFS::OpenFS (pokud se v ni prida timer pro -// nove vytvoreny objekt FS) +// timeout of one of timers of this FS has expired, 'param' is parameter of this timer; +// CAUTION: method CPluginFSInterfaceAbstract::Event() with code FSE_TIMER is called from main thread +// after receiving WM_TIMER message by main window (so for example any modal dialog can be opened), +// so reaction to timer should be silent (no opening of any windows, etc.); call of method +// CPluginFSInterfaceAbstract::Event() with code FSE_TIMER can occur immediately after calling +// method CPluginInterfaceForFS::OpenFS (if timer for newly created FS is added in it) #define FSE_TIMER 5 -// prave probehla zmena cesty (nebo refresh) v tomto FS v panelu nebo pripojeni -// tohoto odpojeneho FS do panelu (tato udalost se posila po zmene cesty a jejim -// vylistovani); FSE_PATHCHANGED chodi po kazdem uspesnem volani ListCurrentPath -// POZNAMKA: FSE_PATHCHANGED tesne nasleduje za vsemi FSE_OPENED a FSE_ATTACHED -// 'param' je panel obsahujici tento FS (PANEL_LEFT nebo PANEL_RIGHT) +// change of path (or refresh) in this FS in panel or connection of this detached FS to panel +// (this event is sent after change of path and its listing); FSE_PATHCHANGED is sent after +// every successful call of ListCurrentPath +// NOTE: FSE_PATHCHANGED immediately follows all FSE_OPENED and FSE_ATTACHED +// 'param' is panel containing this FS (PANEL_LEFT or PANEL_RIGHT) #define FSE_PATHCHANGED 6 -// konstanty oznacujici duvod volani CPluginFSInterfaceAbstract::TryCloseOrDetach(); -// v zavorce jsou vzdy uvedeny mozne hodnoty forceClose ("FALSE->TRUE" znamena "nejdriv -// to zkusi bez force, kdyz FS odmitne, zepta se usera a pripadne to da s force") a canDetach: +// constants marking reason of calling CPluginFSInterfaceAbstract::TryCloseOrDetach(); +// in brackets are possible values of forceClose ("FALSE->TRUE" means "first try without force, +// if FS refuses, ask user and possibly do it with force") and canDetach: // -// (FALSE, TRUE) pri zmene cesty mimo FS otevrene v panelu +// (FALSE, TRUE) when changing path outside FS opened in panel #define FSTRYCLOSE_CHANGEPATH 1 -// (FALSE->TRUE, FALSE) pro FS otevrene v panelu pri unloadu pluginu (user si preje unload + -// zavirani Salamandera + pred odstranenim pluginu + unload na zadost pluginu) +// (FALSE->TRUE, FALSE) for FS opened in panel when unloading plugin (user wants to unload + +// close Salamander + before removing plugin + unload on request of plugin) #define FSTRYCLOSE_UNLOADCLOSEFS 2 -// (FALSE, TRUE) pri zmene cesty nebo refreshi (Ctrl+R) FS otevreneho v panelu se zjistilo, -// ze jiz zadna cesta na FS neni pristupna - Salamander se snazi zmenit cestu v panelu -// na fixed-drive (pokud mu to FS nedovoli, zustane FS v panelu bez souboru a adresaru) +// (FALSE, TRUE) when changing path or refreshing (Ctrl+R) FS opened in panel, it was found +// that no path on FS is accessible - Salamander tries to change path in panel to fixed-drive +// (if FS refuses, FS remains in panel without files and directories) #define FSTRYCLOSE_CHANGEPATHFAILURE 3 -// (FALSE, FALSE) pri pripojovani odpojeneho FS zpet do panelu se zjistilo, ze jiz zadna cesta -// na tomto FS neni pristupna - Salamander se snazi tento odpojeny FS zavrit (pokud FS odmitne, -// zustane dale na seznamu odpojenych FS - napr. v Alt+F1/F2 menu) +// (FALSE, TRUE) when connecting detached FS back to panel, it was found that no path on FS +// is accessible - Salamander tries to close this detached FS (if FS refuses, FS remains +// in list of detached FS - for example in Alt+F1/F2 menu) #define FSTRYCLOSE_ATTACHFAILURE 4 -// (FALSE->TRUE, FALSE) pro odpojeny FS pri unloadu pluginu (user si preje unload + -// zavirani Salamandera + pred odstranenim pluginu + unload na zadost pluginu) +// (FALSE->TRUE, FALSE) for detached FS when unloading plugin (user wants to unload + +// close Salamander + before removing plugin + unload on request of plugin) #define FSTRYCLOSE_UNLOADCLOSEDETACHEDFS 5 -// (FALSE, FALSE) plugin zavolal CSalamanderGeneral::CloseDetachedFS() pro odpojeny FS +// (FALSE, FALSE) plugin called CSalamanderGeneral::CloseDetachedFS() for detached FS #define FSTRYCLOSE_PLUGINCLOSEDETACHEDFS 6 -// flagy oznacujici, ktere sluzby file-systemu plugin poskytuje - jake metody -// CPluginFSInterfaceAbstract jsou definovany): +// flags signalling which file-system services are provided by plugin - which methods +// CPluginFSInterfaceAbstract are defined): // copy from FS (F5 on FS) #define FS_SERVICE_COPYFROMFS 0x00000001 // move from FS + rename on FS (F6 on FS) @@ -221,539 +221,548 @@ class CSalamanderForViewFileOnFSAbstract // show security information (click on security icon in Directory Line, see CSalamanderGeneralAbstract::ShowSecurityIcon) #define FS_SERVICE_SHOWSECURITYINFO 0x02000000 -// chybi: Change Case, Convert, Properties, Make File List +// missing: Change Case, Convert, Properties, Make File List -// typy kontextovych menu pro metodu CPluginFSInterfaceAbstract::ContextMenu() -#define fscmItemsInPanel 0 // kontextove menu pro polozky v panelu (oznacene/fokusle soubory a adresare) -#define fscmPathInPanel 1 // kontextove menu pro aktualni cestu v panelu -#define fscmPanel 2 // kontextove menu pro panel +// types of context menus for method CPluginFSInterfaceAbstract::ContextMenu() +#define fscmItemsInPanel 0 // context menu for items in panel (selected/focused files and directories) +#define fscmPathInPanel 1 // context menu for current path in panel +#define fscmPanel 2 // context menu for panel -#define SALCMDLINE_MAXLEN 8192 // maximalni delka prikazu z prikazove radky Salamandera +#define SALCMDLINE_MAXLEN 8192 // maximal length of a command from Salamander command line class CPluginFSInterfaceAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginFSInterfaceEncapsulation) +private: // protection against incorrect calling of methods (see CPluginFSInterfaceEncapsulation) friend class CPluginFSInterfaceEncapsulation; #else // INSIDE_SALAMANDER public: #endif // INSIDE_SALAMANDER - // vraci user-part aktualni cesty v tomto FS, 'userPart' je buffer o velikosti MAX_PATH - // pro cestu, vraci uspech + // returns user-part of the current path in this FS, 'userPart' is buffer of size MAX_PATH + // for path, returns success virtual BOOL WINAPI GetCurrentPath(char* userPart) = 0; - // vraci user-part plneho jmena souboru/adresare/up-diru 'file' ('isDir' je 0/1/2) na aktualni - // ceste v tomto FS; pro up-dir adresar (prvni v seznamu adresaru a zaroven pojmenovany ".."), - // je 'isDir'==2 a metoda by mela vracet aktualni cestu zkracenou o posledni komponentu; 'buf' - // je buffer o velikosti 'bufSize' pro vysledne plne jmeno, vraci uspech + // returns user-part of the full name of file/directory/up-dir 'file' ('isDir' is 0/1/2) + // on the current path in this FS; for up-dir (first in the list of directories and also + // named ".."), 'isDir'==2 and the method should return current path shortened by the last + // component; 'buf' is buffer of size 'bufSize' for the result full name, returns success virtual BOOL WINAPI GetFullName(CFileData& file, int isDir, char* buf, int bufSize) = 0; - // vraci absolutni cestu (vcetne fs-name) odpovidajici relativni ceste 'path' na tomto FS; - // vraci FALSE pokud tato metoda neni implementovana (dalsi navratove hodnoty se pak ignoruji); - // 'parent' je parent pripadnych messageboxu; 'fsName' je aktualni jmeno FS; 'path' je buffer - // o velikosti 'pathSize' znaku, na vstupu je v nem relativni cesta na FS, na vystupu je v nem - // odpovidajici absolutni cesta na FS; v 'success' vraci TRUE, pokud byla cesta uspesne prelozena - // (ma se pouzit retezec v 'path' - jinak se ignoruje) - nasleduje zmena cesty (jde-li - // o cestu na toto FS, vola se ChangePath()); pokud vrati v 'success' FALSE, predpoklada - // se, ze uzivatel jiz videl chybove hlaseni + // returns absolute path (including fs-name) corresponding to relative path 'path' on this FS; + // returns FALSE if this method is not implemented (other return values are ignored); + // 'parent' is parent of possible messageboxes; 'fsName' is current name of FS; 'path' is + // buffer of size 'pathSize' characters, on input it contains relative path on FS, on output + // it contains corresponding absolute path on FS; in 'success' returns TRUE if the path + // was successfully translated (the string in 'path' should be used - otherwise it is ignored) + // - then change of path follows (if it is a path on this FS, ChangePath() is called); + // if it returns FALSE in 'success', it is assumed that user has already seen an error message virtual BOOL WINAPI GetFullFSPath(HWND parent, const char* fsName, char* path, int pathSize, BOOL& success) = 0; - // vraci user-part rootu aktualni cesty v tomto FS, 'userPart' je buffer o velikosti MAX_PATH - // pro cestu (pouziti ve funkci "goto root"), vraci uspech + // returns user-part of root of the current path in this FS, 'userPart' is buffer of size MAX_PATH + // for path (used in function "goto root"), returns success virtual BOOL WINAPI GetRootPath(char* userPart) = 0; - // porovna aktualni cestu v tomto FS a cestu zadanou pres 'fsNameIndex' a 'userPart' - // (jmeno FS v ceste je z tohoto pluginu a je dane indexem 'fsNameIndex'), vraci TRUE - // pokud jsou cesty shodne; 'currentFSNameIndex' je index aktualniho jmena FS + // compares the current path in this FS with the path specified by 'fsNameIndex' and 'userPart' + // (name of FS in the path is from this plugin and is given by index 'fsNameIndex'), returns TRUE + // if the paths are the same; 'currentFSNameIndex' is index of current name of FS virtual BOOL WINAPI IsCurrentPath(int currentFSNameIndex, int fsNameIndex, const char* userPart) = 0; - // vraci TRUE, pokud je cesta z tohoto FS (coz znamena, ze Salamander muze cestu pustit - // do ChangePath tohoto FS); cesta je vzdy na jeden z FS tohoto pluginu (napr. windows - // cesty a cesty do archivu sem vubec neprijdou); 'fsNameIndex' je index jmena FS - // v ceste (index je nula pro fs-name zadane v CSalamanderPluginEntryAbstract::SetBasicPluginData, - // u ostatnich fs-name index vraci CSalamanderPluginEntryAbstract::AddFSName); user-part - // cesty je 'userPart'; 'currentFSNameIndex' je index aktualniho jmena FS + // returns TRUE if the path is from this FS (which means that Salamander can run the path + // in ChangePath of this FS); the path is always from one of FS of this plugin (for example + // Windows paths and paths to archives are not passed here); 'fsNameIndex' is index of name + // of FS in the path (index is zero for fs-name specified in CSalamanderPluginEntryAbstract::SetBasicPluginData, + // for other fs-names index is returned by CSalamanderPluginEntryAbstract::AddFSName); + // user-part of the path is 'userPart'; 'currentFSNameIndex' is index of current name of FS virtual BOOL WINAPI IsOurPath(int currentFSNameIndex, int fsNameIndex, const char* userPart) = 0; - // zmeni aktualni cestu v tomto FS na cestu zadanou pres 'fsName' a 'userPart' (presne - // nebo na nejblizsi pristupnou podcestu 'userPart' - viz hodnota 'mode'); v pripade, ze - // se cesta zkracuje z duvodu, ze jde o cestu k souboru (staci domenka, ze by mohlo jit - // o cestu k souboru - po vylistovani cesty se overuje jestli soubor existuje, pripadne - // se zobrazi uzivateli chyba) a 'cutFileName' neni NULL (mozne jen v 'mode' 3), vraci - // v bufferu 'cutFileName' (o velikosti MAX_PATH znaku) jmeno tohoto souboru (bez cesty), - // jinak v bufferu 'cutFileName' vraci prazdny retezec; 'currentFSNameIndex' je index - // aktualniho jmena FS; 'fsName' je buffer o velikosti MAX_PATH, na vstupu je v nem jmeno - // FS v ceste, ktere je z tohoto pluginu (ale nemusi se shodovat s aktualnim jmenem FS - // v tomto objektu, staci kdyz pro nej IsOurPath() vraci TRUE), na vystupu je v 'fsName' - // aktualni jmeno FS v tomto objektu (musi byt z tohoto pluginu); 'fsNameIndex' je index - // jmena FS 'fsName' v pluginu (pro snazsi detekci o jake jmeno FS jde); neni-li - // 'pathWasCut' NULL, vraci se v nem TRUE pokud doslo ke zkraceni cesty; Salamander - // pouziva 'cutFileName' a 'pathWasCut' u prikazu Change Directory (Shift+F7) pri zadani - // jmena souboru - dochazi k fokusu tohoto souboru; je-li 'forceRefresh' TRUE, jde o - // tvrdy refresh (Ctrl+R) a plugin by mel menit cestu bez pouziti informaci z cache - // (je nutne overit jestli nova cesta existuje); 'mode' je rezim zmeny cesty: - // 1 (refresh path) - zkracuje cestu, je-li treba; nehlasit neexistenci cesty (bez hlaseni - // zkratit), hlasit soubor misto cesty, nepristupnost cesty a dalsi chyby - // 2 (volani ChangePanelPathToPluginFS, back/forward in history, etc.) - zkracuje cestu, - // je-li treba; hlasit vsechny chyby cesty (soubor - // misto cesty, neexistenci, nepristupnost a dalsi) - // 3 (change-dir command) - zkracuje cestu jen jde-li o soubor nebo cestu nelze listovat - // (ListCurrentPath pro ni vraci FALSE); nehlasit soubor misto cesty - // (bez hlaseni zkratit a vratit jmeno souboru), hlasit vsechny ostatni - // chyby cesty (neexistenci, nepristupnost a dalsi) - // je-li 'mode' 1 nebo 2, vraci FALSE jen pokud na tomto FS zadna cesta neni pristupna - // (napr. pri vypadku spojeni); je-li 'mode' 3, vraci FALSE pokud neni pristupna - // pozadovana cesta nebo soubor (ke zkracovani cesty dojde jen v pripade, ze jde o soubor); - // v pripade, ze je otevreni FS casove narocne (napr. pripojeni na FTP server) a 'mode' - // je 3, je mozne upravit chovani jako u archivu - zkracovat cestu, je-li treba a vracet FALSE - // jen pokud na FS neni zadna cesta pristupna, hlaseni chyb se nemeni + // changes the current path in this FS to the path specified by 'fsName' and 'userPart' + // (exact or nearest accessible subpath 'userPart' - see value 'mode'); if the path is + // shortened because it is a path to a file (only a guess that it is a path to a file + // is enough - after listing the path it is checked if the file exists, otherwise an error + // is shown to the user) and 'cutFileName' is not NULL (possible only in 'mode' 3), returns + // in buffer 'cutFileName' (of size MAX_PATH characters) name of this file (without path), + // otherwise returns empty string in buffer 'cutFileName'; 'currentFSNameIndex' is index + // of current name of FS; 'fsName' is buffer of size MAX_PATH, on input it contains name + // of FS in the path from this plugin (but it does not have to match current name of FS + // in this object, it is enough if IsOurPath() returns TRUE for it), on output in 'fsName' + // is current name of FS in this object (it must be from this plugin); 'fsNameIndex' is + // index of name of FS 'fsName' in plugin (for easier detection of which FS name it is); + // if 'pathWasCut' is not NULL, it returns TRUE if the path was shortened; Salamander uses + // 'cutFileName' and 'pathWasCut' in Change Directory command (Shift+F7) when entering + // file name - the file gets focus; if 'forceRefresh' is TRUE, it is hard refresh (Ctrl+R) + // and plugin should change path without using information from cache (it is necessary to + // check if the new path exists); 'mode' is mode of changing path: + // 1 (refresh path) - shortens the path if necessary; do not show error if the path does + // not exist (without showing shorten), show file instead of path, + // inaccessibility of path and other path errors + // 2 (calling ChangePanelPathToPluginFS, back/forward in history, etc.) - shortens the path, + // if needed; report all path errors (file instead of path, non-existence, + // inaccessibility and others) + // 3 (change-dir command) - shortens the path only if it is a file or the path cannot be listed + // (ListCurrentPath returns FALSE for it); do not report file instead of path + // (shorten and return file name without reporting), report all other path + // errors (non-existence, inaccessibility and others) + // if 'mode' is 1 or 2, returns FALSE only if no path is accessible on this FS (for example + // connection lost); if 'mode' is 3, returns FALSE if the path or file is not accessible + // (path is shortened only if it is a file); if opening FS is time-consuming (for example + // connection to FTP server), and 'mode' is 3, it is possible to change behavior as for archives + // - shorten the path if needed and return FALSE only if no path is accessible on this FS + // error reporting is not changed virtual BOOL WINAPI ChangePath(int currentFSNameIndex, char* fsName, int fsNameIndex, const char* userPart, char* cutFileName, BOOL* pathWasCut, BOOL forceRefresh, int mode) = 0; - // nacita soubory a adresare z aktualni cesty, uklada je do objektu 'dir' (na cestu NULL nebo - // "", soubory a adresare na jinych cestach jsou ignorovany; je-li pridan adresar se jmenem - // "..", vykresluje se jako "up-dir" symbol; jmena souboru a adresaru jsou plne - // zavisla na pluginu, Salamander je jen zobrazuje); Salamander zjisti obsah - // pluginem pridanych sloupcu pomoci interfacu 'pluginData' (pokud plugin sloupce nepridava - // a nema vlastni ikony, vraci 'pluginData'==NULL); v 'iconsType' vraci pozadovany zpusob - // ziskavani ikon souboru a adresaru do panelu, pitFromPlugin degraduje na pitSimple pokud - // je 'pluginData' NULL (bez 'pluginData' nelze zajistit pitFromPlugin); je-li 'forceRefresh' - // TRUE, jde o tvrdy refresh (Ctrl+R) a plugin by mel nacitat soubory a adresare bez pouziti - // cache; vraci TRUE pri uspesnem nacteni, pokud vrati FALSE jde o chybu a bude se volat - // ChangePath na aktualni cestu, ocekava se, ze ChangePath vybere pristupnou podcestu - // nebo vrati FALSE, po uspesnem volani ChangePath se bude opakovat volani ListCurrentPath; - // pokud vrati FALSE, navratova hodnota 'pluginData' se ignoruje (data v 'dir' je potreba - // uvolnit pomoci 'dir.Clear(pluginData)', jinak se uvolni jen Salamanderovska cast dat); + // loads files and directories from the current path, saves them to object 'dir' (on path + // NULL or "", files and directories on other paths are ignored; if directory with name ".." + // is added, it is displayed as "up-dir" symbol; names of files and directories are fully + // dependent on plugin, Salamander only displays them); Salamander gets content of columns + // added by plugin using interface 'pluginData' (if plugin does not add columns and does + // not have its own icons, 'pluginData'==NULL is returned); 'iconsType' returns required + // way of getting icons of files and directories to panel, pitFromPlugin degrades to pitSimple + // if 'pluginData' is NULL (pitFromPlugin cannot be provided without 'pluginData'); if + // 'forceRefresh' is TRUE, it is hard refresh (Ctrl+R) and plugin should load files and + // directories without using cache; returns TRUE if loading was successful, if it returns + // FALSE, it is an error and ChangePath on current path will be called, it is expected that + // ChangePath will select accessible subpath or return FALSE, after successful call of + // ChangePath, ListCurrentPath will be called again; if it returns FALSE, return value + // 'pluginData' is ignored (data in 'dir' must be freed using 'dir.Clear(pluginData)', + // otherwise only Salamander part of data is freed); virtual BOOL WINAPI ListCurrentPath(CSalamanderDirectoryAbstract* dir, CPluginDataInterfaceAbstract*& pluginData, int& iconsType, BOOL forceRefresh) = 0; - // priprava FS na zavreni/odpojeni od panelu nebo zavreni odpojeneho FS; je-li 'forceClose' - // TRUE, dojde k zavreni FS bez ohledu na navratove hodnoty, akci vynutil user nebo probiha - // critical shutdown (vice viz CSalamanderGeneralAbstract::IsCriticalShutdown), kazdopadne - // nema smysl se usera na cokoliv ptat, FS se ma proste hned zavrit (uz neotvirat zadna okna); - // je-li 'forceClose' FALSE, muze se FS zavrit nebo odpojit ('canDetach' TRUE) a nebo jen - // zavrit ('canDetach' FALSE); v 'detach' vraci TRUE pokud se chce jen odpojit, FALSE znamena - // zavrit; 'reason' obsahuje duvod volani teto metody (jedna z FSTRYCLOSE_XXX); vraci TRUE - // pokud lze zavrit/odpojit, jinak vraci FALSE + // preparation of FS for closing/detaching from panel or closing of detached FS; if + // 'forceClose' is TRUE, FS is closed regardless of return values, the action was + // forced by user or critical shutdown is in progress (see CSalamanderGeneralAbstract::IsCriticalShutdown); + // anyway, it does not make sense to ask user anything, FS should be closed immediately + // (no opening of any windows); if 'forceClose' is FALSE, FS can be closed/detached + // ('canDetach'==TRUE) or only closed ('canDetach'==FALSE); 'detach' returns TRUE if + // FS wants to detach, FALSE means close; 'reason' contains reason of calling this method + // (one of FSTRYCLOSE_XXX); returns TRUE if it can be closed/detached, otherwise returns FALSE virtual BOOL WINAPI TryCloseOrDetach(BOOL forceClose, BOOL canDetach, BOOL& detach, int reason) = 0; - // prijem udalosti na tomto FS, viz kody udalosti FSE_XXX; 'param' je parametr udalosti + // receipt of event on this FS, see codes of events FSE_XXX; 'param' is parameter of event virtual void WINAPI Event(int event, DWORD param) = 0; - // uvolneni vsech prostredku FS krome dat listingu (behem volani teto metody se listing - // jeste muze zobrazovat v panelu); vola se tesne pred zrusenim listingu v panelu - // (listing se rusi jen u aktivnich FS, odpojene FS listing nemaji) a CloseFS pro tento FS; - // 'parent' je parent pripadnych messageboxu, probiha-li critical shutdown (vice viz - // CSalamanderGeneralAbstract::IsCriticalShutdown), zadna okna nezobrazovat + // release of all resources of this FS except listing data (during calling of this method + // listing can be displayed in panel); it is called just before deleting listing in panel + // (listing is deleted only for active FS, detached FS do not have listing) and CloseFS + // for this FS; 'parent' is parent of possible messageboxes, if critical shutdown is in + // progress (see CSalamanderGeneralAbstract::IsCriticalShutdown for more information), + // no windows should be displayed virtual void WINAPI ReleaseObject(HWND parent) = 0; - // ziskani mnoziny podporovanych sluzeb FS (viz konstanty FS_SERVICE_XXX); vraci logicky - // soucet konstant; vola se po otevreni tohoto FS (viz CPluginInterfaceForFSAbstract::OpenFS), - // a pak po kazdem volani ChangePath a ListCurrentPath tohoto FS + // getting a set of services supported by FS (see constants FS_SERVICE_XXX); it returns + // logical sum of constants; it is called after opening of this FS (see CPluginInterfaceForFSAbstract::OpenFS), + // and then after every call of ChangePath and ListCurrentPath of this FS virtual DWORD WINAPI GetSupportedServices() = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETCHANGEDRIVEORDISCONNECTITEM: - // ziskani polozky pro tento FS (aktivni nebo odpojeny) do Change Drive menu (Alt+F1/F2) - // nebo Disconnect dialogu (hotkey: F12; pripadny disconnect tohoto FS zajisti metoda - // CPluginInterfaceForFSAbstract::DisconnectFS; pokud GetChangeDriveOrDisconnectItem vrati - // FALSE a FS je v panelu, prida se polozka s ikonou ziskanou pres GetFSIcon a root cestou); - // je-li navratova hodnota TRUE, prida se polozka s ikonou 'icon' a textem 'title'; - // 'fsName' je aktualni jmeno FS; je-li 'icon' NULL, nema polozka ikonu; je-li - // 'destroyIcon' TRUE a 'icon' neni NULL, uvolni se 'icon' po pouziti pres Win32 API - // funkci DestroyIcon; 'title' je text alokovany na heapu Salamandera a muze obsahovat - // az tri sloupce vzajemne oddelene '\t' (viz Alt+F1/F2 menu), v Disconnect dialogu se - // pouziva jen druhy sloupec; je-li navratova hodnota FALSE, jsou navratove hodnoty - // 'title', 'icon' a 'destroyIcon' ignorovany (neprida se polozka) + // only if GetSupportedServices() also returns FS_SERVICE_GETCHANGEDRIVEORDISCONNECTITEM: + // getting item for this FS (active or detached) for Change Drive menu (Alt+F1/F2) or + // Disconnect dialog (hotkey: F12; possible disconnect of this FS is ensured by method + // CPluginInterfaceForFSAbstract::DisconnectFS; if GetChangeDriveOrDisconnectItem returns + // FALSE and FS is in panel, item with icon obtained by GetFSIcon and root path is added); + // if return value is TRUE, item with icon 'icon' and text 'title' is added; 'fsName' is + // current name of FS; if 'icon' is NULL, item has no icon; if 'destroyIcon' is TRUE and + // 'icon' is not NULL, 'icon' is freed after using it by Win32 API function DestroyIcon; + // 'title' is text allocated on Salamander heap and can contain up to three columns + // separated by '\t' (see Alt+F1/F2 menu), in Disconnect dialog only second column is used; + // if return value is FALSE, return values 'title', 'icon' and 'destroyIcon' are ignored + // (item is not added) virtual BOOL WINAPI GetChangeDriveOrDisconnectItem(const char* fsName, char*& title, HICON& icon, BOOL& destroyIcon) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETFSICON: - // ziskani ikony FS pro directory-line toolbaru nebo pripadne pro Disconnect dialog (F12); - // ikona pro Disconnect dialog se zde ziskava jen pokud pro tento FS metoda - // GetChangeDriveOrDisconnectItem nevraci polozku (napr. RegEdit a WMobile); - // vraci ikonu nebo NULL pokud se ma pouzit standardni ikona; je-li 'destroyIcon' TRUE - // a vraci ikonu (ne NULL), uvolni se vracena ikona po pouziti pres Win32 API - // funkci DestroyIcon - // Pozor: pokud je resource ikonky nacitane pomoci LoadIcon v rozmerech 16x16, vrati LoadIcon - // ikonku 32x32. Pri jejim naslednem kresleni do 16x16 vzniknou kolem ikonky barevne - // kontury. Konverzi 16->32->16 lze predejit pouzitim LoadImage: - // (HICON)LoadImage(DLLInstance, MAKEINTRESOURCE(id), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); + // only if GetSupportedServices() also returns FS_SERVICE_GETFSICON: + // getting icon of FS for toolbar directory line or possibly for Disconnect dialog (F12); + // icon for Disconnect dialog is obtained only if for this FS method GetChangeDriveOrDisconnectItem + // does not return item (for example RegEdit and WMobile); it returns icon or NULL if + // standard icon should be used; if 'destroyIcon' is TRUE and returns icon (not NULL), + // returned icon is freed after using it by Win32 API function DestroyIcon + // Caution: if resource of icon is loaded using LoadIcon in size 16x16, LoadIcon returns + // 32x32 icon; when drawing it to 16x16, color contours are created around the icon; + // conversion 16->32->16 can be avoided by using LoadImage: + // (HICON)LoadImage(DLLInstance, MAKEINTRESOURCE(id), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); // - // v teto metode se nesmi zobrazovat zadna okna (obsah panelu neni konzistentni, nesmi - // se distribuovat zpravy - prekresleni, atd.) + // no windows can be displayed in this method (content of panel is not consistent, no + // messages can be distributed - repainting, etc.) virtual HICON WINAPI GetFSIcon(BOOL& destroyIcon) = 0; - // vraci pozadovany drop-effect pro drag&drop operaci z FS (muze byt i tento FS) do tohoto FS; - // 'srcFSPath' je zdrojova cesta; 'tgtFSPath' je cilova cesta (je z tohoto FS); 'allowedEffects' - // obsahuje povolene drop-effecty; 'keyState' je stav klaves (kombinace flagu MK_CONTROL, - // MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON a MK_RBUTTON, viz IDropTarget::Drop); - // 'dropEffect' obsahuje doporucene drop-effecty (rovno 'allowedEffects' nebo omezeno na - // DROPEFFECT_COPY nebo DROPEFFECT_MOVE pokud uzivatel drzi klavesy Ctrl nebo Shift) a - // vraci se v nem zvoleny drop-effect (DROPEFFECT_COPY, DROPEFFECT_MOVE nebo DROPEFFECT_NONE); - // pokud metoda 'dropEffect' nezmeni a ten obsahuje vic efektu, provede se prednostni vyber - // Copy operace + // returns requested drop-effect for drag&drop operation from FS (can be this FS) to this FS; + // 'srcFSPath' is source path; 'tgtFSPath' is target path (is from this FS); 'allowedEffects' + // contains allowed drop-effects; 'keyState' is state of keys (combination of flags MK_CONTROL, + // MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON and MK_RBUTTON, see IDropTarget::Drop); + // 'dropEffect' contains recommended drop-effects (equal to 'allowedEffects' or limited to + // DROPEFFECT_COPY or DROPEFFECT_MOVE if user holds Ctrl or Shift keys) and returns selected + // drop-effect (DROPEFFECT_COPY, DROPEFFECT_MOVE or DROPEFFECT_NONE); if method 'dropEffect' + // does not change 'dropEffect' and it contains more effects, priority selection of Copy + // operation is performed virtual void WINAPI GetDropEffect(const char* srcFSPath, const char* tgtFSPath, DWORD allowedEffects, DWORD keyState, DWORD* dropEffect) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETFREESPACE: - // vraci v 'retValue' (nesmi byt NULL) velikost volneho mista na FS (zobrazuje se - // vpravo na directory-line); pokud volne misto nelze zjistit, vraci - // CQuadWord(-1, -1) (udaj se nezobrazuje) + // only if GetSupportedServices() also returns FS_SERVICE_GETFREESPACE: + // returns size of free space on FS in 'retValue' (must not be NULL) (displayed on right + // in directory line); if free space cannot be obtained, returns CQuadWord(-1, -1) (value + // is not displayed) virtual void WINAPI GetFSFreeSpace(CQuadWord* retValue) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETNEXTDIRLINEHOTPATH: - // nalezeni delicich bodu v textu Directory Line (pro zkracovani cesty pomoci mysi - hot-tracking); - // 'text' je text v Directory Line (cesta + pripadne filter); 'pathLen' je delka cesty v 'text' - // (zbytek je filtr); 'offset' je offset znaku, od ktereho se ma hledat delici bod; vraci TRUE - // pokud dalsi delici bod existuje, jeho pozici vraci v 'offset'; vraci FALSE pokud zadny dalsi - // delici bod neexistuje (konec textu neni povazovan za delici bod) + // only if GetSupportedServices() also returns FS_SERVICE_GETNEXTDIRLINEHOTPATH: + // finding separating points in text of Directory Line (for shortening of path using mouse + // - hot-tracking); 'text' is text in Directory Line (path + possibly filter); 'pathLen' + // is length of path in 'text' (rest is filter); 'offset' is offset of character from which + // to find separating point; returns TRUE if next separating point exists, its position + // is returned in 'offset', returns FALSE if no next separating point exists (end of text + // is not considered as separating point) virtual BOOL WINAPI GetNextDirectoryLineHotPath(const char* text, int pathLen, int& offset) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETNEXTDIRLINEHOTPATH: - // uprava textu zkracene cesty, ktera se ma zobrazit v panelu (Directory Line - zkracovani - // cesty pomoci mysi - hot-tracking); pouziva se pokud hot-text z Directory Line neodpovida - // presne ceste (napr. mu chybi koncova zavorka - VMS cesty na FTP - "[DIR1.DIR2.DIR3]"); - // 'path' je in/out buffer s cestou (velikost bufferu je 'pathBufSize') + // only if GetSupportedServices() also returns FS_SERVICE_GETNEXTDIRLINEHOTPATH: + // modification of the text of shortened path which is displayed in panel (Directory Line + // - shortening of path using mouse - hot-tracking); used if hot-text from Directory Line + // does not exactly correspond to the path (for example it lacks closing bracket - VMS + // paths on FTP - "[DIR1.DIR2.DIR3]"); 'path' is in/out buffer with path (size of buffer + // is 'pathBufSize') virtual void WINAPI CompleteDirectoryLineHotPath(char* path, int pathBufSize) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETPATHFORMAINWNDTITLE: - // ziskani textu, ktery se zobrazi v titulku hlavniho okna pokud je zapnute zobrazovani - // aktualni cesty v titulku hlavniho okna (viz Configuration/Appearance/Display current - // path...); 'fsName' je aktualni jmeno FS; je-li 'mode' 1, jde o rezim - // "Directory Name Only" (ma se zobrazit jen jmeno aktualniho adresare - posledni - // komponenty cesty); je-li 'mode' 2, jde o rezim "Shortened Path" (ma se zobrazit - // zkracena forma cesty - root (vc. oddelovace cesty) + "..." + oddelovac - // cesty + posledni komponenta cesty); 'buf' je buffer o velikosti 'bufSize' pro - // vysledny text; vraci TRUE pokud vraci pozadovany text; vraci FALSE pokud se - // ma text vytvorit na zaklade udaju o delicich bodech ziskanych pres metodu + // only if GetSupportedServices() also returns FS_SERVICE_GETPATHFORMAINWNDTITLE: + // getting text which is displayed in title of main window if displaying of current path + // in title of main window is enabled (see Configuration/Appearance/Display current path...); + // 'fsName' is current name of FS; if 'mode' is 1, it is "Directory Name Only" mode (only + // name of current directory - last component of path - is displayed); if 'mode' is 2, it + // is "Shortened Path" mode (shortened form of path is displayed - root (including path + // separator) + "..." + path separator + last component of path); 'buf' is buffer of size + // 'bufSize' for result text; returns TRUE if it returns requested text; returns FALSE if + // the text should be created using information about separating points obtained by method // GetNextDirectoryLineHotPath() - // POZNAMKA: pokud GetSupportedServices() nevraci i FS_SERVICE_GETPATHFORMAINWNDTITLE, - // zobrazuje se v titulku hlavniho okna plna cesta na FS ve vsech rezimech - // zobrazovani titulku (i v "Directory Name Only" a "Shortened Path") + // NOTE: if GetSupportedServices() does not return FS_SERVICE_GETPATHFORMAINWNDTITLE, + // full path on FS is displayed in title of main window in all display modes + // (including "Directory Name Only" and "Shortened Path") virtual BOOL WINAPI GetPathForMainWindowTitle(const char* fsName, int mode, char* buf, int bufSize) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_SHOWINFO: - // zobrazi dialog s informacemi o FS (volne misto, kapacita, jmeno, moznosti, atd.); - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent zobrazovaneho dialogu + // only if GetSupportedServices() also returns FS_SERVICE_SHOWINFO: + // show dialog with information about FS (free space, capacity, name, options, etc.); + // 'fsName' is current name of FS; 'parent' is proposed parent of displayed dialog virtual void WINAPI ShowInfoDialog(const char* fsName, HWND parent) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_COMMANDLINE: - // spusti prikaz pro FS v aktivnim panelu z prikazove radky pod panely; vraci FALSE pri chybe - // (prikaz se nevklada do historie prikazove radky a ostatni navratove hodnoty se ignoruji); - // vraci TRUE pri uspesnem spusteni prikazu (pozor: na vysledcich prikazu nezalezi - dulezite - // je jen jestli byl spusteny (napr. u FTP jde o to, jestli se ho podarilo dorucit serveru)); - // 'parent' je navrzeny parent pripadnych zobrazovanych dialogu; 'command' je buffer - // velikosti SALCMDLINE_MAXLEN+1, ktery na vstupu obsahuje spousteny prikaz (skutecna - // maximalni delka prikazu zavisi na verzi Windows a obsahu promenne prostredi COMSPEC) - // a na vystupu novy obsah prikazove radky (obvykle se jen vycisti na prazdny retezec); - // 'selFrom' a 'selTo' vraci pozici oznaceni v novem obsahu prikazove radky (pokud se shoduji, - // jen se umisti kurzor; je-li vystupem prazdna radka, jsou tyto hodnoty ignorovany) - // POZOR: tato metoda by nemela primo menit cestu v panelu - hrozi uzavreni FS pri chybe cesty - // (metode by prestal existovat ukazatel this) + // only if GetSupportedServices() also returns FS_SERVICE_COMMANDLINE: + // runs command for FS in active panel from command line under panels; returns FALSE on error + // (command is not inserted into command line history and other return values are ignored); + // returns TRUE on successful execution of command (caution: the result of command is not + // important - only if it was executed (for example for FTP it is important if it was + // delivered to server)); 'parent' is proposed parent of possible displayed dialogs; + // 'command' is buffer of size SALCMDLINE_MAXLEN+1, on input it contains executed command + // (real maximal length of command depends on Windows version and content of environment + // variable COMSPEC) and on output it contains new content of command line (usually it is + // only cleared to empty string); 'selFrom' and 'selTo' return position of selection in + // new content of command line (if they are equal, only cursor is placed; if output is + // empty line, these values are ignored) + // CAUTION: this method should not change path in panel directly - closing of FS can occur + // in case of path error ('this' pointer of this method would cease to exist) virtual BOOL WINAPI ExecuteCommandLine(HWND parent, char* command, int& selFrom, int& selTo) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_QUICKRENAME: - // rychle prejmenovani souboru nebo adresare ('isDir' je FALSE/TRUE) 'file' na FS; - // umozni otevrit vlastni dialog pro rychle prejmenovani (parametr 'mode' je 1) - // nebo pouzit standardni dialog (pri 'mode'==1 vrati FALSE a 'cancel' take FALSE, - // pak Salamander otevre standardni dialog a ziskane nove jmeno preda v 'newName' pri - // dalsim volani QuickRename s 'mode'==2); 'fsName' je aktualni jmeno FS; 'parent' je - // navrzeny parent pripadnych zobrazovanych dialogu; 'newName' je nove jmeno pokud - // 'mode'==2; pokud vraci TRUE, v 'newName' se vraci nove jmeno (max. MAX_PATH znaku; - // ne plne jmeno, jen jmeno polozky v panelu) - Salamander se ho pokusi vyfokusit po - // refreshi (o refresh se stara sam FS, napriklad pomoci metody - // CSalamanderGeneralAbstract::PostRefreshPanelFS); pokud vraci FALSE a 'mode'==2, - // vraci se v 'newName' chybne nove jmeno (pripadne nejakym zpusobem upravene - napr. - // uz muze byt aplikovana operacni maska) pokud chce uzivatel prerusit operaci, vraci - // 'cancel' TRUE; vraci-li 'cancel' FALSE, vraci metoda TRUE pri uspesnem dokonceni - // operace, pokud vrati FALSE pri 'mode'==1, ma se otevrit standardni dialog pro - // rychle prejmenovani, pokud vrati FALSE pri 'mode'==2, jde o chybu operace (chybne - // nove jmeno se vraci v 'newName' - znovu se otevre standardni dialog a uzivatel zde - // muze chybne jmeno opravit) + // only if GetSupportedServices() also returns FS_SERVICE_QUICKRENAME: + // quick rename of file or directory ('isDir' is FALSE/TRUE) 'file' on FS; allows to open + // own dialog for quick rename (parameter 'mode' is 1) or to use standard dialog (if 'mode'==1, + // it returns FALSE and 'cancel' is also FALSE, then Salamander opens standard dialog and + // new name is returned in 'newName' in next call of QuickRename with 'mode'==2); 'fsName' + // is current name of FS; 'parent' is proposed parent of possible displayed dialogs; + // 'newName' is new name if 'mode'==2; if it returns TRUE, 'newName' contains new name + // (max. MAX_PATH characters; not full name, only name of item in panel) - Salamander tries + // to focus it after refresh (FS takes care of refresh, for example using method + // CSalamanderGeneralAbstract::PostRefreshPanelFS); if it returns FALSE and 'mode'==2, + // 'newName' contains incorrect new name (possibly modified in some way - for example + // operation mask can be already applied) if user wants to cancel operation, it returns + // 'cancel' TRUE; if 'cancel' is FALSE, method returns TRUE on successful completion of + // operation, if it returns FALSE on 'mode'==1, standard dialog for quick rename should + // be opened, if it returns FALSE on 'mode'==2, it is an error of operation (incorrect + // new name is returned in 'newName' - standard dialog is opened again and user can correct + // incorrect name) virtual BOOL WINAPI QuickRename(const char* fsName, int mode, HWND parent, CFileData& file, BOOL isDir, char* newName, BOOL& cancel) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_ACCEPTSCHANGENOTIF: - // prijem informace o zmene na ceste 'path' (je-li 'includingSubdirs' TRUE, tak - // zahrnuje i zmenu v podadresarich cesty 'path'); tato metoda by mela rozhodnout - // jestli je treba provest refresh tohoto FS (napriklad pomoci metody - // CSalamanderGeneralAbstract::PostRefreshPanelFS); tyka se jak aktivnich FS, tak - // odpojenych FS; 'fsName' je aktualni jmeno FS - // POZNAMKA: pro plugin jako celek existuje metoda - // CPluginInterfaceAbstract::AcceptChangeOnPathNotification() + // only if GetSupportedServices() also returns FS_SERVICE_ACCEPTSCHANGENOTIF: + // receipt of information about change on path 'path' (if 'includingSubdirs' is TRUE, it + // includes also change in subdirectories of path 'path'); this method should decide if + // it is necessary to refresh this FS (for example using method + // CSalamanderGeneralAbstract::PostRefreshPanelFS); it concerns both active FS and detached + // FS; 'fsName' is current name of FS + // NOTE: for plugin as a whole there is method + // CPluginInterfaceAbstract::AcceptChangeOnPathNotification() virtual void WINAPI AcceptChangeOnPathNotification(const char* fsName, const char* path, BOOL includingSubdirs) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_CREATEDIR: - // vytvoreni noveho adresare na FS; umozni otevrit vlastni dialog pro vytvoreni - // adresare (parametr 'mode' je 1) nebo pouzit standardni dialog (pri 'mode'==1 vrati - // FALSE a 'cancel' take FALSE, pak Salamander otevre standardni dialog a ziskane jmeno - // adresare preda v 'newName' pri dalsim volani CreateDir s 'mode'==2); - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent pripadnych zobrazovanych - // dialogu; 'newName' je jmeno noveho adresare pokud 'mode'==2; pokud vraci TRUE, - // v 'newName' se vraci jmeno noveho adresare (max. 2 * MAX_PATH znaku; ne plne jmeno, - // jen jmeno polozky v panelu) - Salamander se ho pokusi vyfokusit po refreshi (o refresh - // se stara sam FS, napriklad pomoci metody CSalamanderGeneralAbstract::PostRefreshPanelFS); - // pokud vraci FALSE a 'mode'==2, vraci se v 'newName' chybne jmeno adresare (max. 2 * MAX_PATH - // znaku, pripadne upravene na absolutni tvar); pokud chce uzivatel prerusit operaci, - // vraci 'cancel' TRUE; vraci-li 'cancel' FALSE, vraci metoda TRUE pri uspesnem dokonceni - // operace, pokud vrati FALSE pri 'mode'==1, ma se otevrit standardni dialog pro vytvoreni - // adresare, pokud vrati FALSE pri 'mode'==2, jde o chybu operace (chybne jmeno - // adresare se vraci v 'newName' - znovu se otevre standardni dialog a uzivatel - // zde muze chybne jmeno opravit) + // only if GetSupportedServices() also returns FS_SERVICE_CREATEDIR: + // creation of new directory on FS; allows to open own dialog for creation of directory + // (parameter 'mode' is 1) or to use standard dialog (if 'mode'==1, it returns FALSE and + // 'cancel' is also FALSE, then Salamander opens standard dialog and new name is returned + // in 'newName' in next call of CreateDir with 'mode'==2); 'fsName' is current name of FS; + // 'parent' is proposed parent of possible displayed dialogs; 'newName' is new name if + // 'mode'==2; if it returns TRUE, 'newName' contains new name (max. 2 * MAX_PATH characters; + // not full name, only name of item in panel) - Salamander tries to focus it after refresh + // (FS takes care of refresh, for example using method CSalamanderGeneralAbstract::PostRefreshPanelFS); + // if it returns FALSE and 'mode'==2, 'newName' contains incorrect new name (max. 2 * MAX_PATH + // characters, possibly modified to absolute form) if user wants to cancel operation, it + // returns 'cancel' TRUE; if 'cancel' is FALSE, method returns TRUE on successful completion + // of operation, if it returns FALSE on 'mode'==1, standard dialog for creation of directory + // should be opened, if it returns FALSE on 'mode'==2, it is an error of operation (incorrect + // new name is returned in 'newName' - standard dialog is opened again and user can correct + // incorrect name) virtual BOOL WINAPI CreateDir(const char* fsName, int mode, HWND parent, char* newName, BOOL& cancel) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_VIEWFILE: - // prohlizeni souboru (adresare nelze prohlizet pres funkci View) 'file' na aktualni ceste - // na FS; 'fsName' je aktualni jmeno FS; 'parent' je parent pripadnych messageboxu - // s chybami; 'salamander' je sada metod ze Salamandera potrebnych pro implementaci - // prohlizeni s cachovanim + // only if GetSupportedServices() also returns FS_SERVICE_VIEWFILE: + // viewing of file 'file' (directory cannot be viewed using the function View) on the current + // path on FS; 'fsName' is current name of FS; 'parent' is parent of possible messageboxes + // with errors; 'salamander' is set of methods from Salamander necessary for implementation + // of viewing with caching virtual void WINAPI ViewFile(const char* fsName, HWND parent, CSalamanderForViewFileOnFSAbstract* salamander, CFileData& file) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_DELETE: - // mazani souboru a adresaru oznacenych v panelu; umozni otevrit vlastni dialog s dotazem - // na mazani (parametr 'mode' je 1; jestli se ma nebo nema zobrazit dotaz zavisi na hodnote - // SALCFG_CNFRMFILEDIRDEL - TRUE znamena, ze uzivatel chce potvrzovat mazani) - // nebo pouzit standardni dotaz (pri 'mode'==1 vrati FALSE a 'cancelOrError' take FALSE, - // pak Salamander otevre standardni dotaz (pokud je SALCFG_CNFRMFILEDIRDEL TRUE) - // a v pripade kladne odpovedi znovu zavola Delete s 'mode'==2); 'fsName' je aktualni jmeno FS; - // 'parent' je navrzeny parent pripadnych zobrazovanych dialogu; 'panel' identifikuje panel - // (PANEL_LEFT nebo PANEL_RIGHT), ve kterem je otevrene FS (z tohoto panelu se ziskavaji - // soubory/adresare, ktere se maji mazat); 'selectedFiles' + 'selectedDirs' - pocet oznacenych - // souboru a adresaru, pokud jsou obe hodnoty nulove, maze se soubor/adresar pod kurzorem - // (fokus), pred volanim metody Delete jsou bud oznacene soubory a adresare nebo je alespon - // fokus na souboru/adresari, takze je vzdy s cim pracovat (zadne dalsi testy nejsou treba); - // pokud vraci TRUE a 'cancelOrError' je FALSE, operace probehla korektne a oznacene - // soubory/adresare se maji odznacit (pokud prezily mazani); pokud chce uzivatel prerusit - // operaci nebo nastane chyba vraci se 'cancelOrError' TRUE a nedojde k odznaceni - // souboru/adresaru; pokud vraci FALSE pri 'mode'==1 a 'cancelOrError' je FALSE, ma se - // otevrit standardni dotaz na mazani + // only if GetSupportedServices() also returns FS_SERVICE_DELETE: + // deletion of files and directories selected in panel; allows to open own dialog for + // confirmation of deletion (parameter 'mode' is 1; if it should or should not be displayed + // depends on value of SALCFG_CNFRMFILEDIRDEL - TRUE means that user wants to confirm deletion) + // or to use standard dialog (if 'mode'==1, it returns FALSE and 'cancelOrError' is also + // FALSE, then Salamander opens standard question (if SALCFG_CNFRMFILEDIRDEL is TRUE) and + // in case of positive answer calls Delete with 'mode'==2); 'fsName' is current name of FS; + // 'parent' is proposed parent of possible displayed dialogs; 'panel' identifies panel + // (PANEL_LEFT or PANEL_RIGHT) in which FS is opened (files and directories to delete are + // obtained from this panel); 'selectedFiles' + 'selectedDirs' - number of selected files + // and directories, if both values are zero, file/directory under cursor (focus) is deleted, + // before calling method Delete, either files and directories are selected or at least + // focus is on file/directory, so there is always something to work with (no other tests + // are necessary); if it returns TRUE and 'cancelOrError' is FALSE, operation was successful + // and selected files and directories should be deselected (if they survived deletion); + // if user wants to cancel operation or error occurs, 'cancelOrError' returns TRUE and + // files and directories won't be deselected; if it returns FALSE on 'mode'==1 and + // 'cancelOrError' is FALSE, standard question for deletion should be opened virtual BOOL WINAPI Delete(const char* fsName, int mode, HWND parent, int panel, int selectedFiles, int selectedDirs, BOOL& cancelOrError) = 0; - // kopirovani/presun z FS (parametr 'copy' je TRUE/FALSE), v dalsim textu se mluvi jen o - // kopirovani, ale vse plati shodne i pro presun; 'copy' muze byt TRUE (kopirovani) jen - // pokud GetSupportedServices() vraci i FS_SERVICE_COPYFROMFS; 'copy' muze byt FALSE - // (presun nebo prejmenovani) jen pokud GetSupportedServices() vraci i FS_SERVICE_MOVEFROMFS; + // copy/move from FS (parameter 'copy' is TRUE/FALSE), in the rest of text only copying + // is mentioned, but everything is the same for moving; 'copy' can be TRUE (copying) only + // if GetSupportedServices() returns FS_SERVICE_COPYFROMFS; 'copy' can be FALSE (moving + // or renaming) only if GetSupportedServices() returns FS_SERVICE_MOVEFROMFS as well; // - // kopirovani souboru a adresaru (z FS) oznacenych v panelu; umozni otevrit vlastni dialog pro - // zadani cile kopirovani (parametr 'mode' je 1) nebo pouzit standardni dialog (vrati FALSE - // a 'cancelOrHandlePath' take FALSE, pak Salamander otevre standardni dialog a ziskanou cilovou - // cestu preda v 'targetPath' pri dalsim volani CopyOrMoveFromFS s 'mode'==2); pri 'mode'==2 - // je 'targetPath' presne retezec zadany uzivatelem (CopyOrMoveFromFS si ho muze rozanalyzovat - // po svem); pokud CopyOrMoveFromFS podporuje jen windowsove cilove cesty (nebo nedokaze - // zpracovat uzivatelem zadanou cestu - napr. vede na jiny FS nebo do archivu), muze vyuzit - // standardni zpusob zpracovani cesty v Salamanderovi (zatim umi zpracovat jen windowsove cesty, - // casem mozna zpracuje i FS a archivove cesty pres TEMP adresar pomoci sledu nekolika zakladnich - // operaci) - vrati FALSE, 'cancelOrHandlePath' TRUE a 'operationMask' TRUE/FALSE - // (podporuje/nepodporuje operacni masky - pokud nepodporuje a v ceste je maska, zobrazi se - // chybova hlaska), pak Salamander zpracuje cestu vracenou v 'targetPath' (zatim jen rozdeleni - // windowsove cesty na existujici cast, neexistujici cast a pripadne masku; umozni take vytvorit - // podadresare z neexistujici casti) a je-li cesta v poradku, zavola znovu CopyOrMoveFromFS - // s 'mode'==3 a v 'targetPath' s cilovou cestou a pripadne i s operacni maskou (dva retezce - // vzajemne oddelene nulou; zadna maska -> dve nuly na konci retezce), pokud je v ceste nejaka - // chyba, zavola znovu CopyOrMoveFromFS s 'mode'==4 v 'targetPath' s upravenou chybnou cilovou - // cestou (chyba uz byla uzivateli ohlasena; uzivatel by mel dostat moznost cestu opravit; - // v ceste mohly byt odstraneny "." a "..", atp.); + // copying of files and directories (from FS) marked in panel; allows to open own dialog + // for entering target path (parameter 'mode' is 1) or to use standard dialog (returns + // FALSE and 'cancelOrHandlePath' is also FALSE, then Salamander opens standard dialog + // and passes the obtained target path in 'targetPath' in next call of CopyOrMoveFromFS + // with 'mode'==2); for 'mode'==2, 'targetPath' is a string entered by user (CopyOrMoveFromFS + // can analyze it on its own); if CopyOrMoveFromFS supports only windows target paths + // (or cannot process user-entered path - for example it leads to another FS or to archive), + // it can use standard processing of path in Salamander (currently it can process only + // windows paths, in the future it can process FS and archive paths using TEMP directory + // and sequence of basic operations) - it returns FALSE, 'cancelOrHandlePath' TRUE and + // 'operationMask' TRUE/FALSE (supports/does not support operation masks - if it does not + // support operation masks and there is an operation mask in path, error message is displayed), + // then Salamander processes path returned in 'targetPath' (currently only splitting of + // windows path to existing part, non-existing part and possible mask; it also allows to + // create subdirectories from non-existing part) and if the path is correct, it calls + // CopyOrMoveFromFS again with 'mode'==3 and in 'targetPath' with target path and possibly + // also with operation mask (two strings separated by zero; no mask -> two zeros at the + // end of string), if there is some error in path, it calls CopyOrMoveFromFS again with + // 'mode'==4 in 'targetPath' with corrected incorrect target path (error was already + // reported to user; user should be allowed to correct the path; "." and ".." can be + // removed from path, etc.); // - // pokud uzivatel zada operaci drag&dropem (dropne soubory/adresare z FS do stejneho panelu - // nebo do jineho drop-targetu), je 'mode'==5 a v 'targetPath' je cilova cesta operace (muze - // byt windowsova cesta, FS cesta a do budoucna se da pocitat i s cestami do archivu), - // 'targetPath' je ukoncena dvema nulami (pro kompatibilitu s 'mode'==3); 'dropTarget' je - // v tomto pripade okno drop-targetu (vyuziva se pro reaktivaci drop-targetu po otevreni - // progress-okna operace, viz CSalamanderGeneralAbstract::ActivateDropTarget); pri 'mode'==5 ma - // smysl jen navratova hodnota TRUE; + // if user executes the operation using drag&drop (drops files/directories from FS to + // panel or to another drop-target), 'mode'==5 and 'targetPath' contains target path + // (can be windows path, FS path or in the future also path to archive), 'targetPath' + // is terminated by two zeros (for compatibility with 'mode'==3); 'dropTarget' is in + // this case window of drop-target (it is used for reactivation of drop-target after + // opening of progress window of operation, see CSalamanderGeneralAbstract::ActivateDropTarget); + // for 'mode'==5, only return value TRUE makes sense; // - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent pripadnych zobrazovanych dialogu; - // 'panel' identifikuje panel (PANEL_LEFT nebo PANEL_RIGHT), ve kterem je otevreny FS (z tohoto - // panelu se ziskavaji soubory/adresare, ktere se maji kopirovat); - // 'selectedFiles' + 'selectedDirs' - pocet oznacenych souboru a adresaru, pokud jsou - // obe hodnoty nulove, kopiruje se soubor/adresar pod kurzorem (fokus), pred volanim - // metody CopyOrMoveFromFS jsou bud oznacene soubory a adresare nebo je alespon fokus - // na souboru/adresari, takze je vzdy s cim pracovat (zadne dalsi testy - // nejsou treba); na vstupu 'targetPath' pri 'mode'==1 obsahuje navrzenou cilovou cestu - // (jen windowsove cesty bez masky nebo prazdny retezec), pri 'mode'==2 obsahuje retezec - // cilove cesty zadany uzivatelem ve standardnim dialogu, pri 'mode'==3 obsahuje cilovou - // cestu a masku (oddelene nulou), pri 'mode'==4 obsahuje chybnou cilovou cestu, pri 'mode'==5 - // obsahuje cilovou cestu (windowsovou, FS nebo do archivu) ukoncenou dvema nulami; pokud - // metoda vraci FALSE, obsahuje 'targetPath' na vystupu (buffer 2 * MAX_PATH znaku) pri - // 'cancelOrHandlePath'==FALSE navrzenou cilovou cestu pro standardni dialog a pri - // 'cancelOrHandlePath'==TRUE retezec cilove cesty ke zpracovani; pokud metoda vraci TRUE a - // 'cancelOrHandlePath' FALSE, obsahuje 'targetPath' jmeno polozky, na kterou ma prejit fokus - // ve zdrojovem panelu (buffer 2 * MAX_PATH znaku; ne plne jmeno, jen jmeno polozky v panelu; - // je-li prazdny retezec, fokus zustava beze zmeny); 'dropTarget' neni NULL jen v pripade - // zadani cesty operace pomoci drag&dropu (viz popis vyse) + // 'fsName' is current name of FS; 'parent' is proposed parent of possible displayed dialogs; + // 'panel' identifies panel (PANEL_LEFT or PANEL_RIGHT) in which FS is opened (files and + // directories to copy are obtained from this panel); 'selectedFiles' + 'selectedDirs' - + // number of selected files and directories, if both values are zero, file/directory under + // cursor (focus) is copied, before calling method CopyOrMoveFromFS, either files and + // directories are selected or at least focus is on file/directory, so there is always + // something to work with (no other tests are necessary); on input 'targetPath' in 'mode'==1 + // contains proposed target path (only windows path without mask or empty string), in 'mode'==2 + // contains target path entered by user in standard dialog, in 'mode'==3 contains target path + // and mask (separated by zero), in 'mode'==4 contains incorrect target path, in 'mode'==5 + // contains target path (Windows, FS or archive) terminated by two zeros; if the method + // returns FALSE, 'targetPath' on output (buffer 2 * MAX_PATH characters) with + // 'cancelOrHandlePath'==FALSE contains proposed target path for standard dialog and with + // 'cancelOrHandlePath'==TRUE contains target path for processing; if the method returns + // TRUE and 'cancelOrHandlePath' is FALSE, 'targetPath' contains name of item to which + // focus should be moved in source panel (buffer 2 * MAX_PATH characters; not full name, + // only name of item in panel; if it is empty string, focus remains unchanged); 'dropTarget' + // is not NULL only if path was entered using drag&drop (see above) // - // pokud vraci TRUE a 'cancelOrHandlePath' je FALSE, operace probehla korektne a oznacene - // soubory/adresare se maji odznacit; pokud chce uzivatel prerusit operaci nebo nastala - // chyba, vraci metoda TRUE a 'cancelOrHandlePath' TRUE, v obou pripadech nedojde k odznaceni - // souboru/adresaru; pokud vraci FALSE, ma se otevrit standardni dialog ('cancelOrHandlePath' - // je FALSE) nebo se ma standardnim zpusobem zpracovat cesta ('cancelOrHandlePath' je TRUE) + // if it returns TRUE and 'cancelOrHandlePath' is FALSE, operation was successful and + // selected files and directories should be deselected; if user wants to cancel operation + // or error occurs, the method returns TRUE and 'cancelOrHandlePath' is TRUE, in both + // cases files and directories won't be deselected; if it returns FALSE, a standard dialog + // should be opened ('cancelOrHandlePath' is FALSE) or path should be processed in standard + // way ('cancelOrHandlePath' is TRUE) // - // POZNAMKA: pokud je nabizena moznost kopirovat/presouvat na cestu do ciloveho panelu, - // je treba volat CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath pro cilovy - // panel, jinak nebude cesta v tomto panelu vlozena do seznamu pracovnich - // adresaru - List of Working Directories (Alt+F12) + // NOTE: if the option to copy/paste to target panel path is offered, it is necessary to + // call CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath for target panel + // otherwise the path in this panel will not be inserted into List of Working Directories + // (Alt+F12) virtual BOOL WINAPI CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HWND parent, int panel, int selectedFiles, int selectedDirs, char* targetPath, BOOL& operationMask, BOOL& cancelOrHandlePath, HWND dropTarget) = 0; - // kopirovani/presun z windowsove cesty na FS (parametr 'copy' je TRUE/FALSE), v dalsim textu - // se mluvi jen o kopirovani, ale vse plati shodne i pro presun; 'copy' muze byt TRUE (kopirovani) - // jen pokud GetSupportedServices() vraci i FS_SERVICE_COPYFROMDISKTOFS; 'copy' muze byt FALSE - // (presun nebo prejmenovani) jen pokud GetSupportedServices() vraci i FS_SERVICE_MOVEFROMDISKTOFS; + // copying/moving from window path to FS (parameter 'copy' is TRUE/FALSE), in the following + // text only copying is mentioned, but everything is the same for moving; 'copy' can be TRUE + // (copying) only if GetSupportedServices() returns FS_SERVICE_COPYFROMDISKTOFS as well; 'copy' + // can be FALSE (moving or renaming) only if GetSupportedServices() returns FS_SERVICE_MOVEFROMDISKTOFS; + // + // copying selected (in panel or elsewhere) files and directories to FS; in 'mode'==1, it + // allows preparing text of target path for user in standard dialog for copying, this is the + // case when the source panel (panel where the copying is started (F5 key)) has windows path + // and the target panel has this FS; in 'mode'==2 and 'mode'==3, the plugin can perform + // copying or report one of two errors: "error in path" (for example it contains invalid + // characters or does not exist) and "this operation cannot be performed in this FS" (for + // example it is FTP, but the opened path in this FS is different from the target path + // (for example different FTP server) - it is necessary to open another/new FS); + // a different/new FS needs to be opened; this error cannot be reported by newly opened FS); // - // kopirovani vybranych (v panelu nebo jinde) souboru a adresaru na FS; pri 'mode'==1 umoznuje - // pripravit text cilove cesty pro uzivatele do standardniho dialogu pro kopirovani, jde o situaci, - // kdy je ve zdrojovem panelu (panel, kde dojde ke spusteni prikazu Copy (klavesa F5)) windowsova - // cesta a v cilovem panelu tento FS; pri 'mode'==2 a 'mode'==3 muze plugin provest operaci kopirovani nebo - // ohlasit jednu ze dvou chyb: "chyba v ceste" (napr. obsahuje nepripustne znaky nebo neexistuje) - // a "v tomto FS nelze provest pozadovanou operaci" (napr. jde sice o FTP, ale otevrena cesta - // v tomto FS je rozdilna od cilove cesty (napr. u FTP jiny FTP server) - je potreba otevrit - // jiny/novy FS; tuto chybu nemuze ohlasit nove otevreny FS); - // POZOR: tato metoda se muze zavolat pro jakoukoliv cilovou FS cestu tohoto pluginu (muze tedy - // jit i o cestu s jinym jmenem FS tohoto pluginu) + // CAUTION: this method can be called for any target FS path of this plugin (it can be + // a path with different name of FS of this plugin) // - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent pripadnych zobrazovanych - // dialogu; 'sourcePath' je zdrojova windowsova cesta (vsechny vybrane soubory a adresare - // jsou adresovany relativne k ni), pri 'mode'==1 je NULL; vybrane soubory a adresare - // jsou zadany enumeracni funkci 'next' jejimz parametrem je 'nextParam', pri 'mode'==1 - // jsou NULL; 'sourceFiles' + 'sourceDirs' - pocet vybranych souboru a adresaru (soucet - // je vzdy nenulovy); 'targetPath' je in/out buffer min. 2 * MAX_PATH znaku pro cilovou - // cestu; pri 'mode'==1 je 'targetPath' na vstupu aktualni cesta na tomto FS a na vystupu cilova - // cesta pro standardni dialog kopirovani; pri 'mode'==2 je 'targetPath' na vstupu uzivatelem - // zadana cilova cesta (bez uprav, vcetne masky, atd.) a na vystupu se ignoruje az na pripad, kdy - // metoda vraci FALSE (chyba) a 'invalidPathOrCancel' TRUE (chyba v ceste), v tomto pripade je na - // vystupu upravena cilova cesta (napr. odstranene "." a ".."), kterou bude uzivatel opravovat - // ve standardnim dialogu kopirovani; pri 'mode'==3 je 'targetPath' na vstupu drag&dropem - // zadana cilova cesta a na vystupu se ignoruje; neni-li 'invalidPathOrCancel' NULL (jen 'mode'==2 - // a 'mode'==3), vraci se v nem TRUE, pokud je cesta spatne zadana (obsahuje nepripustne znaky nebo - // neexistuje, atd.) nebo doslo k preruseni operace (cancel) - chybove/cancel hlaseni se zobrazuje - // pred ukoncenim teto metody + // 'fsName' is the current name of FS; 'parent' is proposed parent of possible displayed + // dialogs; 'sourcePath' is source windows path (all selected files and directories are + // addressed relatively to this it), if 'mode'==1, it is NULL; the selected files and + // directories are specified by enumeration function 'next' with parameter 'nextParam'; + // in 'mode'==1, they are NULL; 'sourceFiles' + 'sourceDirs' - number of selected files + // and directories (sum is always non-zero); 'targetPath' is in/out buffer for target path + // (min. 2 * MAX_PATH characters); in 'mode'==1, 'targetPath' on input is current path + // in this FS and on output is proposed target path for standard dialog; in 'mode'==2, + // 'targetPath' on input is target path entered by user (without any changes, including + // mask, etc.) and on output it is ignored, except for the case when the method returns + // FALSE (error) and 'invalidPathOrCancel' is TRUE (error in path), in this case 'targetPath' + // on output is modified target path (for example "." and ".." are removed) and user should + // correct it in standard dialog; in 'mode'==3, 'targetPath' on input is target path specified + // by drag&drop and on output it is ignored; if 'invalidPathOrCancel' is not NULL (only + // 'mode'==2 and 'mode'==3), it returns TRUE if the path is incorrectly entered (contains + // invalid characters or does not exist, etc.) or the operation was canceled (cancel) - error + // message/cancel message is displayed before the end of this method; // - // pri 'mode'==1 vraci metoda TRUE pri uspechu, pokud vraci FALSE, pouzije se jako cilova cesta - // pro standardni dialog kopirovani prazdny retezec; pokud vraci metoda FALSE pri 'mode'==2 a 'mode'==3, - // ma se pro zpracovani operace hledat jiny FS (je-li 'invalidPathOrCancel' FALSE) nebo ma - // uzivatel opravit cilovou cestu (je-li 'invalidPathOrCancel' TRUE); pokud vraci metoda TRUE - // pri 'mode'==2 nebo 'mode'==3, operace probehla a ma dojit k odznaceni vybranych souboru a adresaru - // (je-li 'invalidPathOrCancel' FALSE) nebo doslo k chybe/preruseni operace a nema dojit - // k odznaceni vybranych souboru a adresaru (je-li 'invalidPathOrCancel' TRUE) + // in 'mode'==1, the method returns TRUE for success, if it returns FALSE, and empty string + // is used as target path for standard copy dialog; if the method returns FALSE in 'mode'==2 + // or 'mode'==3, other FS should be searched for processing of the operation (if 'invalidPathOrCancel' + // is FALSE) or user should correct target path (if 'invalidPathOrCancel' is TRUE); if the method + // returns TRUE in 'mode'==2 or 'mode'==3, the operation was successful and selected files + // and directories should be deselected (if 'invalidPathOrCancel' is FALSE) or an error/cancel + // of the operation occurred and selected files and directories should not be deselected + // (if 'invalidPathOrCancel' is TRUE) // - // POZOR: Metoda CopyOrMoveFromDiskToFS se muze volat ve trech situacich: - // - tento FS je aktivni v panelu - // - tento FS je odpojeny - // - tento FS prave vzniknul (volanim OpenFS) a po ukonceni metody zase ihned zanikne - // (volanim CloseFS) - nebyla od nej volana zadna jina metoda (ani ChangePath) + // CAUTION: CopyOrMoveFromDiskToFS method can be called in three situations: + // - this FS is active in panel + // - this FS is detached + // - this FS has just been created (by calling OpenFS) and after the end of the + // method it will immediately disappear again (by calling CloseFS) - no other + // method (including ChangePath) was called from it virtual BOOL WINAPI CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsName, HWND parent, const char* sourcePath, SalEnumSelection2 next, void* nextParam, int sourceFiles, int sourceDirs, char* targetPath, BOOL* invalidPathOrCancel) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_CHANGEATTRS: - // zmena atributu souboru a adresaru oznacenych v panelu; dialog se zadanim zmen atributu - // ma kazdy plugin vlastni; - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent vlastniho dialogu; 'panel' - // identifikuje panel (PANEL_LEFT nebo PANEL_RIGHT), ve kterem je otevrene FS (z tohoto - // panelu se ziskavaji soubory/adresare, se kterymi se pracuje); - // 'selectedFiles' + 'selectedDirs' - pocet oznacenych souboru a adresaru, - // pokud jsou obe hodnoty nulove, pracuje se se souborem/adresarem pod kurzorem - // (fokus), pred volanim metody ChangeAttributes jsou bud oznacene soubory a adresare nebo - // je alespon fokus na souboru/adresari, takze je vzdy s cim pracovat (zadne dalsi testy - // nejsou treba); pokud vraci TRUE, operace probehla korektne a oznacene soubory/adresare - // se maji odznacit; pokud chce uzivatel prerusit operaci nebo nastane chyba, vraci metoda - // FALSE a nedojde k odznaceni souboru/adresaru + // only if GetSupportedServices() also returns FS_SERVICE_CHANGEATTRS: + // changing of attributes of files and directories selected in panel; each plugin has its + // own dialog for specifying attributes changes; + // 'fsName' is current name of FS; 'parent' is proposed parent for the custom dialog; + // 'panel' identifies panel (PANEL_LEFT or PANEL_RIGHT) in which FS is opened (files and + // directories to work with are obtained from this panel); + // 'selectedFiles' + 'selectedDirs' - number of selected files and directories, if both + // values are zero, file/directory under cursor (focus) is used, before calling method + // ChangeAttributes, either files and directories are selected or at least focus is on + // file/directory, so there is always something to work with (no other tests are necessary); + // if it returns TRUE, operation was successful and selected files and directories should + // be deselected; if user wants to cancel operation or error occurs, it returns FALSE and + // files and directories won't be deselected virtual BOOL WINAPI ChangeAttributes(const char* fsName, HWND parent, int panel, int selectedFiles, int selectedDirs) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_SHOWPROPERTIES: - // zobrazeni okna s vlastnostmi souboru a adresaru oznacenych v panelu; okno s vlastnostmi - // ma kazdy plugin vlastni; - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent vlastniho okna - // (Windowsove okno s vlastnostmi je nemodalni - pozor: nemodalni okno musi - // mit vlastni thread); 'panel' identifikuje panel (PANEL_LEFT nebo PANEL_RIGHT), - // ve kterem je otevrene FS (z tohoto panelu se ziskavaji soubory/adresare, - // se kterymi se pracuje); 'selectedFiles' + 'selectedDirs' - pocet oznacenych - // souboru a adresaru, pokud jsou obe hodnoty nulove, pracuje se se souborem/adresarem - // pod kurzorem (fokus), pred volanim metody ShowProperties jsou bud oznacene - // soubory a adresare nebo je alespon fokus na souboru/adresari, takze je vzdy - // s cim pracovat (zadne dalsi testy nejsou treba) + // only if GetSupportedServices() also returns FS_SERVICE_SHOWPROPERTIES: + // displaying of properties of files and directories selected in panel; each plugin has its + // own dialog for displaying properties; + // 'fsName' is current name of FS; 'parent' is proposed parent for the custom dialog; + // (Windows dialog with properties is non-modal - caution: non-modal dialog must have + // its own thread); 'panel' identifies panel (PANEL_LEFT or PANEL_RIGHT) in which FS is + // opened (files and directories to work with are obtained from this panel); + // 'selectedFiles' + 'selectedDirs' - number of selected files and directories, if both + // values are zero, file/directory under cursor (focus) is used, before calling method + // ShowProperties, either files and directories are selected or at least focus is on + // file/directory, so there is always something to work with (no other tests are necessary) virtual void WINAPI ShowProperties(const char* fsName, HWND parent, int panel, int selectedFiles, int selectedDirs) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_CONTEXTMENU: - // zobrazeni kontextoveho menu pro soubory a adresare oznacene v panelu (kliknuti pravym - // tlacitkem mysi na polozkach v panelu) nebo pro aktualni cestu v panelu (kliknuti pravym - // tlacitkem mysi na change-drive tlacitku v panelove toolbare) nebo pro panel (kliknuti - // pravym tlacitkem mysi za polozkami v panelu); kontextove menu ma kazdy plugin vlastni; + // only if GetSupportedServices() also returns FS_SERVICE_CONTEXTMENU: + // displaying of context menu for files and directories selected in panel (right mouse + // button click on items in panel) or for current path in panel (right mouse button click + // on change-drive button in panel toolbar) or for panel (right mouse button click behind + // items in panel); each plugin has its own context menu; // - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent kontextoveho menu; - // 'menuX' + 'menuY' jsou navrzene souradnice leveho horniho rohu kontextoveho menu; - // 'type' je typ kontextoveho menu (viz popisy konstant fscmXXX); 'panel' - // identifikuje panel (PANEL_LEFT nebo PANEL_RIGHT), pro ktery se ma kontextove - // menu otevrit (z tohoto panelu se ziskavaji soubory/adresare/cesta, se kterymi - // se pracuje); pri 'type'==fscmItemsInPanel je 'selectedFiles' + 'selectedDirs' - // pocet oznacenych souboru a adresaru, pokud jsou obe hodnoty nulove, pracuje se se - // souborem/adresarem pod kurzorem (focusem), pred volanim metody ContextMenu jsou bud - // oznacene soubory a adresare (a bylo na nich kliknuto) nebo je alespon fokus na - // souboru/adresari (neni na updiru), takze je vzdy s cim pracovat (zadne dalsi testy - // nejsou treba); pokud 'type'!=fscmItemsInPanel, 'selectedFiles' + 'selectedDirs' - // jsou vzdy nastaveny na nulu (ignoruji se) + // 'fsName' is current name of FS; 'parent' is proposed parent for the context menu; + // 'menuX' + 'menuY' are proposed coordinates of left upper corner of context menu; + // 'type' is type of context menu (see descriptions of constants fscmXXX); 'panel' + // identifies panel (PANEL_LEFT or PANEL_RIGHT) for which context menu should be opened + // (files/directory/path are obtained from this panel); for 'type'==fscmItemsInPanel, + // 'selectedFiles' + 'selectedDirs' are number of selected files and directories, if both + // values are zero, file/directory under cursor (focus) is used, before calling method + // ContextMenu, either files and directories are selected (and user clicked on them) or + // at least focus is on file/directory (not on updir), so there is always something to + // work with (no other tests are necessary); if 'type'!=fscmItemsInPanel, 'selectedFiles' + // + 'selectedDirs' are always set to zero (they are ignored) virtual void WINAPI ContextMenu(const char* fsName, HWND parent, int menuX, int menuY, int type, int panel, int selectedFiles, int selectedDirs) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_CONTEXTMENU: - // pokud je v panelu otevreny FS a dorazi nektera ze zprav WM_INITPOPUP, WM_DRAWITEM, - // WM_MENUCHAR nebo WM_MEASUREITEM, zavola Salamander HandleMenuMsg, aby pluginu - // umoznil pracovat s IContextMenu2 a IContextMenu3 - // plugin vraci TRUE v pripade, ze zpravu zpracoval a FALSE jindy + // only if GetSupportedServices() also returns FS_SERVICE_CONTEXTMENU: + // if there is FS opened in panel and WM_INITPOPUP, WM_DRAWITEM, WM_MENUCHAR or WM_MEASUREITEM + // message arrives, Salamander calls HandleMenuMsg to allow plugin to work with + // IContextMenu2 and IContextMenu3; + // plugin returns TRUE if it processesed the message and FALSE otherwise virtual BOOL WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plResult) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_OPENFINDDLG: - // otevreni Find dialogu pro FS v panelu; 'fsName' je aktualni jmeno FS; 'panel' identifikuje - // panel (PANEL_LEFT nebo PANEL_RIGHT), pro ktery se ma otevrit Find dialog (z tohoto panelu - // se ziskava obvykle cesta pro hledani); vraci TRUE pri uspesnem otevreni Find dialogu; - // pokud vrati FALSE, Salamander otevre standardni Find Files and Directories dialog + // only if GetSupportedServices() also returns FS_SERVICE_OPENFINDDLG: + // opening of Find dialog for FS in panel; 'fsName' is current name of FS; 'panel' identifies + // panel (PANEL_LEFT or PANEL_RIGHT) for which Find dialog should be opened (the path for + // searching is usually obtained from this panel); returns TRUE on successful opening of + // Find dialog; if it returns FALSE, Salamander opens standard Find Files and Directories + // dialog virtual BOOL WINAPI OpenFindDialog(const char* fsName, int panel) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_OPENACTIVEFOLDER: - // otevre okno Explorera pro aktualni cestu v panelu - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent zobrazovaneho dialogu + // only if GetSupportedServices() also returns FS_SERVICE_OPENACTIVEFOLDER: + // opens Explorer window for current path in panel; 'fsName' is current name of FS; + // 'parent' is proposed parent for displayed dialog virtual void WINAPI OpenActiveFolder(const char* fsName, HWND parent) = 0; - // jen pokud GetSupportedServices() vraci FS_SERVICE_MOVEFROMFS nebo FS_SERVICE_COPYFROMFS: - // dovoluje ovlivnit povolene drop-effecty pri drag&dropu z tohoto FS; neni-li 'allowedEffects' - // NULL, obsahuje na vstupu dosud povolene drop-effecty (kombinace DROPEFFECT_MOVE a DROPEFFECT_COPY), - // na vystupu obsahuje drop-effecty povolene timto FS (effecty by se mely jen ubirat); - // 'mode' je 0 pri volani, ktere tesne predchazi zahajeni drag&drop operace, effecty vracene - // v 'allowedEffects' se pouziji pro volani DoDragDrop (tyka se cele drag&drop operace); - // 'mode' je 1 behem tazeni mysi nad FS z tohoto procesu (muze byt toto FS nebo FS z druheho - // panelu); pri 'mode' 1 je v 'tgtFSPath' cilova cesta, ktera se pouzije pokud dojde k dropu, - // jinak je 'tgtFSPath' NULL; 'mode' je 2 pri volani, ktere tesne nasleduje po dokonceni - // drag&drop operace (uspesnemu i neuspesnemu) + // only if GetSupportedServices() returns FS_SERVICE_MOVEFROMFS nebo FS_SERVICE_COPYFROMFS: + // allows to influence allowed drop-effects during drag&drop from this FS; if 'allowedEffects' + // is not NULL, it contains on input allowed drop-effects (combination of DROPEFFECT_MOVE + // and DROPEFFECT_COPY), on output it contains drop-effects allowed by this FS (effects + // should only be removed); 'mode' is 0 during call which immediately precedes start of + // drag&drop operation, effects returned in 'allowedEffects' are used for call of DoDragDrop + // (it concerns whole drag&drop operation); 'mode' is 1 during dragging of mouse over FS + // from this process (it can be this FS or FS from other panel); for 'mode'==1, 'tgtFSPath' + // is target path which is used if drop occurs, otherwise 'tgtFSPath' is NULL; 'mode' is 2 + // during call which immediately follows end of drag&drop operation (successful or not) virtual void WINAPI GetAllowedDropEffects(int mode, const char* tgtFSPath, DWORD* allowedEffects) = 0; - // umoznuje pluginu zmenit standardni hlaseni "There are no items in this panel." zobrazovane - // v situaci, kdy v panelu neni zadna polozka (soubor/adresar/up-dir); vraci FALSE pokud - // se ma pouzit standardni hlaseni (navratova hodnota 'textBuf' se pak ignoruje); vraci TRUE - // pokud plugin v 'textBuf' (buffer o velikosti 'textBufSize' znaku) vraci svou alternativu - // teto hlasky + // allows plugin to modify standard message "There are no items in this panel." displayed + // in situation when there is no item (file/directory/up-dir) in panel; returns FALSE if + // standard message should be used (return value 'textBuf' is ignored); returns TRUE if + // plugin returns its own alternative of this message in 'textBuf' (buffer of size + // 'textBufSize' characters) virtual BOOL WINAPI GetNoItemsInPanelText(char* textBuf, int textBufSize) = 0; - // jen pokud GetSupportedServices() vraci FS_SERVICE_SHOWSECURITYINFO: - // uzivatel kliknul na ikone zabezpeceni (viz CSalamanderGeneralAbstract::ShowSecurityIcon; - // napr. FTPS zobrazi dialog s certifikatem serveru); 'parent' je navrzeny parent dialogu + // only if GetSupportedServices() returns FS_SERVICE_SHOWSECURITYINFO: + // used clicked security icon (see CSalamanderGeneralAbstract::ShowSecurityIcon; + // for example FTPS shows dialog with server certificate); 'parent' is proposed + // parent of displayed dialog virtual void WINAPI ShowSecurityInfo(HWND parent) = 0; - /* zbyva dokoncit: + /* to be finished: // calculate occupied space on FS (Alt+F10 + Ctrl+Shift+F10 + calc. needed space + spacebar key in panel) #define FS_SERVICE_CALCULATEOCCUPIEDSPACE // edit from FS (F4) @@ -771,123 +780,123 @@ class CPluginFSInterfaceAbstract class CPluginInterfaceForFSAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginInterfaceForFSEncapsulation) +private: // protection against incorrect calling of methods (see CPluginInterfaceForFSEncapsulation) friend class CPluginInterfaceForFSEncapsulation; #else // INSIDE_SALAMANDER public: #endif // INSIDE_SALAMANDER - // funkce pro "file system"; vola se pro otevreni FS; 'fsName' je jmeno FS, - // ktery se ma otevrit; 'fsNameIndex' je index jmena FS, ktery se ma otevrit - // (index je nula pro fs-name zadane v CSalamanderPluginEntryAbstract::SetBasicPluginData, - // u ostatnich fs-name index vraci CSalamanderPluginEntryAbstract::AddFSName); - // vraci ukazatel na interface otevreneho FS CPluginFSInterfaceAbstract nebo - // NULL pri chybe + // function for "file system"; called for opening FS; 'fsName' is name of FS to open; + // 'fsNameIndex' is index of FS name to open (index is zero for FS name specified in + // CSalamanderPluginEntryAbstract::SetBasicPluginData, for other FS names index is + // returned by CSalamanderPluginEntryAbstract::AddFSName); returns pointer to interface + // of opened FS CPluginFSInterfaceAbstract or NULL on error virtual CPluginFSInterfaceAbstract* WINAPI OpenFS(const char* fsName, int fsNameIndex) = 0; - // funkce pro "file system", vola se pro uzavreni FS, 'fs' je ukazatel na - // interface otevreneho FS, po tomto volani uz je v Salamanderu interface 'fs' - // povazovan za neplatny a nebude dale pouzivan (funkce paruje s OpenFS) - // POZOR: v teto metode nesmi dojit k otevreni zadneho okna ani dialogu - // (okna lze otevirat v metode CPluginFSInterfaceAbstract::ReleaseObject) + // function for "file system", called after closing FS; 'fs' is interface of closed FS, + // after this call 'fs' interface is considered invalid in Salaamnder and will not be + // used anymore (function pairs with OpenFS) + // CAUTION: in this method it openinig of any window or dialog is not allowed + // (windows can be opened in method CPluginFSInterfaceAbstract::ReleaseObject) virtual void WINAPI CloseFS(CPluginFSInterfaceAbstract* fs) = 0; - // provedeni prikazu na polozce pro FS v Change Drive menu nebo v Drive barach - // (jeji pridani viz CSalamanderConnectAbstract::SetChangeDriveMenuItem); - // 'panel' identifikuje panel, se kterym mame pracovat - pro prikaz z Change Drive - // menu je 'panel' vzdy PANEL_SOURCE (toto menu muze byt vybaleno jen u aktivniho - // panelu), pro prikaz z Drive bary muze byt PANEL_LEFT nebo PANEL_RIGHT (pokud - // jsou zapnute dve Drive bary, muzeme pracovat i s neaktivnim panelem) + // performing command on an item for FS in Change Drive menu or in Drive bar + // (its addition see CSalamanderConnectAbstract::SetChangeDriveMenuItem); + // 'panel' identifies panel which we will work with - for command from Change Drive menu + // 'panel' is always PANEL_SOURCE (this menu can be opened only in active panel), for command + // from Drive bars 'panel' can be PANEL_LEFT or PANEL_RIGHT (if two Drive bars are enabled, + // we can work also with inactive panel) virtual void WINAPI ExecuteChangeDriveMenuItem(int panel) = 0; - // otevreni kontextoveho menu na polozce pro FS v Change Drive menu nebo v Drive - // barach nebo pro aktivni/odpojeny FS v Change Drive menu; 'parent' je parent - // kontextoveho menu; 'x' a 'y' jsou souradnice pro vybaleni kontextoveho menu - // (misto kliknuti praveho tlacitka mysi nebo navrzene souradnice pri Shift+F10); - // je-li 'pluginFS' NULL jde o polozku pro FS, jinak je 'pluginFS' interface - // aktivniho/odpojeneho FS ('isDetachedFS' je FALSE/TRUE); neni-li 'pluginFS' - // NULL, je v 'pluginFSName' jmeno FS otevreneho v 'pluginFS' (jinak je v - // 'pluginFSName' NULL) a v 'pluginFSNameIndex' index jmena FS otevreneho - // v 'pluginFS' (pro snazsi detekci o jake jmeno FS jde; jinak je v - // 'pluginFSNameIndex' -1); pokud vrati FALSE, jsou ostatni navratove hodnoty - // ignorovany, jinak maji tento vyznam: v 'refreshMenu' vraci TRUE pokud se ma - // provest obnova Change Drive menu (pro Drive bary se ignoruje, protoze se na - // nich neukazuji aktivni/odpojene FS); v 'closeMenu' vraci TRUE pokud se ma - // zavrit Change Drive menu (pro Drive bary neni co zavirat); vraci-li 'closeMenu' - // TRUE a 'postCmd' neni nula, je po zavreni Change Drive menu (pro Drive bary - // ihned) jeste zavolano ExecuteChangeDrivePostCommand s parametry 'postCmd' - // a 'postCmdParam'; 'panel' identifikuje panel, se kterym mame pracovat - pro - // kontextove menu v Change Drive menu je 'panel' vzdy PANEL_SOURCE (toto menu - // muze byt vybaleno jen u aktivniho panelu), pro kontextove menu v Drive barach - // muze byt PANEL_LEFT nebo PANEL_RIGHT (pokud jsou zapnute dve Drive bary, muzeme - // pracovat i s neaktivnim panelem) + // opening of context menu on item for FS in Change Drive menu or in Drive bar + // or for active/detached FS in Change Drive menu; 'parent' is parent of the context menu; + // 'x' and 'y' are coordinates for opening of the context menu (place of right mouse button + // click or proposed coordinates for Shift+F10); if 'pluginFS' is NULL, it is FS item, + // otherwise 'pluginFS' is interface of active/detached FS (see 'isDetachedFS'); if 'pluginFS' is + // not NULL, 'pluginFSName' is name of FS opened in 'pluginFS' (otherwise 'pluginFSName' is NULL); + // 'pluginFSNameIndex' is index of FS name in 'pluginFS' (for easier detection of FS name; + // otherwise 'pluginFSNameIndex' is -1); if the method returns FALSE, other return values + // are ignored, otherwise they have the following meaning: 'refreshMenu' returns TRUE if + // Change Drive menu should be refreshed (for Drive bars it is ignored, because active/detached + // FS are not displayed on them); 'closeMenu' returns TRUE if Change Drive menu should be + // closed (for Drive bars there is nothing to close); if 'closeMenu' is TRUE and 'postCmd' + // is not NULL, after closing of Change Drive menu (for Drive bars immediately) method + // ExecuteChangeDrivePostCommand is called with parameters 'postCmd' and 'postCmdParam'; + // 'panel' identifies panel which we will work with - for context menu in Change Drive menu + // 'panel' is always PANEL_SOURCE (this menu can be opened only in active panel), for context + // menu in Drive bars 'panel' can be PANEL_LEFT or PANEL_RIGHT (if two Drive bars are enabled, + // we can work also with inactive panel) virtual BOOL WINAPI ChangeDriveMenuItemContextMenu(HWND parent, int panel, int x, int y, CPluginFSInterfaceAbstract* pluginFS, const char* pluginFSName, int pluginFSNameIndex, BOOL isDetachedFS, BOOL& refreshMenu, BOOL& closeMenu, int& postCmd, void*& postCmdParam) = 0; - // provedeni prikazu z kontextoveho menu na polozce pro FS nebo pro aktivni/odpojeny FS v - // Change Drive menu az po zavreni Change Drive menu nebo provedeni prikazu z kontextoveho - // menu na polozce pro FS v Drive barach (jen pro kompatibilitu s Change Drive menu); vola - // se jako reakce na navratove hodnoty 'closeMenu' (TRUE), 'postCmd' a 'postCmdParam' - // ChangeDriveMenuItemContextMenu po zavreni Change Drive menu (pro Drive bary ihned); - // 'panel' identifikuje panel, se kterym mame pracovat - pro kontextove menu v Change Drive - // menu je 'panel' vzdy PANEL_SOURCE (toto menu muze byt vybaleno jen u aktivniho panelu), - // pro kontextove menu v Drive barach muze byt PANEL_LEFT nebo PANEL_RIGHT (pokud jsou - // zapnute dve Drive bary, muzeme pracovat i s neaktivnim panelem) + // performing command from context menu on item for FS or for active/detached FS in Change + // Drive menu only after closing Change Drive menu or performing command from context menu + // on item for FS in Drive bars (for compatibility with Change Drive menu only); called + // as a reaction to return values 'closeMenu' (TRUE), 'postCmd' and 'postCmdParam' from + // ChangeDriveMenuItemContextMenu after closing Change Drive menu (for Drive bars immediately); + // 'panel' identifies panel which we will work with - for context menu in Change Drive menu + // 'panel' is always PANEL_SOURCE (this menu can be opened only in active panel), for context + // menu in Drive bars 'panel' can be PANEL_LEFT or PANEL_RIGHT (if two Drive bars are enabled, + // we can work also with inactive panel) virtual void WINAPI ExecuteChangeDrivePostCommand(int panel, int postCmd, void* postCmdParam) = 0; - // provede spusteni polozky v panelu s otevrenym FS (napr. reakce na klavesu Enter v panelu; - // u podadresaru/up-diru (o up-dir jde pokud je jmeno ".." a zaroven jde o prvni adresar) - // se predpoklada zmena cesty, u souboru otevreni kopie souboru na disku s tim, ze se pripadne - // zmeny nactou zpet na FS); spousteni neni mozne provest v metode FS interfacu, protoze tam - // nelze volat metody pro zmenu cesty (muze v nich totiz dojit i k zavreni FS); - // 'panel' urcuje panel, ve kterem probiha spousteni (PANEL_LEFT nebo PANEL_RIGHT); - // 'pluginFS' je interface FS otevreneho v panelu; 'pluginFSName' je jmeno FS otevreneho - // v panelu; 'pluginFSNameIndex' je index jmena FS otevreneho v panelu (pro snazsi detekci - // o jake jmeno FS jde); 'file' je spousteny soubor/adresar/up-dir ('isDir' je 0/1/2); - // POZOR: volani metody pro zmenu cesty v panelu muze zneplatnit 'pluginFS' (po zavreni FS) - // a 'file'+'isDir' (zmena listingu v panelu -> zruseni polozek puvodniho listingu) - // POZNAMKA: pokud se spousti soubor nebo se s nim jinak pracuje (napr. downloadi se), - // je treba volat CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath pro panel - // 'panel', jinak nebude cesta v tomto panelu vlozena do seznamu pracovnich - // adresaru - List of Working Directories (Alt+F12) + // performs execustion of the item of panel with opened FS (e.g. reaction to pressing of + // Enter key in panel; for subdirectory/up-dir (up-dir means both that the name is ".." and it + // is the first directory) it is supposed that path will be changed, for file a copy of the + // file on disk will be opened with possible loading of changes from FS); execution cannot + // be performed in FS interface, because it is not possible to call methods for changing + // path there (closing of FS can occur there); 'panel' identifies panel in which execution + // is performed (PANEL_LEFT or PANEL_RIGHT); 'pluginFS' is interface of FS opened in panel; + // 'pluginFSName' is name of FS opened in panel; 'pluginFSNameIndex' is index of FS name + // in 'pluginFS' (for easier detection of FS name); 'file' is executed file/directory/up-dir + // ('isDir' is 0/1/2); + // CAUTION: calling of method for changing path in panel can invalidate 'pluginFS' (after + // closing of FS) and 'file'+'isDir' (change of listing in panel -> deletion of + // items of original listing) + // NOTE: if file is executed or otherwise worked with (e.g. downloaded), it is necessary + // to call CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath for panel 'panel', + // otherwise the path in this panel will not be inserted into List of Working Directories + // (Alt+F12) virtual void WINAPI ExecuteOnFS(int panel, CPluginFSInterfaceAbstract* pluginFS, const char* pluginFSName, int pluginFSNameIndex, CFileData& file, int isDir) = 0; - // provede disconnect FS, o ktery zadazal uzivatel v Disconnect dialogu; 'parent' je - // parent pripadnych messageboxu (jde o stale jeste otevreny Disconnect dialog); - // disconnect neni mozne provest v metode FS interfacu, protoze FS ma zaniknout; - // 'isInPanel' je TRUE pokud je FS v panelu, pak 'panel' urcuje ve kterem panelu - // (PANEL_LEFT nebo PANEL_RIGHT); 'isInPanel' je FALSE pokud je FS odpojeny, pak je - // 'panel' 0; 'pluginFS' je interface FS; 'pluginFSName' je jmeno FS; 'pluginFSNameIndex' - // je index jmena FS (pro snazsi detekci o jake jmeno FS jde); metoda vraci FALSE, - // pokud se disconnect nepodaril a Disconnect dialog ma zustat otevreny (jeho obsah - // se obnovi, aby se projevily predchozi uspesne disconnecty) + // disconnects FS, requested by user in Disconnect dialog; 'parent' is parent + // of possible messageboxes (it is still opened Disconnect dialog); disconnect + // cannot be performed in FS interface method, because FS has to disappear; + // 'isInPanel' is TRUE if FS is in panel, then 'panel' identifies panel + // (PANEL_LEFT or PANEL_RIGHT); 'isInPanel' is FALSE if FS is detached, then + // 'panel' is 0; 'pluginFS' is interface of FS; 'pluginFSName' is name of FS; + // 'pluginFSNameIndex' is index of FS name (for easier detection of FS name); + // method returns FALSE if disconnect was not successful and Disconnect dialog + // should remain opened (its content is refreshed to show previous successful + // disconnects) virtual BOOL WINAPI DisconnectFS(HWND parent, BOOL isInPanel, int panel, CPluginFSInterfaceAbstract* pluginFS, const char* pluginFSName, int pluginFSNameIndex) = 0; - // prevadi user-part cesty v bufferu 'fsUserPart' (velikost MAX_PATH znaku) z externiho - // na interni format (napr. u FTP: interni format = cesty jak s nimi pracuje server, - // externi format = URL format = cesty obsahuji hex-escape-sekvence (napr. "%20" = " ")) + // converts user-part paths in buffer 'fsUserPart' (size MAX_PATH characters) from + // external to internal format (for example for FTP: internal format = paths as used + // by server, external format = URL format = paths contain hex-escape-sequences + // (for example "%20" = " ")) virtual void WINAPI ConvertPathToInternal(const char* fsName, int fsNameIndex, char* fsUserPart) = 0; - // prevadi user-part cesty v bufferu 'fsUserPart' (velikost MAX_PATH znaku) z interniho - // na externi format + // converts user-part paths in buffer 'fsUserPart' (size MAX_PATH characters) from + // internal to external format virtual void WINAPI ConvertPathToExternal(const char* fsName, int fsNameIndex, char* fsUserPart) = 0; - // tato metoda se vola jen u pluginu, ktery slouzi jako nahrada za Network polozku - // v Change Drive menu a v Drive barach (viz CSalamanderGeneralAbstract::SetPluginIsNethood()): - // Salamander volanim teto metody informuje plugin, ze uzivatel meni cestu z rootu UNC - // cesty "\\server\share" pres symbol up-diru ("..") do pluginoveho FS na cestu s - // user-part "\\server" v panelu 'panel' (PANEL_LEFT nebo PANEL_RIGHT); ucel teto metody: - // plugin by mel bez cekani vylistovat na teto ceste aspon tento jeden share, aby mohlo - // dojit k jeho fokusu v panelu (coz je bezne chovani pri zmene cesty pres up-dir) + // this method is only called for the plugin which is used as replacement for Network + // item in Change Drive menu and in Drive bars (see CSalamanderGeneralAbstract::SetPluginIsNethood); + // By this call, Salamander informs the plugin that user is changing path from root UNC + // path "\\server\share" through symbol of up-dir ("..") to plugin FS path with user-part + // "\\server" in panel 'panel' (PANEL_LEFT or PANEL_RIGHT); purpose of this method: + // plugin should without waiting list at least this one share on this path, so it can + // be focused in panel (which is normal behavior when changing path through up-dir) virtual void WINAPI EnsureShareExistsOnServer(int panel, const char* server, const char* share) = 0; }; @@ -898,38 +907,39 @@ class CPluginInterfaceForFSAbstract #pragma option -a #endif // __BORLANDC__ -/* Predbezna verze helpu k pluginovemu interfacu - - Otevreni, zmena, listovani a refresh cesty: - - pro otevreni cesty v novem FS se vola ChangePath (prvni volani ChangePath je vzdy pro otevreni cesty) - - pro zmenu cesty se vola ChangePath (druhe a vsechny dalsi volani ChangePath jsou zmeny cesty) - - pri fatalni chybe ChangePath vraci FALSE (FS cesta se v panelu neotevre, pokud slo - o zmenu cesty, zkusi se nasledne volat ChangePath pro puvodni cestu, pokud ani to nevyjde, - dojde k prechodu na fixed-drive cestu) - - pokud ChangePath vrati TRUE (uspech) a nedoslo ke zkraceni cesty na puvodni (jejiz - listing je prave nacteny), vola se ListCurrentPath pro ziskani noveho listingu - - po uspesnem vylistovani vraci ListCurrentPath TRUE - - pri fatalni chybe vraci ListCurrentPath FALSE a nasledne volani ChangePath - musi take vratit FALSE - - pokud aktualni cesta nejde vylistovat, vraci ListCurrentPath FALSE a nasledne volani - ChangePath musi cestu zmenit a vratit TRUE (zavola se znovu ListCurrentPath), pokud jiz - cestu nejde zmenit (root, atp.), vrati ChangePath take FALSE (FS cesta se v panelu neotevre, - pokud slo o zmenu cesty, zkusi se nasledne volat ChangePath pro puvodni cestu, pokud ani to - nevyjde, dojde k prechodu na fixed-drive cestu) - - refresh cesty (Ctrl+R) se chova stejne jako zmena cesty na aktualni cestu (cesta - se vubec nemusi zmenit nebo se muze zkratit nebo v pripade fatalni chyby zmenit na - fixed-drive); pri refreshi cesty je parametr 'forceRefresh' TRUE pro vsechna volani metod - ChangePath a ListCurrentPath (FS nesmi pouzit pro zmenu cesty ani nacteni listingu zadne - cache - user nechce pouzivat cache); - - Pri pruchodu historii (back/forward) se FS interface, ve kterem probehne vylistovani - FS cesty ('fsName':'fsUserPart'), ziska prvnim moznym zpusobem z nasledujicich: - - FS interface, ve kterem byla cesta naposledy otevrena jeste nebyl zavren - a je mezi odpojenymi nebo je aktivni v panelu (neni aktivni v druhem panelu) - - aktivni FS interface v panelu ('currentFSName') je ze stejneho pluginu jako - 'fsName' a vrati na IsOurPath('currentFSName', 'fsName', 'fsUserPart') TRUE - - prvni z odpojenych FS interfacu ('currentFSName'), ktery je ze stejneho - pluginu jako 'fsName' a vrati na IsOurPath('currentFSName', 'fsName', - 'fsUserPart') TRUE - - novy FS interface +/* Preliminary version of help for plugin interface + + Opening, changing, listing and refreshing of path: + - for opening of path in new FS, ChangePath is called (first call of ChangePath is always + for opening of path) + - for changing of path, ChangePath is called (second and all other calls of ChangePath + are for changing of path) + - for fatal error, ChangePath returns FALSE (FS path is not opened in panel, if it was + for changing of path, original path is tried to be opened again, if it is not possible, + fixed-drive path is opened) + - if ChangePath returns TRUE (success) and path was not shortened to the original one (whose + listing is already loaded), ListCurrentPath is called for obtaining of new listing + - after successful listing, ListCurrentPath returns TRUE + - for fatal error, ListCurrentPath returns FALSE and next call of ChangePath must also + return FALSE + - if current path cannot be listed, ListCurrentPath returns FALSE and next call of ChangePath + must change path and return TRUE (ListCurrentPath is called again), if path cannot be + changed (root, etc.), ChangePath also returns FALSE (FS path is not opened in panel, + if it was for changing of path, ChangePath is called again for original path, if it is + not possible, fixed-drive path is opened) + - refresh of path (Ctrl+R) behaves the same as changing of path to current path (path + does not have to change at all or it can be shortened or in case of fatal error changed + to fixed-drive); for refresh of path, parameter 'forceRefresh' is TRUE for all calls + of methods ChangePath and ListCurrentPath (FS must not use any cache for changing of + path or loading of listing - user does not want to use cache); + + When browsing history (back/forward), FS interface in which listing of FS path + ('fsName':'fsUserPart') is performed is obtained by first possible way from the following: + - FS interface in which path was last opened was not closed yet and is among detached + interfaces or is active in panel (is not active in second panel) + - active FS interface in panel ('currentFSName') is from the same plugin as 'fsName' + and returns TRUE on IsOurPath('currentFSName', 'fsName', 'fsUserPart') + - first of detached FS interfaces ('currentFSName') is from the same plugin as 'fsName' + and returns TRUE on IsOurPath('currentFSName', 'fsName', 'fsUserPart') + - new FS interface */