textedit.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef TEXTEDIT_H
00022 #define TEXTEDIT_H
00023
00024 #include "src/data/node/textnodecontent.h"
00025 #include "src/gui/view/abstractcontentview.h"
00026
00027 namespace KTextEditor
00028 {
00029 class Document;
00030 class View;
00031 class Editor;
00032 class Cursor;
00033 }
00034
00035 class QAction;
00036 class QActionGroup;
00037 class QToolBar;
00038 class QVBoxLayout;
00039
00040
00048 class TextEdit : public AbstractContentView
00049 {
00050 Q_OBJECT
00051
00052 public:
00057 TextEdit();
00058
00063 ~TextEdit();
00064
00069 void setContent(TextNodeContent *content);
00070
00075 void setText(QString text);
00076
00081 void setSyntax(QString syntax);
00082
00083 bool hasChanged();
00084 AbstractContentChange* getChange();
00085
00086 public slots:
00091 void setVisible(bool visible);
00092
00093 private slots:
00094 void saveContent();
00095 void contentChanged();
00096 void cursorPositionChanged(KTextEditor::View *view, const KTextEditor::Cursor &newPosition);
00097
00098 private:
00099 TextNodeContent *content;
00100 bool isChanged;
00101 QVBoxLayout *layout;
00102
00103 QActionGroup *actionGroup;
00104
00105 QToolBar *toolbar;
00106 QAction *saveAction;
00107
00108 KTextEditor::View *view;
00109 KTextEditor::Document *document;
00110 KTextEditor::Editor *editor;
00111
00112
00113 void setupActions();
00114 void setupEditor();
00115 };
00116
00117 #endif // TEXTEDIT_H
00118