KTextEditor
document.cpp
Go to the documentation of this file.
97 bool DocumentAdaptor::insertTextLines(const QPoint& cursor,const QStringList& text, bool block) {
167 return (cursor.column()>=0) && (cursor.column()<=lineLength(cursor.line())); // = because new line isn't usually contained in line length
170 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:148
bool cursorInText(const QPoint &cursor)
Definition: document.cpp:101
bool suppressOpeningErrorDialogs() const
Definition: document.cpp:144
virtual Cursor documentEnd() const =0
End position of the document.
void setSuppressOpeningErrorDialogs(bool suppress)
by default dialogs should be displayed.
Definition: document.cpp:140
void setOpeningErrorMessage(const QString &message)
Definition: document.cpp:160
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
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:164
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:152
virtual bool replaceText(const Range &range, const QString &text, bool block=false)
Replace text from range with specified text.
Definition: document.cpp:170
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:484
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.