1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
|
//
// Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
// Earlier copyrights 1998 - 2006 Jim Bublitz also apply
// Generated by preSip
// This file is part of PyKDE4.
// PyKDE4 is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.
// PyKDE4 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace KTextEditor
{
class Document : KParts::ReadWritePart
{
%TypeHeaderCode
#include <ktexteditor/document.h>
#include <ktexteditor/modificationinterface.h>
#include <ktexteditor/markinterface.h>
#include <ktexteditor/searchinterface.h>
#include <ktexteditor/sessionconfiginterface.h>
#include <ktexteditor/smartinterface.h>
#include <ktexteditor/templateinterface.h>
#include <ktexteditor/variableinterface.h>
%End
public:
Document (QObject* = 0);
public:
virtual KTextEditor::Editor* editor () = 0;
virtual KTextEditor::View* createView (QWidget*) = 0;
virtual KTextEditor::View* activeView () const = 0;
virtual const QList<KTextEditor::View*>& views () const = 0;
signals:
void viewCreated (KTextEditor::Document*, KTextEditor::View*);
public:
virtual const QString& documentName () const = 0;
virtual QString mimeType () = 0;
signals:
void documentNameChanged (KTextEditor::Document*);
void documentUrlChanged (KTextEditor::Document*);
void modifiedChanged (KTextEditor::Document*);
public:
virtual bool setEncoding (const QString&) = 0;
virtual const QString& encoding () const = 0;
public:
virtual bool documentReload () = 0;
virtual bool documentSave () = 0;
virtual bool documentSaveAs () = 0;
public:
virtual bool startEditing () = 0;
virtual bool endEditing () = 0;
public:
virtual QString text () const = 0;
virtual QString text (const KTextEditor::Range&, bool = 0) const = 0;
virtual QChar character (const KTextEditor::Cursor&) const = 0;
virtual QStringList textLines (const KTextEditor::Range&, bool = 0) const = 0;
virtual QString line (int) const = 0;
virtual int lines () const = 0;
virtual KTextEditor::Cursor documentEnd () const = 0;
KTextEditor::Range documentRange () const;
virtual int totalCharacters () const = 0;
virtual bool isEmpty () const;
virtual int lineLength (int) const = 0;
KTextEditor::Cursor endOfLine (int) const;
virtual bool setText (const QString&) = 0;
virtual bool setText (const QStringList&) = 0;
virtual bool clear () = 0;
virtual bool insertText (const KTextEditor::Cursor&, const QString&, bool = 0) = 0;
virtual bool insertText (const KTextEditor::Cursor&, const QStringList&, bool = 0) = 0;
virtual bool replaceText (const KTextEditor::Range&, const QString&, bool = 0);
virtual bool replaceText (const KTextEditor::Range&, const QStringList&, bool = 0);
virtual bool removeText (const KTextEditor::Range&, bool = 0) = 0;
virtual bool cursorInText (const KTextEditor::Cursor&);
virtual bool insertLine (int, const QString&) = 0;
virtual bool insertLines (int, const QStringList&) = 0;
virtual bool removeLine (int) = 0;
signals:
void textChanged (KTextEditor::Document*);
void textInserted (KTextEditor::Document*, const KTextEditor::Range&);
void textRemoved (KTextEditor::Document*, const KTextEditor::Range&);
void textChanged (KTextEditor::Document*, const KTextEditor::Range&, const KTextEditor::Range&);
void aboutToClose (KTextEditor::Document*);
public:
virtual QString mode () const = 0;
virtual QString highlightingMode () const = 0;
virtual QStringList modes () const = 0;
virtual QStringList highlightingModes () const = 0;
virtual bool setMode (const QString&) = 0;
virtual bool setHighlightingMode (const QString&) = 0;
virtual QString highlightingModeSection (int) const = 0;
virtual QString modeSection (int) const = 0;
signals:
void modeChanged (KTextEditor::Document*);
void highlightingModeChanged (KTextEditor::Document*);
public:
void setSuppressOpeningErrorDialogs (bool);
bool suppressOpeningErrorDialogs () const;
bool openingError () const;
QString openingErrorMessage () const;
protected:
void setOpeningError (bool);
void setOpeningErrorMessage (const QString&);
public:
// Python cannot dynamic_cast, so methods are provided that attempt
// to convert the Document to the required interface. They return
// None on failure.
// Why no annotationinterface.sip?
// KTextEditor::AnnotationInterface *annotationInterface();
// %MethodCode
// Py_BEGIN_ALLOW_THREADS
// sipRes = dynamic_cast<KTextEditor::AnnotationInterface*>(sipCpp);
// Py_END_ALLOW_THREADS
// %End
KTextEditor::MarkInterface *markInterface();
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipRes = dynamic_cast<KTextEditor::MarkInterface*>(sipCpp);
Py_END_ALLOW_THREADS
%End
KTextEditor::ModificationInterface *modificationInterface();
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipRes = dynamic_cast<KTextEditor::ModificationInterface*>(sipCpp);
Py_END_ALLOW_THREADS
%End
KTextEditor::SearchInterface *searchInterface();
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipRes = dynamic_cast<KTextEditor::SearchInterface*>(sipCpp);
Py_END_ALLOW_THREADS
%End
KTextEditor::SmartInterface *smartInterface();
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipRes = dynamic_cast<KTextEditor::SmartInterface*>(sipCpp);
Py_END_ALLOW_THREADS
%End
KTextEditor::TemplateInterface *templateInterface();
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipRes = dynamic_cast<KTextEditor::TemplateInterface*>(sipCpp);
Py_END_ALLOW_THREADS
%End
KTextEditor::TextHintInterface *textHintInterface();
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipRes = dynamic_cast<KTextEditor::TextHintInterface*>(sipCpp);
Py_END_ALLOW_THREADS
%End
KTextEditor::VariableInterface *variableInterface();
%MethodCode
Py_BEGIN_ALLOW_THREADS
sipRes = dynamic_cast<KTextEditor::VariableInterface*>(sipCpp);
Py_END_ALLOW_THREADS
%End
}; // class Document
}; // namespace KTextEditor
|