textedit.h

00001 /*
00002  * Silence
00003  *
00004  * Copyright (C) 2009 Manuel Unglaub
00005  *
00006  * This file is part of Silence.
00007  *
00008  * Silence is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, version GPLv2 only of the License.
00011  *
00012  * Silence is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016 
00017  * You should have received a copy of the GNU General Public License
00018  * along with Silence.  If not, see <http://www.gnu.org/licenses/>.
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 
Generated on Fri May 14 19:12:50 2010 for Silence by  doxygen 1.6.3