RedPanda-CPP/RedPandaIDE/editor.h

46 lines
1.1 KiB
C
Raw Normal View History

2021-04-06 23:10:57 +08:00
#ifndef EDITOR_H
#define EDITOR_H
#include <QObject>
#include <utils.h>
#include <QTabWidget>
#include <Qsci/qsciscintilla.h>
class Editor : public QObject
{
Q_OBJECT
public:
explicit Editor(QObject *parent, const QString& filename,
const QByteArray& encoding,
2021-04-06 23:10:57 +08:00
bool inProject, bool isNew,
QTabWidget* parentPageControl);
2021-04-07 22:44:08 +08:00
~Editor();
const QByteArray& encodingOption() const;
void setEncodingOption(const QByteArray& encoding);
const QByteArray& fileEncoding() const;
2021-04-06 23:10:57 +08:00
const QString& filename();
bool inProject() const;
bool isNew() const;
void loadFile();
2021-04-07 21:13:15 +08:00
void saveFile(const QString& filename);
2021-04-09 10:08:05 +08:00
bool save(bool force=false, bool reparse=true);
2021-04-06 23:10:57 +08:00
QsciScintilla* textEdit();
2021-04-09 10:08:05 +08:00
QTabWidget* pageControl();
2021-04-06 23:10:57 +08:00
signals:
private:
QByteArray mEncodingOption; // the encoding type set by the user
QByteArray mFileEncoding; // the real encoding of the file (auto detected)
2021-04-06 23:10:57 +08:00
QString mFilename;
QTabWidget* mParentPageControl;
bool mInProject;
bool mIsNew;
QsciScintilla* mTextEdit;
};
#endif // EDITOR_H