1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
|
// ****************************************************************************
// Project: GUYMAGER
// ****************************************************************************
// Programmer: Guy Voncken
// Police Grand-Ducale
// Service de Police Judiciaire
// Section Nouvelles Technologies
// ****************************************************************************
// Copyright 2008, 2009, 2010, 2011, 2012 Guy Voncken
//
// This file is part of guymager.
//
// guymager is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// guymager is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with guymager. If not, see <http://www.gnu.org/licenses/>.
#ifndef __CONFIG_H__
#define __CONFIG_H__
#define CONFIG(Param) ( CfgGetpData ()->Param)
#define CONFIG_COLOR(Color) (*CfgGetpColor(Color))
#define CONFIG_FONT(FontObject) (*CfgGetpFont (FontObject ))
typedef enum
{
CFG_STARTUPSIZE_STANDARD,
CFG_STARTUPSIZE_FULLSCREEN,
CFG_STARTUPSIZE_MAXIMIZED,
CFG_STARTUPSIZE_MANUAL,
} t_CfgStartupSize;
typedef enum
{
CFG_NUMBERSTYLE_LOCALE,
CFG_NUMBERSTYLE_DECIMAL_COMMA,
CFG_NUMBERSTYLE_DECIMAL_POINT
} t_CfgNumberStyle;
typedef enum
{
CFG_ENTRYMODE_HIDE,
CFG_ENTRYMODE_SHOWDEFAULT,
CFG_ENTRYMODE_SHOWLAST
} t_CfgEntryMode;
const int CFG_MAX_LANGUAGE_LEN = 8;
const int CFG_MAX_FONT_FAMILY_LEN = 63;
const int CFG_MAX_PATH_LEN = 1024;
const int CFG_MAX_TITLEID_LEN = 31;
const int CFG_MAX_MENU_NAME_LEN = 255;
const int CFG_MAX_LANGUAGE_CODE_LEN = 5;
const int CFG_MAX_FIELDNAME_LEN = 255;
const int CFG_MAX_MISC_LEN = 255;
class QColor; //lint !e763
class QFont; //lint !e763
typedef enum
{
FONTOBJECT_MENU=0, // must start with 0, as it is used for addressing an array
FONTOBJECT_DIALOGDEFAULT,
FONTOBJECT_COUNT
} t_CfgFontObject;
typedef enum
{
COLOR_LOCALDEVICES=0,
COLOR_ADDITIONALSTATE1,
COLOR_ADDITIONALSTATE2,
COLOR_ADDITIONALSTATE3,
COLOR_ADDITIONALSTATE4,
COLOR_STATE_IDLE,
COLOR_STATE_ACQUIRE,
COLOR_STATE_ACQUIRE_PAUSED,
COLOR_STATE_VERIFY,
COLOR_STATE_VERIFY_PAUSED,
COLOR_STATE_CLEANUP,
COLOR_STATE_FINISHED,
COLOR_STATE_FINISHED_BADVERIFY,
COLOR_STATE_ABORTED_USER,
COLOR_STATE_ABORTED_OTHER,
COLOR_COUNT,
COLOR_DEFAULT=-1 // Not really a color, but used for specifying, that a widget should switch to its default color (grey for a button, for instance)
} t_CfgColor;
typedef enum
{
SCANMETHOD_LIBPARTED=0,
SCANMETHOD_DBUSHAL,
SCANMETHOD_DBUSDEVKIT,
SCANMETHOD_COUNT
} t_CfgScanMethod;
// ATTENTION: The data of the following structure is filled in by the CFG tool. As this
// one doesn't know about 'bool' (it's written in ANSI C), bool MUST not be used here.
// ------------------------------------------------------------------------------------
#undef bool
#define bool "Do not use bool, take int instead"
typedef struct
{
char Language[CFG_MAX_LANGUAGE_LEN+1];
t_CfgStartupSize StartupSize;
int StartupSizeManualX;
int StartupSizeManualY;
int StartupSizeManualDx;
int StartupSizeManualDy;
t_CfgStartupSize FileDialogSize;
int FileDialogSizeManualDx;
int FileDialogSizeManualDy;
t_CfgNumberStyle NumberStyle;
int ScreenRefreshInterval;
int UseFileDialogFromQt;
int AutoExit;
int AutoExitCountdown;
t_CfgScanMethod DeviceScanMethod;
int ScanInterval;
char CommandGetSerialNumber[CFG_MAX_PATH_LEN+1];
char CommandGetAddStateInfo[CFG_MAX_PATH_LEN+1];
int QueryDeviceMediaInfo;
int DirectIO;
int DefaultFormat;
int EwfFormat;
int EwfCompression;
int AffCompression;
int AffMarkBadSectors;
char SpecialFilenameChars[CFG_MAX_MISC_LEN+1];
int CalcImageFileMD5;
int AvoidEncaseProblems;
int FifoBlockSizeDD;
int FifoBlockSizeEWF;
int FifoBlockSizeAFF;
int FifoMaxMem;
int FifoMemoryManager;
int UseSeparateHashThread;
int CompressionThreads;
int SignalHandling;
int WriteToDevNull;
int UseMemWatch;
int VerboseLibewf;
int CheckEwfData;
} t_CfgData, *t_pCfgData;
#undef bool
typedef struct
{
char Code [CFG_MAX_LANGUAGE_CODE_LEN+1];
char AsciiName [CFG_MAX_MENU_NAME_LEN +1];
} t_CfgBuffLanguage, *t_pCfgBuffLanguage;
typedef struct
{
t_CfgFontObject Object;
char Family[CFG_MAX_FONT_FAMILY_LEN+1];
int Size;
int Weight;
int Italic;
} t_CfgBuffFont, *t_pCfgBuffFont;
typedef struct
{
t_CfgColor Color;
int R;
int G;
int B;
} t_CfgBuffColor, *t_pCfgBuffColor;
typedef struct
{
char Device [CFG_MAX_PATH_LEN+1];
} t_CfgBuffLocalDevice, *t_pCfgBuffLocalDevice;
typedef struct
{
char Command [CFG_MAX_PATH_LEN+1];
} t_CfgBuffDeviceInfoCommand, *t_pCfgBuffDeviceInfoCommand;
// DlgAcquire fields and rules
// ---------------------------
#define CFG_DLGACQUIRE_EWF_FIELDID "Ewf"
#define CFG_DLGACQUIRE_HASH_FIELDID "Hash"
#define CFG_DLGACQUIRE_HASHCALC_FIELDID "HashCalc"
#define CFG_DLGACQUIRE_HASHVERIFY_FIELDID "HashVerify"
#define CFG_DLGACQUIRE_DST_FIELDID "Dest"
#define CFG_DLGACQUIRE_DIR_FIELDID "Directory"
#define CFG_DLGACQUIRE_SPLITFILESWITCH QT_TRANSLATE_NOOP("t_DlgAcquire", "SplitFileSwitch" )
#define CFG_DLGACQUIRE_SPLITFILESIZE QT_TRANSLATE_NOOP("t_DlgAcquire", "SplitFileSize" )
#define CFG_DLGACQUIRE_SPLITFILEUNIT QT_TRANSLATE_NOOP("t_DlgAcquire", "SplitFileUnit" )
#define CFG_DLGACQUIRE_EWF_CASENUMBER QT_TRANSLATE_NOOP("t_DlgAcquire", "EwfCaseNumber" )
#define CFG_DLGACQUIRE_EWF_EVIDENCENUMBER QT_TRANSLATE_NOOP("t_DlgAcquire", "EwfEvidenceNumber" )
#define CFG_DLGACQUIRE_EWF_EXAMINER QT_TRANSLATE_NOOP("t_DlgAcquire", "EwfExaminer" )
#define CFG_DLGACQUIRE_EWF_DESCRIPTION QT_TRANSLATE_NOOP("t_DlgAcquire", "EwfDescription" )
#define CFG_DLGACQUIRE_EWF_NOTES QT_TRANSLATE_NOOP("t_DlgAcquire", "EwfNotes" )
#define CFG_DLGACQUIRE_DEST_IMAGEDIRECTORY QT_TRANSLATE_NOOP("t_DlgAcquire", "DestImageDirectory")
#define CFG_DLGACQUIRE_DEST_IMAGEFILENAME QT_TRANSLATE_NOOP("t_DlgAcquire", "DestImageFilename" )
#define CFG_DLGACQUIRE_DEST_INFODIRECTORY QT_TRANSLATE_NOOP("t_DlgAcquire", "DestInfoDirectory" )
#define CFG_DLGACQUIRE_DEST_INFOFILENAME QT_TRANSLATE_NOOP("t_DlgAcquire", "DestInfoFilename" )
#define CFG_DLGACQUIRE_HASH_CALC_MD5 QT_TRANSLATE_NOOP("t_DlgAcquire", "HashCalcMD5" )
#define CFG_DLGACQUIRE_HASH_CALC_SHA256 QT_TRANSLATE_NOOP("t_DlgAcquire", "HashCalcSHA256" )
#define CFG_DLGACQUIRE_HASH_VERIFY_SRC QT_TRANSLATE_NOOP("t_DlgAcquire", "HashVerifySrc" )
#define CFG_DLGACQUIRE_HASH_VERIFY_DST QT_TRANSLATE_NOOP("t_DlgAcquire", "HashVerifyDst" )
typedef struct
{
char FieldName [CFG_MAX_FIELDNAME_LEN+1];
t_CfgEntryMode EntryModeImage;
t_CfgEntryMode EntryModeClone;
char DefaultValue[CFG_MAX_MISC_LEN +1];
} t_CfgBuffDlgAcquireField, *t_pCfgBuffDlgAcquireField;
typedef struct
{
char TriggerFieldName[CFG_MAX_FIELDNAME_LEN+1];
char DestFieldName [CFG_MAX_FIELDNAME_LEN+1];
char Value [CFG_MAX_MISC_LEN +1];
} t_CfgBuffDlgAcquireRule, *t_pCfgBuffDlgAcquireRule;
class QCheckBox;
class QComboBox;
class QLabel;
class t_DlgAcquireLineEdit;
class t_CfgDlgAcquireField
{
public:
QString FieldName;
t_CfgEntryMode EntryModeImage;
t_CfgEntryMode EntryModeClone;
QString DefaultValue;
QString LastEnteredValue; // not set by config, used by DlgAcquire
bool EwfField; // This field is part of the EWF fields
bool HashField; // This field is part of the hash calculation/verification fields
bool DstField; // This field is part of the fields for entering the image/info destination
bool DirField; // This is a directory field with a browse button
t_DlgAcquireLineEdit *pLineEdit;
QCheckBox *pCheckBox;
QComboBox *pComboBox;
QLabel *pLabel;
}; //lint !e1553
typedef t_CfgDlgAcquireField *t_pCfgDlgAcquireField;
typedef QList<t_pCfgDlgAcquireField> t_CfgDlgAcquireFields;
typedef t_CfgDlgAcquireFields *t_pCfgDlgAcquireFields;
class t_CfgDlgAcquireRule
{
public:
QString TriggerFieldName;
QString DestFieldName;
QString Value;
}; //lint !e1553
typedef t_CfgDlgAcquireRule *t_pCfgDlgAcquireRule;
typedef QList<t_pCfgDlgAcquireRule> t_CfgDlgAcquireRules;
typedef t_CfgDlgAcquireRules *t_pCfgDlgAcquireRules;
QFont *CfgGetpFont (t_CfgFontObject Object);
const QColor *CfgGetpColor (t_CfgColor Color );
APIRET CfgGetLocalDevices (QStringList **ppLocalDevices);
APIRET CfgGetDeviceInfoCommands (QStringList **ppDeviceInfoCommands);
APIRET CfgGetDlgAcquireFields (t_pCfgDlgAcquireFields *ppDlgAcquireFields);
APIRET CfgGetDlgAcquireRules (t_pCfgDlgAcquireRules *ppDlgAcquireRules);
APIRET CfgInit (void);
APIRET CfgDeInit (void);
t_pCfgData CfgGetpData(void);
APIRET CfgGetLogFileName (t_pcchar *ppLogFileName, bool *pDefaultUsed);
APIRET CfgGetCfgFileName (t_pcchar *ppCfgFileName, bool *pDefaultUsed);
APIRET CfgReadConfiguration (t_pcchar pCfgFileName);
APIRET ConfigTranslateUnicodeEscape (char *pSrc, QString *pDest);
void CfgFontPrint (void);
// ------------------------------------
// Error codes
// ------------------------------------
enum
{
ERROR_CFG_ONLY_TEMPLATE_GENERATED = ERROR_BASE_CFG + 1,
};
#endif
|