-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcodeeditor.h
75 lines (63 loc) · 1.93 KB
/
codeeditor.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
#ifndef CODEEDITOR_H
#define CODEEDITOR_H
#include <QMainWindow>
#include <QFont>
#include "highlighter.h"
#include "openedfiletab.h"
#include "activefileinformation.h"
#include "qfilesystemmodel.h"
QT_BEGIN_NAMESPACE
namespace Ui { class CodeEditor; }
QT_END_NAMESPACE
class CodeEditor : public QMainWindow {
Q_OBJECT
public:
CodeEditor(QWidget *parent = nullptr);
~CodeEditor();
void createTab(activeFileInformation& ,QString&, bool = 0);
void setWorkingDirectory(const QString &newWorkingDirectory);
void aboutCodeLabNotes();
void setHighlighting();
void setupEditor();
signals:
void workingDirectoryChanged();
private slots:
/*Trew view based slots */
void updateTreeView();
void on_treeView_doubleClicked(const QModelIndex &index);
void tabChangedProcess(OpenedFileTab*);
void tabClosedProcess(OpenedFileTab*);
/* Text editor based slots */
void on_actionUndo_triggered();
void on_actionRedo_triggered();
void on_actionCut_triggered();
void on_actionCopy_triggered();
void on_actionPaste_triggered();
/* File/Folder based slots */
void openFolder();
void fileCloseSlot(QString);
void createNewFile();
void createNewFolder();
void saveAllFiles();
void saveFileAs();
void autoSaveToggle(const bool);
void deleteFile();
void on_actionChange_Font_Size_triggered();
private:
Ui::CodeEditor *ui;
QFileSystemModel* dirModel;
QString workingDirectory, rootFileName;
QList<activeFileInformation*> activeFiles;
QList<OpenedFileTab*> activeTabs;
Highlighter* highlighter;
OpenedFileTab* currentTab;
QHash<QString, QString> icons;
bool blockChange, contentChanged;
void setUpMenu();
void setUpTreeView();
void openFile(const QString&, const QString &);
void displayFile();
void checkEditor();
void saveFile(activeFileInformation& filePath, const QString& fileContent);
};
#endif // CODEEDITOR_H