-
Notifications
You must be signed in to change notification settings - Fork 0
/
tformdoc.h
59 lines (51 loc) · 1.4 KB
/
tformdoc.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
#ifndef TFORMDOC_H
#define TFORMDOC_H
#include "highlighter.h"
#include <QWidget>
#include <codeeditor.h>
namespace Ui {
class TFormDoc;
}
class TFormDoc : public QWidget
{
Q_OBJECT
public:
explicit TFormDoc(QWidget *parent );
~TFormDoc();
private:
Ui::TFormDoc *ui;
CodeEditor *codeEditor;
QString m_filename; //当前文件
bool m_fileOpened=false; //文件已打开
bool m_isNewFile;
Highlighter *highlighter;
friend class MainWindow;
void addTextArea(const QFont &font);
void afterFileSaved(const QString& filePath);
Q_SIGNALS:
void statusMessageChange(QString msg);
public:
QString loadFromFile(const QString& aFileName,bool bNewFile); //打开文件
QString currentFileName(); //返回当前文件名
bool isFileOpened(); //文件已经打开
QString saveToFile(bool needOtherName = false); //保存文件
void setEditFont(); //设置字体
void textCut(); //cut
void textCopy(); //copy
void textPaste();
void showTextReplace();
void locateLine();
void textFind();
void zoomIn();
void zoomOut();
void findNext();
void findPrev();
QString selectedText();
QString filePath() {
return m_filename;
}
inline CodeEditor * textEditor(){
return codeEditor;
}
};
#endif // TFORMDOC_H