KTextEditor
document.h
Go to the documentation of this file.
458 virtual bool insertText ( const Cursor &position, const QString &text, bool block = false ) = 0;
468 virtual bool insertText ( const Cursor &position, const QStringList &text, bool block = false ) = 0;
584 void textRemoved(KTextEditor::Document *document, const KTextEditor::Range& range, const QString& oldText);
596 void textChanged(KTextEditor::Document *document, const KTextEditor::Range& oldRange, const KTextEditor::Range& newRange);
609 void textChanged(KTextEditor::Document *document, const KTextEditor::Range& oldRange, const QString& oldText, const KTextEditor::Range& newRange);
virtual bool saveAs(const KUrl &url)
static Cursor start()
Returns a cursor representing the start of any document - i.e., line 0, column 0.
Definition cursor.cpp:57
void textRemoved(KTextEditor::Document *document, const KTextEditor::Range &range, const QString &oldText)
The document emits this signal whenever range was removed, i.e.
virtual bool documentSaveAs()=0
Save the current file to another location.
virtual bool removeText(const Range &range, bool block=false)=0
Remove the text specified in range.
bool suppressOpeningErrorDialogs() const
Definition document.cpp:145
void documentNameChanged(KTextEditor::Document *document)
This signal is emitted whenever the document name changes.
virtual bool insertLine(int line, const QString &text)=0
Insert line(s) at the given line number.
virtual bool setEncoding(const QString &encoding)=0
This signal is emitted whenever the readWrite state of a document changes.
void reloaded(KTextEditor::Document *document)
Emitted after the current document was reloaded.
void textChanged(KTextEditor::Document *document)
The document emits this signal whenever its text changes.
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
virtual bool setText(const QString &text)=0
Set the given text as new document content.
void viewCreated(KTextEditor::Document *document, KTextEditor::View *view)
This signal is emitted whenever the document creates a new view.
virtual bool setText(const QStringList &text)=0
Set the given text as new document content.
virtual bool setHighlightingMode(const QString &name)=0
Set the current mode of the document by giving its name.
virtual bool insertLines(int line, const QStringList &text)=0
Insert line(s) at the given line number.
virtual View * activeView() const =0
Return the view which currently has user focus, if any.
virtual QString modeSection(int index) const =0
Returns the name of the section for a mode given its index in the highlight list (as returned by mode...
virtual View * createView(QWidget *parent)=0
Create a new view attached to parent.
virtual QChar character(const Cursor &position) const =0
Get the character at cursor.
void modeChanged(KTextEditor::Document *document)
Warn anyone listening that the current document's mode has changed.
void aboutToClose(KTextEditor::Document *document)
Warn anyone listening that the current document is about to close.
virtual const QString & documentName() const =0
Get this document's name.
void textChanged(KTextEditor::Document *document, const KTextEditor::Range &oldRange, const KTextEditor::Range &newRange)
The document emits this signal whenever the text in range oldRange was removed and replaced with the ...
void documentSavedOrUploaded(KTextEditor::Document *document, bool saveAs)
This signal should be emitted after a document has been saved to disk or for remote files uploaded.
bool isOrphaned() const
since in kate part opening an non existend local file, doesn't cause an error anymore,...
Definition document.cpp:165
virtual bool replaceText(const Range &range, const QString &text, bool block=false)
Replace text from range with specified text.
Definition document.cpp:179
virtual QString highlightingMode() const =0
Return the name of the currently used mode.
void exclusiveEditEnd(KTextEditor::Document *document)
In conjunction with exclusiveEditStart(), signals that the document's content may be changed again wi...
void highlightingModeChanged(KTextEditor::Document *document)
Warn anyone listening that the current document's highlighting mode has changed.
virtual int lineLength(int line) const =0
Get the length of a given line in characters.
void textChanged(KTextEditor::Document *document, const KTextEditor::Range &oldRange, const QString &oldText, const KTextEditor::Range &newRange)
The document emits this signal whenever the text in range oldRange was removed and replaced with the ...
virtual bool cursorInText(const Cursor &cursor)
Checks whether the cursor specifies a valid position in a document.
Definition document.cpp:173
virtual QStringList modes() const =0
Return a list of the names of all possible modes.
void setSuppressOpeningErrorDialogs(bool suppress)
by default dialogs should be displayed.
Definition document.cpp:141
virtual int totalCharacters() const =0
Get the count of characters in the document.
virtual const QString & encoding() const =0
Get the current chosen encoding.
void textRemoved(KTextEditor::Document *document, const KTextEditor::Range &range)
The document emits this signal whenever range was removed, i.e.
virtual QString highlightingModeSection(int index) const =0
Returns the name of the section for a highlight given its index in the highlight list (as returned by...
virtual QStringList textLines(const Range &range, bool block=false) const =0
Get the document content within the given range.
virtual bool insertText(const Cursor &position, const QString &text, bool block=false)=0
Insert text at position.
void exclusiveEditStart(KTextEditor::Document *document)
Upon emission, the document's content may only be changed by the initiator of this signal until exclu...
void textInserted(KTextEditor::Document *document, const KTextEditor::Range &range)
The document emits this signal whenever text was inserted.
virtual Cursor documentEnd() const =0
End position of the document.
virtual const QList< View * > & views() const =0
Returns the views pre-casted to KTextEditor::Views.
void aboutToReload(KTextEditor::Document *document)
Warn anyone listening that the current document is about to reload.
virtual QString text(const Range &range, bool block=false) const =0
Get the document content within the given range.
void modifiedChanged(KTextEditor::Document *document)
This signal is emitted whenever the document's buffer changed from either state unmodified to modifie...
virtual bool setMode(const QString &name)=0
Set the current mode of the document by giving its name.
virtual QStringList highlightingModes() const =0
Return a list of the names of all possible modes.
virtual QString mode() const =0
Return the name of the currently used mode.
QString openingErrorMessage() const
Definition document.cpp:153
virtual bool insertText(const Cursor &position, const QStringList &text, bool block=false)=0
Insert text at position.
void setOpeningErrorMessage(const QString &message)
Definition document.cpp:161
void documentUrlChanged(KTextEditor::Document *document)
This signal is emitted whenever the document URL changes.
An object representing a section of text, from one Cursor to another.
Definition range.h:55
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.