KTextEditor
documentadaptor_p.h
Go to the documentation of this file.
00001 /* This file is part of the KDE project 00002 * Copyright (C) 2006 Joseph Wenninger <jowenn@kde.org> 00003 * 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public License 00016 * along with this library; see the file COPYING.LIB. If not, write to 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef _ktexteditor_documentadaptor_p_h_ 00022 #define _ktexteditor_documentadaptor_p_h_ 00023 00024 #include <QtDBus/QtDBus> 00025 00026 namespace KTextEditor { 00027 class Document; 00029 class DocumentAdaptor: public QDBusAbstractAdaptor { 00030 Q_OBJECT 00031 Q_CLASSINFO("D-Bus Interface","org.kde.KTextEditor.Document") 00032 Q_PROPERTY(const QString& encoding READ encoding WRITE setEncoding) 00033 Q_PROPERTY(const QString& text READ text WRITE setText) 00034 Q_PROPERTY(int lines READ lines) 00035 Q_PROPERTY(bool empty READ isEmpty) 00036 Q_PROPERTY(int totalCharacters READ totalCharacters) 00037 public: 00038 DocumentAdaptor(Document *document); 00039 virtual ~DocumentAdaptor(); 00040 public Q_SLOTS: 00041 bool clear(); 00042 bool reload(); 00043 bool save(); 00044 bool saveAs(); 00045 bool setTextLines(const QStringList &text); 00046 bool isEmpty() const ; 00047 int lineLength(int line) const; 00048 QPoint endOfLine(int line) const; 00049 bool insertText(const QPoint& cursor,const QString& text, bool block); 00050 bool insertTextLines(const QPoint& cursor,const QStringList& text, bool block); 00051 bool cursorInText(const QPoint& cursor); 00052 bool insertLine(int line, const QString& text); 00053 bool insertLines(int line, const QStringList& text); 00054 bool removeLine(int line); 00055 #ifdef __GNUC__ 00056 #warning "Implement/fix functions with cursor/range parameters / return values" 00057 #warning "fix katepart text manipulation deadlocks" 00058 #endif 00059 //public: 00060 bool setEncoding(const QString &encoding); 00061 const QString &encoding() const; 00062 bool setText(const QString &text); 00063 QString text() const; 00064 int lines() const; 00065 int totalCharacters() const; 00066 private: 00067 Document *m_document; 00068 }; 00069 00070 } 00071 00072 #endif
KDE 4.6 API Reference