vnote/veditor.h
Le Tan 29609f0b65 change HGMarkdownHighlighter to use QSyntaxHighlighter
Signed-off-by: Le Tan <tamlokveer@gmail.com>
2016-10-19 22:49:45 +08:00

44 lines
875 B
C++

#ifndef VEDITOR_H
#define VEDITOR_H
#include <QStackedWidget>
#include <QString>
#include "vconstants.h"
#include "vnotefile.h"
#include "vdocument.h"
class QTextBrowser;
class VEdit;
class QWebEngineView;
class VEditor : public QStackedWidget
{
public:
VEditor(const QString &path, const QString &name, bool modifiable,
QWidget *parent = 0);
~VEditor();
bool requestClose();
// Enter edit mode
void editFile();
// Enter read mode
void readFile();
// Save file
bool saveFile();
private:
bool isMarkdown(const QString &name);
void setupUI();
void showFileReadMode();
void showFileEditMode();
void setupMarkdownPreview();
VNoteFile *noteFile;
bool isEditMode;
QTextBrowser *textBrowser;
VEdit *textEditor;
QWebEngineView *webPreviewer;
VDocument document;
};
#endif // VEDITOR_H