diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-15 18:54:19 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-02 10:10:16 -0400 |
| commit | 6bd5bed29f3ebcc1155e615d7daa1c9cd1724efb (patch) | |
| tree | 9dea3a3a0b50b181f49c99eb57cfc3ef4b7a7ecf /src/texteditor.h | |
| parent | 59e0c4aa34fec9048d064705863c3269aacd86b5 (diff) | |
added initial toolbar, splitter
moved most of the text editor stuff to a new TextEditor class
Diffstat (limited to 'src/texteditor.h')
| -rw-r--r-- | src/texteditor.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/texteditor.h b/src/texteditor.h new file mode 100644 index 00000000..25a15ad7 --- /dev/null +++ b/src/texteditor.h @@ -0,0 +1,36 @@ +#ifndef MO_TEXTEDITOR_H +#define MO_TEXTEDITOR_H + +#include <QPlainTextEdit> + +class TextEditor : public QObject +{ + Q_OBJECT + +public: + TextEditor(QPlainTextEdit* edit); + + bool load(const QString& filename); + bool save(); + + const QString& filename() const; + + void wordWrap(bool b); + bool wordWrap() const; + + bool dirty() const; + +signals: + void changed(bool b); + +private: + QPlainTextEdit* m_edit; + QString m_filename; + QString m_encoding; + bool m_dirty; + + void onChanged(bool b); + void dirty(bool b); +}; + +#endif // MO_TEXTEDITOR_H |
