aboutsummaryrefslogtreecommitdiffstats
path: root/textedit.h
diff options
context:
space:
mode:
Diffstat (limited to 'textedit.h')
-rw-r--r--textedit.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/textedit.h b/textedit.h
index d2c6197..58bcaab 100644
--- a/textedit.h
+++ b/textedit.h
@@ -30,35 +30,55 @@
#include <QFileInfo>
#include <QApplication>
#include <QFile>
+#include "editorpage.h"
class QWidget;
class QString;
+class QTabWidget;
-class TextEdit : public QPlainTextEdit
+class TextEdit : public QWidget
{
Q_OBJECT
public:
- TextEdit(QWidget *parent=0);
+ TextEdit();
void setCurrentFile(const QString &fileName);
void loadFile(const QString &fileName);
bool maybeSave();
+ QPlainTextEdit* curTextPage();
public slots:
void quote();
- bool save();
+ void save();
bool saveAs();
void open();
void print();
private:
bool isKey(QString key);
- bool saveFile(const QString &fileName);
QString strippedName(const QString &fullFileName);
QString curFile;
+ int countPage;
+ QTabWidget *tabWidget;
+ bool maybeSaveFile();
+ EditorPage *curPage();
+ void setCursorPosition();
+
+private slots:
+ void removeTab(int index);
+ void cut();
+ void copy();
+ void paste();
+ void undo();
+ void redo();
+ void selectAll();
protected:
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent* event);
+ void newFile();
+ bool saveFile(const QString &fileName);
+ bool closeFile();
+
};
#endif // TEXTEDIT