unrarsrc  6.1.7
About: unrar extracts, views and tests the contents of archives created with the RAR archiver.
  Fossies Dox: unrarsrc-6.1.7.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ui.hpp
Go to the documentation of this file.
1#ifndef _RAR_UI_
2#define _RAR_UI_
3
4// UIERROR_ - error message;
5// UIMSG_ - informational message;
6// UIWAIT_ - message waiting for user confirmation;
7// UIEVENT_ - if simple message is not enough;
8
43
53
56
65};
66
67// Flags for uiAskReplace function.
70};
71
72// Codes returned by uiAskReplace. Note that uiAskReplaceEx returns only
73// UIASKREP_R_REPLACE, UIASKREP_R_SKIP and UIASKREP_R_CANCEL codes.
77};
78
79UIASKREP_RESULT uiAskReplace(wchar *Name,size_t MaxNameSize,int64 FileSize,RarTime *FileTime,uint Flags);
80UIASKREP_RESULT uiAskReplaceEx(RAROptions *Cmd,wchar *Name,size_t MaxNameSize,int64 FileSize,RarTime *FileTime,uint Flags);
81
82void uiInit(SOUND_NOTIFY_MODE Sound);
83
84
85void uiStartArchiveExtract(bool Extract,const wchar *ArcName);
86bool uiStartFileExtract(const wchar *FileName,bool Extract,bool Test,bool Skip);
87void uiExtractProgress(int64 CurFileSize,int64 TotalFileSize,int64 CurSize,int64 TotalSize);
88void uiProcessProgress(const char *Command,int64 CurSize,int64 TotalSize);
89
91bool uiGetPassword(UIPASSWORD_TYPE Type,const wchar *FileName,SecPassword *Password);
93
95void uiAlarm(UIALARM_TYPE Type);
96
97void uiEolAfterMsg();
98
99bool uiAskNextVolume(wchar *VolName,size_t MaxSize);
100#if !defined(SILENT) && !defined(SFX_MODULE)
101void uiAskRepeatRead(const wchar *FileName,bool &Ignore,bool &All,bool &Retry,bool &Quit);
102#endif
103bool uiAskRepeatWrite(const wchar *FileName,bool DiskFull);
104
105#ifndef SFX_MODULE
106const wchar *uiGetMonthName(int Month);
107#endif
108
110{
111 private:
112 static const size_t MAX_MSG = 8;
117 public:
119 {
120 // Init arrays in case a caller passes fewer parameters than expected.
121 for (uint I=0;I<ASIZE(Str);I++)
122 Str[I]=L"";
123 memset(Num,0,sizeof(Num));
124
126 this->Code=Code;
127 }
129 {
130 if (StrSize<MAX_MSG)
131 Str[StrSize++]=s;
132 return *this;
133 }
135 {
136 if (NumSize<MAX_MSG)
137 Num[NumSize++]=n;
138 return *this;
139 }
140
141 void Msg();
142};
143
144
145// Templates recognize usual NULL as integer, not wchar*.
146#define UINULL ((wchar *)NULL)
147
148inline void uiMsg(UIMESSAGE_CODE Code)
149{
150 uiMsgStore Store(Code);
151 Store.Msg();
152}
153
154template<class T1> void uiMsg(UIMESSAGE_CODE Code,T1 a1)
155{
156 uiMsgStore Store(Code);
157 Store<<a1;
158 Store.Msg();
159}
160
161template<class T1,class T2> void uiMsg(UIMESSAGE_CODE Code,T1 a1,T2 a2)
162{
163 uiMsgStore Store(Code);
164 Store<<a1<<a2;
165 Store.Msg();
166}
167
168template<class T1,class T2,class T3> void uiMsg(UIMESSAGE_CODE code,T1 a1,T2 a2,T3 a3)
169{
170 uiMsgStore Store(code);
171 Store<<a1<<a2<<a3;
172 Store.Msg();
173}
174
175#endif
void Msg()
Definition: uiconsole.cpp:89
uint Num[MAX_MSG]
Definition: ui.hpp:114
UIMESSAGE_CODE Code
Definition: ui.hpp:116
uiMsgStore(UIMESSAGE_CODE Code)
Definition: ui.hpp:118
uint NumSize
Definition: ui.hpp:115
uiMsgStore & operator<<(const wchar *s)
Definition: ui.hpp:128
const wchar * Str[MAX_MSG]
Definition: ui.hpp:113
static const size_t MAX_MSG
Definition: ui.hpp:112
uint StrSize
Definition: ui.hpp:115
SOUND_NOTIFY_MODE
Definition: options.hpp:75
#define ASIZE(x)
Definition: rardefs.hpp:10
wchar_t wchar
Definition: rartypes.hpp:13
int64_t int64
Definition: rartypes.hpp:12
unsigned int uint
Definition: rartypes.hpp:8
static byte T1[256][4]
Definition: rijndael.cpp:35
static byte T3[256][4]
Definition: rijndael.cpp:35
static byte T2[256][4]
Definition: rijndael.cpp:35
bool uiAskNextVolume(wchar *VolName, size_t MaxSize)
Definition: uiconsole.cpp:433
UIPASSWORD_TYPE
Definition: ui.hpp:90
@ UIPASSWORD_ARCHIVE
Definition: ui.hpp:90
@ UIPASSWORD_FILE
Definition: ui.hpp:90
@ UIPASSWORD_GLOBAL
Definition: ui.hpp:90
void uiInit(SOUND_NOTIFY_MODE Sound)
Definition: uicommon.cpp:3
bool uiIsGlobalPasswordSet()
Definition: uiconsole.cpp:407
void uiProcessProgress(const char *Command, int64 CurSize, int64 TotalSize)
Definition: uiconsole.cpp:82
void uiAlarm(UIALARM_TYPE Type)
Definition: uiconsole.cpp:413
bool uiGetPassword(UIPASSWORD_TYPE Type, const wchar *FileName, SecPassword *Password)
Definition: uiconsole.cpp:398
UIASKREP_FLAGS
Definition: ui.hpp:68
@ UIASKREP_F_EXCHSRCDEST
Definition: ui.hpp:69
@ UIASKREP_F_NORENAME
Definition: ui.hpp:69
@ UIASKREP_F_SHOWNAMEONLY
Definition: ui.hpp:69
void uiAskRepeatRead(const wchar *FileName, bool &Ignore, bool &All, bool &Retry, bool &Quit)
Definition: uiconsole.cpp:440
UIASKREP_RESULT uiAskReplaceEx(RAROptions *Cmd, wchar *Name, size_t MaxNameSize, int64 FileSize, RarTime *FileTime, uint Flags)
Definition: uicommon.cpp:11
bool uiAskRepeatWrite(const wchar *FileName, bool DiskFull)
Definition: uiconsole.cpp:452
void uiMsg(UIMESSAGE_CODE Code)
Definition: ui.hpp:148
UIASKREP_RESULT uiAskReplace(wchar *Name, size_t MaxNameSize, int64 FileSize, RarTime *FileTime, uint Flags)
Definition: uiconsole.cpp:4
void uiEolAfterMsg()
Definition: uiconsole.cpp:472
UIASKREP_RESULT
Definition: ui.hpp:74
@ UIASKREP_R_RENAME
Definition: ui.hpp:76
@ UIASKREP_R_CANCEL
Definition: ui.hpp:76
@ UIASKREP_R_SKIP
Definition: ui.hpp:75
@ UIASKREP_R_RENAMEAUTO
Definition: ui.hpp:76
@ UIASKREP_R_SKIPALL
Definition: ui.hpp:75
@ UIASKREP_R_REPLACEALL
Definition: ui.hpp:75
@ UIASKREP_R_REPLACE
Definition: ui.hpp:75
@ UIASKREP_R_UNUSED
Definition: ui.hpp:76
const wchar * uiGetMonthName(int Month)
Definition: uiconsole.cpp:461
UIALARM_TYPE
Definition: ui.hpp:94
@ UIALARM_ERROR
Definition: ui.hpp:94
@ UIALARM_INFO
Definition: ui.hpp:94
@ UIALARM_QUESTION
Definition: ui.hpp:94
bool uiStartFileExtract(const wchar *FileName, bool Extract, bool Test, bool Skip)
Definition: uiconsole.cpp:66
UIMESSAGE_CODE
Definition: ui.hpp:9
@ UIMSG_FOUND
Definition: ui.hpp:48
@ UIERROR_STREAMUNKNOWN
Definition: ui.hpp:37
@ UIERROR_ADJUSTVALUE
Definition: ui.hpp:42
@ UIERROR_DICTOUTMEM
Definition: ui.hpp:23
@ UIEVENT_FILESUMEND
Definition: ui.hpp:62
@ UIERROR_SUBHEADERUNKNOWN
Definition: ui.hpp:19
@ UIERROR_NEWERRAR
Definition: ui.hpp:21
@ UIERROR_HLINKCREATE
Definition: ui.hpp:16
@ UIMSG_FIRST
Definition: ui.hpp:44
@ UIERROR_ULINKEXIST
Definition: ui.hpp:40
@ UIERROR_RECVOLLIMIT
Definition: ui.hpp:26
@ UIEVENT_NEWREVFILE
Definition: ui.hpp:64
@ UIERROR_TRUNCPSW
Definition: ui.hpp:42
@ UIEVENT_FILESFOUND
Definition: ui.hpp:60
@ UIEVENT_RRTESTINGSTART
Definition: ui.hpp:63
@ UIMSG_RRFOUND
Definition: ui.hpp:46
@ UIMSG_SECTORNOTRECOVERED
Definition: ui.hpp:48
@ UIEVENT_FILESUMSTART
Definition: ui.hpp:61
@ UIEVENT_CLEARATTRSTART
Definition: ui.hpp:59
@ UIMSG_ANALYZEFILEDATA
Definition: ui.hpp:45
@ UIERROR_DIRSCAN
Definition: ui.hpp:38
@ UIERROR_MEMORY
Definition: ui.hpp:12
@ UIERROR_HEADENCMISMATCH
Definition: ui.hpp:23
@ UIEVENT_CLEARATTRFILE
Definition: ui.hpp:59
@ UIERROR_NOTVOLUME
Definition: ui.hpp:25
@ UIEVENT_NEWARCHIVE
Definition: ui.hpp:64
@ UIERROR_SYSERRMSG
Definition: ui.hpp:10
@ UIERROR_CMTBROKEN
Definition: ui.hpp:29
@ UIERROR_NOZIPSFX
Definition: ui.hpp:35
@ UIERROR_FILEWRITE
Definition: ui.hpp:13
@ UIEVENT_RRTESTINGEND
Definition: ui.hpp:64
@ UIERROR_RECVOLFOUND
Definition: ui.hpp:27
@ UIMSG_BLOCKSRECOVERED
Definition: ui.hpp:46
@ UIERROR_ACLUNKNOWN
Definition: ui.hpp:36
@ UIERROR_NEWRARFORMAT
Definition: ui.hpp:30
@ UIERROR_NOTFIRSTVOLUME
Definition: ui.hpp:26
@ UIERROR_FILECOPY
Definition: ui.hpp:15
@ UIERROR_FILECOPYHINT
Definition: ui.hpp:15
@ UIMSG_BADARCHIVE
Definition: ui.hpp:49
@ UIERROR_DIRCREATE
Definition: ui.hpp:16
@ UIERROR_MODIFYLOCKED
Definition: ui.hpp:25
@ UIMSG_CHECKSUM
Definition: ui.hpp:51
@ UIEVENT_SEARCHDUPFILESSTART
Definition: ui.hpp:58
@ UIERROR_FILERO
Definition: ui.hpp:35
@ UIERROR_RRDAMAGED
Definition: ui.hpp:20
@ UIERROR_MISSINGVOL
Definition: ui.hpp:33
@ UIERROR_OPFAILED
Definition: ui.hpp:28
@ UIERROR_NEEDADMIN
Definition: ui.hpp:17
@ UIEVENT_ERASEDISK
Definition: ui.hpp:61
@ UIEVENT_PROTECTSTART
Definition: ui.hpp:62
@ UIERROR_OLDTOSFX
Definition: ui.hpp:22
@ UIMSG_AREADAMAGED
Definition: ui.hpp:47
@ UIERROR_FILEATTR
Definition: ui.hpp:15
@ UIERROR_UNKNOWNEXTRA
Definition: ui.hpp:33
@ UIERROR_HEADERBROKEN
Definition: ui.hpp:18
@ UIERROR_MHEADERBROKEN
Definition: ui.hpp:18
@ UIMSG_RECVOLFOUND
Definition: ui.hpp:50
@ UIERROR_CHECKSUM
Definition: ui.hpp:11
@ UIERROR_FILESEEK
Definition: ui.hpp:13
@ UIMSG_COPYINGDATA
Definition: ui.hpp:47
@ UIEVENT_TESTADDEDEND
Definition: ui.hpp:63
@ UIMSG_RECVOLCALCCHECKSUM
Definition: ui.hpp:50
@ UIERROR_NOFILESREPAIRED
Definition: ui.hpp:31
@ UIERROR_BADPSW
Definition: ui.hpp:12
@ UIWAIT_DISKFULLNEXT
Definition: ui.hpp:55
@ UIERROR_UNKNOWNENCMETHOD
Definition: ui.hpp:21
@ UIERROR_INCOMPATSWITCH
Definition: ui.hpp:37
@ UIERROR_NOFILESTODELETE
Definition: ui.hpp:32
@ UIMSG_CORRECTINGNAME
Definition: ui.hpp:49
@ UIERROR_UOWNERGETOWNERID
Definition: ui.hpp:39
@ UIERROR_UOWNERGETGROUPID
Definition: ui.hpp:39
@ UIMSG_SKIPENCARC
Definition: ui.hpp:52
@ UIMSG_FAT32SIZE
Definition: ui.hpp:51
@ UIERROR_BADARCHIVE
Definition: ui.hpp:29
@ UIERROR_NOTSFX
Definition: ui.hpp:22
@ UIWAIT_BADPSW
Definition: ui.hpp:55
@ UIERROR_UNEXPEOF
Definition: ui.hpp:28
@ UIERROR_REPAIROLDFORMAT
Definition: ui.hpp:31
@ UIERROR_OPENPRESERVEATIME
Definition: ui.hpp:41
@ UIERROR_MODIFYVOLUME
Definition: ui.hpp:25
@ UIERROR_FILEREAD
Definition: ui.hpp:13
@ UIERROR_RECONSTRUCTING
Definition: ui.hpp:27
@ UIEVENT_PROTECTEND
Definition: ui.hpp:62
@ UIEVENT_TESTADDEDSTART
Definition: ui.hpp:63
@ UIERROR_FILECLOSE
Definition: ui.hpp:13
@ UIMSG_RRDAMAGED
Definition: ui.hpp:46
@ UIERROR_SUBHEADERDATABROKEN
Definition: ui.hpp:20
@ UIERROR_CHECKSUMENC
Definition: ui.hpp:11
@ UIWAIT_FCREATEERROR
Definition: ui.hpp:55
@ UIERROR_READERRCOUNT
Definition: ui.hpp:41
@ UIMSG_BUILD
Definition: ui.hpp:45
@ UIMSG_MISSINGVOL
Definition: ui.hpp:51
@ UIERROR_STREAMBROKEN
Definition: ui.hpp:37
@ UIERROR_FILERENAME
Definition: ui.hpp:14
@ UIERROR_ARCBROKEN
Definition: ui.hpp:17
@ UIEVENT_FIRST
Definition: ui.hpp:57
@ UIERROR_RECVOLCANNOTFIX
Definition: ui.hpp:28
@ UIERROR_PATHTOOLONG
Definition: ui.hpp:38
@ UIERROR_FHEADERBROKEN
Definition: ui.hpp:18
@ UIERROR_ENCRNOTSUPPORTED
Definition: ui.hpp:30
@ UIERROR_NEEDPREVVOL
Definition: ui.hpp:33
@ UIMSG_STRING
Definition: ui.hpp:45
@ UIERROR_ACLBROKEN
Definition: ui.hpp:36
@ UIEVENT_DELADDEDFILE
Definition: ui.hpp:60
@ UIERROR_RECVOLDIFFSETS
Definition: ui.hpp:26
@ UIERROR_UOWNERGET
Definition: ui.hpp:38
@ UIERROR_GENERALERRMSG
Definition: ui.hpp:10
@ UIMSG_SECTORDAMAGED
Definition: ui.hpp:47
@ UIERROR_NOFILESTOEXTRACT
Definition: ui.hpp:32
@ UIERROR_ACLSET
Definition: ui.hpp:36
@ UIERROR_READERRTRUNCATED
Definition: ui.hpp:41
@ UIEVENT_FILESUMPROGRESS
Definition: ui.hpp:61
@ UIERROR_INVALIDNAME
Definition: ui.hpp:29
@ UIMSG_SECTORRECOVERED
Definition: ui.hpp:48
@ UIMSG_RECONSTRUCTING
Definition: ui.hpp:51
@ UIERROR_EMAIL
Definition: ui.hpp:35
@ UIMSG_RECVOLMISSING
Definition: ui.hpp:50
@ UIERROR_MODIFYUNKNOWN
Definition: ui.hpp:24
@ UIERROR_UNKNOWNMETHOD
Definition: ui.hpp:20
@ UIERROR_ZIPVOLSFX
Definition: ui.hpp:34
@ UIERROR_TOOLARGESFX
Definition: ui.hpp:35
@ UIERROR_NTFSREQUIRED
Definition: ui.hpp:34
@ UIERROR_RECYCLEFAILED
Definition: ui.hpp:14
@ UIERROR_UOWNERBROKEN
Definition: ui.hpp:39
@ UIERROR_RENAMING
Definition: ui.hpp:21
@ UIERROR_FILEDELETE
Definition: ui.hpp:14
@ UIERROR_RECVOLALLEXIST
Definition: ui.hpp:27
@ UIERROR_NOLINKTARGET
Definition: ui.hpp:17
@ UIERROR_SUBHEADERBROKEN
Definition: ui.hpp:19
@ UIERROR_MODIFYOLD
Definition: ui.hpp:24
@ UIEVENT_SEARCHDUPFILESEND
Definition: ui.hpp:58
@ UIERROR_DIRNAMEEXISTS
Definition: ui.hpp:42
@ UIERROR_NOFILESTOADD
Definition: ui.hpp:32
@ UIERROR_INCERRCOUNT
Definition: ui.hpp:10
@ UIERROR_SLINKCREATE
Definition: ui.hpp:16
@ UIEVENT_DELADDEDSTART
Definition: ui.hpp:60
@ UIERROR_RARZIPONLY
Definition: ui.hpp:31
@ UIMSG_CREATING
Definition: ui.hpp:49
@ UIERROR_ULINKREAD
Definition: ui.hpp:40
@ UIERROR_CORRUPTEXTRA
Definition: ui.hpp:34
@ UIWAIT_FIRST
Definition: ui.hpp:54
@ UIERROR_WRONGSFXVER
Definition: ui.hpp:23
@ UIERROR_CHECKSUMPACKED
Definition: ui.hpp:11
@ UIERROR_FILECREATE
Definition: ui.hpp:12
@ UIMSG_RRNOTFOUND
Definition: ui.hpp:46
@ UIERROR_FILEOPEN
Definition: ui.hpp:12
@ UIMSG_RENAMING
Definition: ui.hpp:49
@ UIERROR_NOTSUPPORTED
Definition: ui.hpp:30
@ UIERROR_USESMALLERDICT
Definition: ui.hpp:24
@ UIERROR_UOWNERSET
Definition: ui.hpp:40
@ UIMSG_RRSEARCH
Definition: ui.hpp:45
@ UIERROR_ACLGET
Definition: ui.hpp:36
void uiStartArchiveExtract(bool Extract, const wchar *ArcName)
Definition: uiconsole.cpp:60
void uiExtractProgress(int64 CurFileSize, int64 TotalFileSize, int64 CurSize, int64 TotalSize)
Definition: uiconsole.cpp:72