"Fossies" - the Fresh Open Source Software Archive

Member "src/Main/TextUserInterface.h" (10 Oct 2018, 4009 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "TextUserInterface.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  Derived from source code of TrueCrypt 7.1a, which is
    3  Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
    4  by the TrueCrypt License 3.0.
    5 
    6  Modifications and additions to the original source code (contained in this file)
    7  and all other portions of this file are Copyright (c) 2013-2017 IDRIX
    8  and are governed by the Apache License 2.0 the full text of which is
    9  contained in the file License.txt included in VeraCrypt binary and source
   10  code distribution packages.
   11 */
   12 
   13 #ifndef TC_HEADER_Main_TextUserInterface
   14 #define TC_HEADER_Main_TextUserInterface
   15 
   16 #include "System.h"
   17 #include "Main.h"
   18 #include "UserInterface.h"
   19 
   20 namespace VeraCrypt
   21 {
   22     class TextUserInterface : public UserInterface
   23     {
   24     public:
   25         TextUserInterface ();
   26         virtual ~TextUserInterface ();
   27 
   28         virtual FilePath AskFilePath (const wxString &message = wxEmptyString) const;
   29         virtual shared_ptr <KeyfileList> AskKeyfiles (const wxString &message = L"") const;
   30         virtual shared_ptr <VolumePassword> AskPassword (const wxString &message = L"", bool verify = false) const;
   31         virtual int AskPim (const wxString &message = L"") const;
   32         virtual ssize_t AskSelection (ssize_t optionCount, ssize_t defaultOption = -1) const;
   33         virtual wstring AskString (const wxString &message = wxEmptyString) const;
   34         virtual shared_ptr <VolumePath> AskVolumePath (const wxString &message = L"") const;
   35         virtual bool AskYesNo (const wxString &message, bool defaultYes = false, bool warning = false) const;
   36         virtual void BackupVolumeHeaders (shared_ptr <VolumePath> volumePath) const;
   37         virtual void BeginBusyState () const { }
   38         virtual void ChangePassword (shared_ptr <VolumePath> volumePath = shared_ptr <VolumePath>(), shared_ptr <VolumePassword> password = shared_ptr <VolumePassword>(), int pim = 0, shared_ptr <Hash> currentHash = shared_ptr <Hash>(), bool truecryptMode = false, shared_ptr <KeyfileList> keyfiles = shared_ptr <KeyfileList>(), shared_ptr <VolumePassword> newPassword = shared_ptr <VolumePassword>(), int newPim = 0, shared_ptr <KeyfileList> newKeyfiles = shared_ptr <KeyfileList>(), shared_ptr <Hash> newHash = shared_ptr <Hash>()) const;
   39         virtual void CreateKeyfile (shared_ptr <FilePath> keyfilePath = shared_ptr <FilePath>()) const;
   40         virtual void CreateVolume (shared_ptr <VolumeCreationOptions> options) const;
   41         virtual void DeleteSecurityTokenKeyfiles () const;
   42         virtual void DoShowError (const wxString &message) const;
   43         virtual void DoShowInfo (const wxString &message) const;
   44         virtual void DoShowString (const wxString &str) const;
   45         virtual void DoShowWarning (const wxString &message) const;
   46         virtual void EndBusyState () const { }
   47         virtual void ExportSecurityTokenKeyfile () const;
   48         virtual shared_ptr <GetStringFunctor> GetAdminPasswordRequestHandler ();
   49         virtual void ImportSecurityTokenKeyfiles () const;
   50 #ifndef TC_NO_GUI
   51         virtual bool Initialize (int &argc, wxChar **argv) { return wxAppBase::Initialize(argc, argv); }
   52 #endif
   53         virtual void InitSecurityTokenLibrary () const;
   54         virtual void ListSecurityTokenKeyfiles () const;
   55         virtual VolumeInfoList MountAllDeviceHostedVolumes (MountOptions &options) const;
   56         virtual shared_ptr <VolumeInfo> MountVolume (MountOptions &options) const;
   57         virtual bool OnInit ();
   58 #ifndef TC_NO_GUI
   59         virtual bool OnInitGui () { return true; }
   60 #endif
   61         virtual int OnRun();
   62         virtual void RestoreVolumeHeaders (shared_ptr <VolumePath> volumePath) const;
   63         static void SetTerminalEcho (bool enable);
   64         virtual void UserEnrichRandomPool () const;
   65         virtual void Yield () const { }
   66 
   67     protected:
   68         static void OnSignal (int signal);
   69         virtual void ReadInputStreamLine (wxString &line) const;
   70         virtual wxString ReadInputStreamLine () const;
   71 
   72         auto_ptr <wxFFileInputStream> FInputStream;
   73         auto_ptr <wxTextInputStream> TextInputStream;
   74 
   75     private:
   76         TextUserInterface (const TextUserInterface &);
   77         TextUserInterface &operator= (const TextUserInterface &);
   78     };
   79 
   80     extern wxMessageOutput *DefaultMessageOutput;
   81 }
   82 
   83 #endif // TC_HEADER_Main_TextUserInterface