-
Notifications
You must be signed in to change notification settings - Fork 0
/
TextAnalyzerWindow.h
107 lines (84 loc) · 3.1 KB
/
TextAnalyzerWindow.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
#ifndef TEXTANALYZERWINDOW_H
#define TEXTANALYZERWINDOW_H
#include "CommonData.h"
#include "Workers/FileReader.h"
#include "Workers/TextAnalyzer.h"
#include "Widgets/GlowedButton.h"
#include "Table/LetterCombinationsModel.h"
#include "Table/LetterCombinationsTableView.h"
#include <QMainWindow>
#include <QLabel>
#include <QMovie>
#include <QFrame>
#include <QLineEdit>
#include <QPushButton>
#include <QToolButton>
#include <QChartView>
#include <QBarSeries>
#include <QBarCategoryAxis>
#include <QValueAxis>
#include <QVBoxLayout>
QT_CHARTS_USE_NAMESPACE
class CTextAnalyzerWindow : public QMainWindow
{
Q_OBJECT
public:
CTextAnalyzerWindow(QWidget* parent = nullptr);
~CTextAnalyzerWindow();
public slots:
void updateTopLetterCombinations(const WordsVector&);
void updateWordsProcessedCount(quint64);
void updateTotalLetterCombinationsCount(quint64);
//! Status from the CommonData::EFileReadingStatus enumeration.
void changeProcessStatus(int);
signals:
void fileProcessingStarted(const QString& fileName);
void fileProcessingFinished();
void histogramUpdatingFinished();
protected:
void closeEvent(QCloseEvent*) Q_DECL_OVERRIDE;
private slots:
void browsePath();
void finishTextAnalyzing(const WordsVector&);
private:
void init();
void createWidgets();
void createMainLayout();
void createConnections();
void createTextAnalyzingMovie();
void breakTextAnalyzingMovie();
void startTextAnalyzing();
void stopTextAnalyzing();
void dropUIState();
QWidget* m_mainWidget { nullptr };
CFileReaderWorker* m_fileReaderWorker { nullptr };
QThread* m_fileReaderWorkerThread { nullptr };
CTextAnalyzerWorker* m_textAnalyzerWorker { nullptr };
QThread* m_textAnalyzerWorkerThread { nullptr };
QLabel* m_filePathLabel { nullptr };
QLineEdit* m_filePathLineEdit { nullptr };
CGlowedButton* m_browseFilePushButton { nullptr };
QScopedPointer<QMovie> m_textAnalyzingMovie { nullptr };
QLabel* m_textAnalyzingMovieLabel { nullptr };
QToolButton* m_statusToolButton { nullptr };
QLabel* m_statusLabel { nullptr };
QLabel* m_totalWordsProcessedLabel { nullptr };
QLabel* m_totalWordsProcessedCountLabel { nullptr };
QFrame* m_statusVerticalLine { nullptr };
QWidget* m_statusInfoWidget { nullptr };
QChart* m_histogram { nullptr };
QChartView* m_histogramView { nullptr };
QBarSeries* m_barSeries { nullptr };
QBarCategoryAxis* m_axisX { nullptr };
QValueAxis* m_axisY { nullptr };
CLetterCombinationsModel* m_letterCombinationsModel { nullptr };
CLetterCombinationsTableView* m_letterCombinationsTableView { nullptr };
QVBoxLayout* m_mainLayout { nullptr };
QString m_defaultPath { ".\\..\\..\\..\\TextAnalyzer\\Data" };
QString m_textAnalyzingInProgressText { QObject::tr("Text analysis") };
quint64 m_totalLetterCombinationsCount { 0 };
double m_maxLetterCombinationsPercentage { 0.0 };
double m_scaleFactor { 1.0 };
CommonData::ETextAnalyzingStatus m_textAnalyzingStatus { CommonData::ETextAnalyzingStatus::etasIdle };
};
#endif // TEXTANALYZERWINDOW_H