-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcorepad.h
More file actions
executable file
·107 lines (86 loc) · 2.87 KB
/
corepad.h
File metadata and controls
executable file
·107 lines (86 loc) · 2.87 KB
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
/*
CorePad is document editor app
CorePad 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; version 2
of the License.
This program 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 this program; if not, see {http://www.gnu.org/licenses/}. */
#ifndef COREPAD_H
#define COREPAD_H
#include "coreedit.h"
#include <QFile>
#include <QFileDialog>
#include <QShortcut>
#include <QFileInfo>
#include <QDate>
#include <QDateTime>
#include <QMessageBox>
#include <QDebug>
#include <QWidget>
#include <QCloseEvent>
#include <cprime/themefunc.h>
#include <cprime/bookmarkdialog.h>
namespace Ui {
class corepad;
}
class corepad : public QWidget
{
Q_OBJECT
public:
explicit corepad(QWidget *parent = nullptr);
~corepad();
void sendFiles(const QStringList &paths);
QString workFilePath;
void openText(const QString &filePath);
bool initializeNewTab(const QString &filePath);
int tabsCount();
QString currentFilePath(int index);
private slots:
void textCopyAvailable(bool b);
void textUndoAvailable(bool b);
void textRedoAvailable(bool b);
void textTextChanged();
void on_notes_currentChanged(int index);
void on_notes_tabCloseRequested(int index);
void on_cOpen_clicked();
void on_cNew_clicked();
bool on_cSave_clicked();
void on_cSaveAs_clicked();
void on_cCopy_clicked();
void on_cPaste_clicked();
void on_cCut_clicked();
void on_cUndo_clicked();
void on_cRedo_clicked();
void on_addDate_clicked();
void on_bookMarkIt_clicked();
void on_searchHere_textChanged(const QString &arg1);
void on_nextW_clicked();
void on_previousW_clicked();
void quitClicked();
void on_fontShow_clicked();
void on_fontSize_valueChanged(int arg1);
void on_search_clicked();
protected:
void closeEvent(QCloseEvent *event);
private:
Ui::corepad *ui;
coreedit *text;
QStringList tabInfo; //Store tab information (Index, IsSaved, IsUpdated, FilePath)
bool started;
bool saveTo(const QString &filePath);
void findS(QString searchS, bool reverse, QTextDocument::FindFlags flag = nullptr);
bool closeTab(int index);
//Accessing information through tab information
QString isCurrentSaved(int index);
QString isCurrentUpdated(int index);
//Saving information at tab information
bool setCurrent(int index, int isSaved, int isUpdated, const QString &filePath);
void shotcuts();
void reIndex();
};
#endif // COREPAD_H