-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathjsoneditormain.h
71 lines (60 loc) · 1.73 KB
/
jsoneditormain.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
#ifndef JSONEDITORMAIN_H
#define JSONEDITORMAIN_H
#include <QMainWindow>
#include <QModelIndex>
#include <QTextEdit>
#include "jsonc/jsoncxx.h"
#include "jsontreeitem.h"
#include "finddialog.h"
#include "findreplacedialog.h"
namespace Ui {
class JsonEditorMain;
}
class JsonEditorMain : public QMainWindow {
Q_OBJECT
public:
JsonEditorMain(QWidget *parent = 0);
~JsonEditorMain();
protected:
void changeEvent(QEvent *e);
void closeEvent(QCloseEvent *event);
private:
Ui::JsonEditorMain *ui;
Json::Value jsonValue;
const QString newInsertText;
const QString treeViewColumnKey;
const QString treeViewColumnValue;
const QString treeViewColumnType;
QString treeFormat(JsonTreeItem* treeItem = NULL, QString indent = "", bool noHeader = false);
void readSettings();
void writeSettings();
bool maybeSave();
void loadFile(const QString &fileName);
bool saveFile(const QString &fileName);
void setCurrentFile(const QString &fileName);
QString strippedName(const QString &fullFileName);
QString curFile;
QTextEdit *textEdit;
QString lastFilePath;
FindDialog *m_findDialog;
FindReplaceDialog *m_findReplaceDialog;
private slots:
void toggleFileToolbar(bool checked);
void toggleEditToolbar(bool checked);
void toggleFindToolbar(bool checked);
void toggleCodeToolbar(bool checked);
void refreshJsonTree();
void insertTreeNode();
void deleteTreeNode();
void insertTreeChild();
void updateActions();
void treeViewDataChanged();
void formatCode();
void showHelp();
void dataEdit(QModelIndex editIndex);
void open();
bool save();
bool saveAs();
void documentWasModified();
};
#endif // JSONEDITORMAIN_H