forked from Palamariuk/TextAnalyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplication.h
89 lines (58 loc) · 1.99 KB
/
application.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
#ifndef APPLICATION_H
#define APPLICATION_H
#include <QMainWindow>
#include <QFileDialog>
#include <QFile>
#include <QMessageBox>
#include <QTextStream>
#include <QStatusBar>
#include <QTextEdit>
#include <QDebug>
#include <QCloseEvent>
#include "text.h"
#include "textanalyzer.h"
#include "frequency.h"
QT_BEGIN_NAMESPACE
namespace Ui { class Application; }
QT_END_NAMESPACE
class Application : public QMainWindow
{
Q_OBJECT
public:
Application(QWidget *parent = nullptr);
~Application();
private slots:
void on_openFile_triggered();
void on_saveFile_triggered();
void on_saveFileAs_triggered();
void on_closeFile_triggered();
void on_actionUndo_triggered();
void on_actionRedo_triggered();
void on_actionCopy_triggered();
void on_actionPaste_triggered();
void on_textEdit_textChanged();
void on_clearFormatting_triggered();
void on_btAdvansedStatistics_clicked();
void on_getAverageLength_triggered();
void on_showLongestWords_triggered();
void on_showShortestWords_triggered();
void on_getLetterFrequency_triggered();
void on_showIdSentences_triggered();
void on_repeatNumbers_triggered();
void on_showIdProperNames_triggered();
/*Метод очищення форматування конкретного textEdit'a*/
void clearFormatting(QTextEdit* textEdit);
/*Методи підсвічування тексту в textEdit за певними умовами*/
void highlightText(QTextEdit* textEdit, QColor color,
size_t begin, size_t length);
void highlightWordsByLength(QTextEdit* textEdit,
QVector<QPair<QString, int>> words, int length);
void highlightAllOccures(QTextEdit* textEdit, TextAnalyzer analyzer,
QVector<QString> substrings);
void on_showTask_triggered();
void closeEvent(QCloseEvent *event);
private:
Ui::Application *ui;
Text *text = nullptr;
};
#endif // APPLICATION_H