KTextEditor
document.h
59 WholeWords = 1 << 11, ///< Plaintext mode: Whole words only, e.g. @em not "amp" in "example"
62};
490 * This signal should be emitted after a document has been saved to disk or for remote files uploaded.
853 virtual bool insertText(KTextEditor::Cursor position, const QString &text, bool block = false) = 0;
863 virtual bool insertText(KTextEditor::Cursor position, const QStringList &text, bool block = false) = 0;
888 * \param block set this to true to remove a text block on the basis of columns, rather than everything inside \p range
951 QList<KTextEditor::Range> searchText(KTextEditor::Range range, const QString &pattern, const SearchOptions options = Default) const;
1011 void textInserted(KTextEditor::Document *document, KTextEditor::Cursor position, const QString &text);
1019 void textRemoved(KTextEditor::Document *document, KTextEditor::Range range, const QString &text);
1050 virtual KSyntaxHighlighting::Theme::TextStyle defaultStyleAt(KTextEditor::Cursor position) const = 0;
1232 virtual void readSessionConfig(const KConfigGroup &config, const QSet<QString> &flags = QSet<QString>()) = 0;
1242 virtual void writeSessionConfig(KConfigGroup &config, const QSet<QString> &flags = QSet<QString>()) = 0;
1302 virtual MovingCursor *newMovingCursor(KTextEditor::Cursor position, MovingCursor::InsertBehavior insertBehavior = MovingCursor::MoveOnInsert) = 0;
1305 * Create a new moving range for this document. Ownership of the range that is returned belongs to the caller
1348 transformCursor(KTextEditor::Cursor &cursor, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision = -1) = 0;
1359 transformCursor(int &line, int &column, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision = -1) = 0;
1381 * @param document the document which the interface belongs to which is in the process of being deleted
1385 KTEXTEDITOR_DEPRECATED_VERSION(6, 9, "Not emitted any more. Ownership of the moving interface belongs to the user")
1434 };
1466 void modifiedOnDisk(KTextEditor::Document *document, bool isModified, KTextEditor::Document::ModifiedOnDiskReason reason);
1559 markType01 = 0x1,
1561 markType02 = 0x2,
1563 markType03 = 0x4,
1565 markType04 = 0x8,
1567 markType05 = 0x10,
1569 markType06 = 0x20,
1571 markType07 = 0x40,
1667 };
1700 void markChanged(KTextEditor::Document *document, KTextEditor::Mark mark, KTextEditor::Document::MarkChangeAction action);
1710 void markToolTipRequested(KTextEditor::Document *document, KTextEditor::Mark mark, QPoint position, bool &handled);
1713 * The \p document emits this signal whenever the \p mark is right-clicked to show a context menu.
1718 * \param handled set this to 'true' if this event was handled externally, and kate should not create an own context menu.
1720 void markContextMenuRequested(KTextEditor::Document *document, KTextEditor::Mark mark, QPoint pos, bool &handled);
An model for providing line annotation information.
Definition annotationinterface.h:42
Backend of KTextEditor::Document related public KTextEditor interfaces.
Definition katedocument.h:68
EditingTransaction(const EditingTransaction &)=delete
No copy constructor, don't allow this to be copied.
EditingTransaction & operator=(const EditingTransaction &)=delete
No assignment operator, no copying around editing transations.
void configChanged(KTextEditor::Document *document)
This signal is emitted whenever the current document configuration is changed.
virtual void setAnnotationModel(AnnotationModel *model)=0
Sets a new AnnotationModel for this document to provide annotation information for each line.
virtual QString text(Range range, bool block=false) const =0
Get the document content within the given range.
virtual void setConfigValue(const QString &key, const QVariant &value)=0
Set a the key's value to value.
virtual bool documentSaveAs()=0
Save the current file to another location.
virtual void transformCursor(KTextEditor::Cursor &cursor, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision=-1)=0
Transform a cursor from one revision to an other.
virtual QList< View * > views() const =0
Returns the views pre-casted to KTextEditor::Views.
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
Set the encoding for this document.
void reloaded(KTextEditor::Document *document)
Emitted after the current document was reloaded.
virtual KTextEditor::Cursor offsetToCursor(qsizetype offset) const =0
Retrives the cursor position for given offset NOTE: It will return an invalid cursor(-1,...
virtual bool isValidTextPosition(KTextEditor::Cursor cursor) const =0
Get whether cursor is a valid text position.
virtual void setModifiedOnDisk(ModifiedOnDiskReason reason)=0
Set the document's modified-on-disk state to reason.
virtual KTextEditor::Range wordRangeAt(KTextEditor::Cursor cursor) const =0
Get the text range for the word located under the text position cursor.
virtual qsizetype totalCharacters() const =0
Get the count of characters in the document.
void textChanged(KTextEditor::Document *document)
The document emits this signal whenever its text changes.
void marksChanged(KTextEditor::Document *document)
The document emits this signal whenever a mark mask changed.
virtual bool isDataRecoveryAvailable() const =0
Returns whether a recovery is available for the current document.
void editingFinished(KTextEditor::Document *document)
Editing transaction has finished.
void markClicked(KTextEditor::Document *document, KTextEditor::Mark mark, bool &handled)
The document emits this signal whenever the mark is left-clicked.
virtual bool setText(const QString &text)=0
Set the given text as new document content.
void markToolTipRequested(KTextEditor::Document *document, KTextEditor::Mark mark, QPoint position, bool &handled)
The document emits this signal whenever the mark is hovered using the mouse, and the receiver may sho...
virtual void setMarkDescription(MarkTypes mark, const QString &text)=0
Set the mark's description to text.
void viewCreated(KTextEditor::Document *document, KTextEditor::View *view)
This signal is emitted whenever the document creates a new view.
virtual MovingCursor * newMovingCursor(KTextEditor::Cursor position, MovingCursor::InsertBehavior insertBehavior=MovingCursor::MoveOnInsert)=0
Create a new moving cursor for this document.
void lineUnwrapped(KTextEditor::Document *document, int line)
A line got unwrapped.
virtual void readSessionConfig(const KConfigGroup &config, const QSet< QString > &flags=QSet< QString >())=0
Read session settings from the given config.
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 void setMarkIcon(MarkTypes markType, const QIcon &icon)=0
Set the mark's icon to icon.
virtual bool isLineTouched(int line) const =0
Check whether line was touched since the file was opened.
virtual void writeSessionConfig(KConfigGroup &config, const QSet< QString > &flags=QSet< QString >())=0
Write session settings to the config.
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 QString wordAt(KTextEditor::Cursor cursor) const =0
Get the word at the text position cursor.
virtual qsizetype cursorToOffset(KTextEditor::Cursor c) const =0
Retrives the offset for the given cursor position NOTE: It will return -1 if the cursor was invalid o...
virtual QVariant configValue(const QString &key)=0
Get a value for the key.
virtual void discardDataRecovery()=0
If recover data is available, calling discardDataRecovery() will discard the recover data and the rec...
virtual bool removeText(Range range, bool block=false)=0
Remove the text specified in range.
void aboutToInvalidateMovingInterfaceContent(KTextEditor::Document *document)
This signal is emitted before the ranges of a document are invalidated and the revisions are deleted ...
virtual void setEditableMarks(uint markMask)=0
Set the mark mask the user is allowed to toggle to markMask.
static int reservedMarkersCount()
Get the number of predefined mark types we have so far.
Definition document.h:1546
void editingStarted(KTextEditor::Document *document)
Editing transaction has started.
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 void addMark(int line, uint markType)=0
Add marks of type markType to line.
virtual View * createView(QWidget *parent, KTextEditor::MainWindow *mainWindow=nullptr)=0
Create a new view attached to parent.
virtual void unlockRevision(qint64 revision)=0
Release a revision.
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.
virtual void lockRevision(qint64 revision)=0
Lock a revision, this will keep it around until released again.
virtual AnnotationModel * annotationModel() const =0
returns the currently set AnnotationModel or 0 if there's none set
virtual QString highlightingMode() const =0
Return the name of the currently used mode.
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 lineWrapped(KTextEditor::Document *document, KTextEditor::Cursor position)
A line got wrapped.
virtual uint editableMarks() const =0
Get, which marks can be toggled by the user.
virtual QStringList textLines(Range range, bool block=false) const =0
Get the document content within the given range.
virtual void recoverData()=0
If recover data is available, calling recoverData() will trigger the recovery of the data.
virtual bool postMessage(Message *message)=0
Post message to the Document and its Views.
virtual QStringList modes() const =0
Return a list of the names of all possible modes.
virtual void transformCursor(int &line, int &column, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision=-1)=0
Transform a cursor from one revision to an other.
virtual QString markDescription(MarkTypes mark) const =0
Get the mark's description to text.
virtual const QHash< int, KTextEditor::Mark * > & marks()=0
Get a hash holding all marks in the document.
virtual bool insertText(KTextEditor::Cursor position, const QString &text, bool block=false)=0
Insert text at position.
void modifiedOnDisk(KTextEditor::Document *document, bool isModified, KTextEditor::Document::ModifiedOnDiskReason reason)
This signal is emitted whenever the document changed its modified-on-disk state.
virtual QByteArray checksum() const =0
Get the git hash of the Document's contents on disk.
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...
void readWriteChanged(KTextEditor::Document *document)
This signal is emitted whenever the readWrite state of a document changes.
void aboutToSave(KTextEditor::Document *document)
Emitted just before the document will be saved Any modifications made to the document at this point w...
virtual QStringList configKeys() const =0
Get a list of all available keys.
void markChanged(KTextEditor::Document *document, KTextEditor::Mark mark, KTextEditor::Document::MarkChangeAction action)
The document emits this signal whenever the mark changes.
virtual Cursor documentEnd() const =0
End position of the document.
virtual KSyntaxHighlighting::Theme::TextStyle defaultStyleAt(KTextEditor::Cursor position) const =0
Get the default style of the character located at position.
virtual void transformRange(KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors, MovingRange::EmptyBehavior emptyBehavior, qint64 fromRevision, qint64 toRevision=-1)=0
Transform a range from one revision to an other.
void aboutToReload(KTextEditor::Document *document)
Warn anyone listening that the current document is about to reload.
virtual QString highlightingModeAt(KTextEditor::Cursor position)=0
Get the highlight mode used at a given position in the document.
virtual QStringList embeddedHighlightingModes() const =0
Get all available highlighting modes for the current document.
void modifiedChanged(KTextEditor::Document *document)
This signal is emitted whenever the document's buffer changed from either state unmodified to modifie...
void markContextMenuRequested(KTextEditor::Document *document, KTextEditor::Mark mark, QPoint pos, bool &handled)
The document emits this signal whenever the mark is right-clicked to show a context menu.
virtual bool setMode(const QString &name)=0
Set the current mode of the document by giving its name.
void textInserted(KTextEditor::Document *document, KTextEditor::Cursor position, const QString &text)
Text got inserted.
virtual bool isLineSaved(int line) const =0
Check whether line currently contains only saved text.
virtual QStringList highlightingModes() const =0
Return a list of the names of all possible modes.
virtual bool isEditingTransactionRunning() const =0
Check whether an editing transaction is currently running.
virtual MovingRange * newMovingRange(Range range, MovingRange::InsertBehaviors insertBehaviors=MovingRange::DoNotExpand, MovingRange::EmptyBehavior emptyBehavior=MovingRange::AllowEmpty)=0
Create a new moving range for this document.
virtual QIcon markIcon(MarkTypes markType) const =0
Get the mark's icon.
virtual QString mode() const =0
Return the name of the currently used mode.
virtual QChar characterAt(KTextEditor::Cursor position) const =0
Get the character at text position cursor.
virtual bool insertText(KTextEditor::Cursor position, const QStringList &text, bool block=false)=0
Insert text at position.
virtual void removeMark(int line, uint markType)=0
Remove the mark mask of type markType from line.
virtual qint64 lastSavedRevision() const =0
Last revision the buffer got successful saved.
virtual bool isLineModified(int line) const =0
Check whether line currently contains unsaved data.
void documentUrlChanged(KTextEditor::Document *document)
This signal is emitted whenever the document URL changes.
virtual void setMark(int line, uint markType)=0
Set the line's mark types to markType.
virtual void setModifiedOnDiskWarning(bool on)=0
Control, whether the editor should show a warning dialog whenever a file was modified on disk.
void textRemoved(KTextEditor::Document *document, KTextEditor::Range range, const QString &text)
Text got removed.
This class allows the application that embeds the KTextEditor component to allow it to access parts o...
Definition mainwindow.h:47
Definition document.h:73
A Cursor which is bound to a specific Document, and maintains its position.
Definition movingcursor.h:55
InsertBehavior
Insert behavior of this cursor, should it stay if text is insert at its position or should it move.
Definition movingcursor.h:64
A range that is bound to a specific Document, and maintains its position.
Definition movingrange.h:131
An object representing a section of text, from one Cursor to another.
Definition include/ktexteditor/range.h:49
Q_SCRIPTABLE Q_NOREPLY void start()
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Definition katetextblock.h:18
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:05:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:05:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.