-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmainwindow.h
77 lines (65 loc) · 1.83 KB
/
mainwindow.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
76
77
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QFile>
#include <QModelIndex>
#include <QPointer>
#include <QSettings>
#include "hscrollwebview.h"
namespace Ui {
class MainWindow;
}
class QLabel;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
void openFile(QString fileName);
~MainWindow();
public slots:
void textChanged();
void fileNew();
void fileOpen();
void fileSave();
void fileSaveHTML();
void fileSaveAs();
void viewSource();
void viewDirectory();
void dirViewClicked(QModelIndex idx);
void about();
void aboutQt();
protected:
void closeEvent( QCloseEvent* event );
private slots:
void on_actionBold_triggered();
void on_actionItalic_triggered();
void on_actionBullet_triggered();
void on_actionNumbered_Bullet_triggered();
void on_actionCode_triggered();
void on_actionLink_triggered();
void on_actionImage_triggered();
void headerComboBox_activated( int index );
void on_actionSettings_triggered();
//TODO: void on_actionProjectSettings_triggerd(); - should be analogous to on_actionSettings_triggered()
void imageDropped(QString path);
void navigationRequest(QString navigationRequestTarget);
private:
void updateListView();
QString selectedText();
void replaceSelectedTextBy( const QString& text );
void insertTextAtCursorPosition( const QString& text );
void readUserSettings();
void writeUserSettings();
void readProjectSettings();
QString wrapInHTML(QString in);
Ui::MainWindow *ui;
QPointer<QFile> currentFile;
QDateTime currentFileLastRead;
QLabel* renderLabel;
QFont* currentFont;
bool reopenLastFile = false;
QSettings* userSettings;
QSettings* projectSettings;
};
#endif // MAINWINDOW_H