-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow.h
62 lines (48 loc) · 1.24 KB
/
window.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
//
// window.h
// markdown
//
// Created by Jackey Chen on 5/27/15.
//
//
#ifndef __markdown__window__
#define __markdown__window__
#include <stdio.h>
#include <QWidget>
#include <QMainWindow>
#include <QFile>
class QTextEdit;
class QTextStream;
namespace md {
enum SAVE_TYPE {SAVE_PDF, SAVE_HTML};
class Window: public QMainWindow {
Q_OBJECT
public:
Window(QWidget *parent = 0);
~Window();
void createMenus();
void createComponents();
void initMdHandler();
public slots:
void handleMdCompiled(QString compiledString);
void saveAsPDF();
void saveAsHTML();
// 保存文件
// 如果保存文件是PDF, 则也保存对应的PDF文件;同理 HTML
void saveTriggered();
private:
QTextEdit *mdEditor;
QTextEdit *htmlEditor;
QTextStream *screenStyleFile;
QString mdSaveTo;
QString pdfSaveTo;
QString htmlSaveTo;
SAVE_TYPE saveType = SAVE_HTML;
// Menu action
QAction *pdfAction;
QAction *htmlAction;
QAction *saveAction;
QFile styleFile;
};
}
#endif /* defined(__markdown__window__) */