-
Notifications
You must be signed in to change notification settings - Fork 1
/
nfd_widget.h
107 lines (93 loc) · 3.19 KB
/
nfd_widget.h
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
/* Copyright (c) 2020-2024 hors<horsicq@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef NFD_WIDGET_H
#define NFD_WIDGET_H
#include <QFutureWatcher>
#include <QWidget>
#include <QtConcurrent>
#include "dialognfdscandirectory.h"
#include "dialogtextinfo.h"
#include "scanitemmodel.h"
#include "xshortcutswidget.h"
#include "dialognfdwidgetadvanced.h"
namespace Ui {
class NFD_Widget;
}
class NFD_Widget : public XShortcutsWidget {
Q_OBJECT
public:
enum ST {
ST_UNKNOWN = 0,
ST_FILE
};
// struct OPTIONS
// {
// bool bRecursiveScan;
// bool bDeepScan;
// bool bHeuristicScan;
// bool bAllTypesScan;
// };
enum COLUMN {
COLUMN_TYPE = 0,
COLUMN_STRING,
COLUMN_SIGNATURE,
COLUMN_INFO
};
explicit NFD_Widget(QWidget *pParent = nullptr);
~NFD_Widget();
void setData(const QString &sFileName, bool bScan = false, XBinary::FT fileType = XBinary::FT_UNKNOWN);
void setGlobal(XShortcuts *pShortcuts, XOptions *pXOptions);
virtual void adjustView();
virtual void reloadData(bool bSaveSelection);
private slots:
void clear();
void process();
void scan();
void stop();
void on_scanFinished();
void on_pushButtonNfdExtraInformation_clicked();
void enableControls(bool bState);
void on_pushButtonNfdDirectoryScan_clicked();
void on_pushButtonNfdInfo_clicked();
void on_pushButtonNfdScanStart_clicked();
void on_pushButtonNfdScanStop_clicked();
void timerSlot();
protected:
virtual void registerShortcuts(bool bState);
signals:
void scanStarted();
void scanFinished();
void currentFileType(qint32 nFT);
void showInfo();
private:
Ui::NFD_Widget *ui;
ST g_scanType;
SpecAbstract g_pSpecAbstract;
XScanEngine::SCAN_OPTIONS g_scanOptions;
XScanEngine::SCAN_RESULT g_scanResult;
QFutureWatcher<void> g_watcher;
QString g_sFileName;
XBinary::FT g_fileType;
XBinary::PDSTRUCT g_pdStruct;
QTimer *g_pTimer;
bool g_bProcess;
};
#endif // NFD_WIDGET_H