KTextEditor
document.cpp
Go to the documentation of this file.
97 bool DocumentAdaptor::insertTextLines(const QPoint& cursor,const QStringList& text, bool block) {
176 return (cursor.column()>=0) && (cursor.column()<=lineLength(cursor.line())); // = because new line isn't usually contained in line length
179 bool KTextEditor::Document::replaceText( const Range & range, const QString & text, bool block )
virtual bool insertText(const Cursor &position, const QString &text, bool block=false)=0
Insert text at position.
bool insertLine(int line, const QString &text)
Definition: document.cpp:105
bool openingError() const
True, eg if the file for opening could not be read This doesn't have to handle the KPart job cancled ...
Definition: document.cpp:149
bool cursorInText(const QPoint &cursor)
Definition: document.cpp:101
bool suppressOpeningErrorDialogs() const
Definition: document.cpp:145
virtual Cursor documentEnd() const =0
End position of the document.
void setSuppressOpeningErrorDialogs(bool suppress)
by default dialogs should be displayed.
Definition: document.cpp:141
void setOpeningErrorMessage(const QString &message)
Definition: document.cpp:161
const QString & encoding() const
DocumentAdaptor(Document *document)
Definition: document.cpp:30
static Cursor start()
Returns a cursor representing the start of any document - i.e., line 0, column 0. ...
Definition: cursor.cpp:57
virtual bool setText(const QString &text)=0
Set the given text as new document content.
QString text() const
virtual bool insertLine(int line, const QString &text)=0
Insert line(s) at the given line number.
bool insertLines(int line, const QStringList &text)
Definition: document.cpp:109
virtual bool insertLines(int line, const QStringList &text)=0
Insert line(s) at the given line number.
int x() const
int y() const
int lines() const
virtual bool removeText(const Range &range, bool block=false)=0
Remove the text specified in range.
bool insertText(const QPoint &cursor, const QString &text, bool block)
Definition: document.cpp:93
bool isOrphaned() const
since in kate part opening an non existend local file, doesn't cause an error anymore, a new field for storing if the local document is an orphan is needed.
Definition: document.cpp:165
A KParts derived class representing a text document.
Definition: document.h:111
bool insertTextLines(const QPoint &cursor, const QStringList &text, bool block)
Definition: document.cpp:97
bool setTextLines(const QStringList &text)
Definition: document.cpp:52
virtual bool cursorInText(const Cursor &cursor)
Checks whether the cursor specifies a valid position in a document.
Definition: document.cpp:173
An object representing a section of text, from one Cursor to another.
Definition: range.h:54
bool setEncoding(const QString &encoding)
Definition: document.cpp:60
int totalCharacters() const
virtual bool setEncoding(const QString &encoding)=0
This signal is emitted whenever the readWrite state of a document changes.
virtual int totalCharacters() const =0
Get the count of characters in the document.
virtual int line() const
Retrieve the line on which this cursor is situated.
Definition: cursor.cpp:62
virtual int lineLength(int line) const =0
Get the length of a given line in characters.
virtual const QString & encoding() const =0
Get the current chosen encoding.
QString openingErrorMessage() const
Definition: document.cpp:153
virtual bool replaceText(const Range &range, const QString &text, bool block=false)
Replace text from range with specified text.
Definition: document.cpp:179
virtual bool documentSaveAs()=0
Save the current file to another location.
Cursor endOfLine(int line) const
Get the end cursor position of line line.
Definition: document.h:425
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:27:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:27:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.