KTextEditor
#include <katedocument.h>

Classes | |
class | AbstractAnnotationItemDelegate |
class | AnnotationModel |
class | Application |
class | Attribute |
class | AttributeBlock |
class | CodeCompletionModel |
class | CodeCompletionModelControllerInterface |
class | Command |
class | ConfigPage |
class | Cursor |
class | Document |
class | DocumentCursor |
class | Editor |
class | EditorPrivate |
class | FoldingInterface |
class | InlineNote |
class | InlineNoteProvider |
class | LineRange |
class | MainWindow |
class | Mark |
class | Message |
class | MovingCursor |
class | MovingRange |
class | MovingRangeFeedback |
class | Plugin |
class | Range |
class | SessionConfigInterface |
class | StyleOptionAnnotationItem |
class | TextHintProvider |
class | Variable |
class | View |
Public Types | |
enum | caretStyles { Line, Block, Underline, Half } |
enum | CommentType { UnComment = -1, ToggleComment = 0, Comment = 1 } |
enum | EditingPositionKind { Previous, Next } |
enum | NewLineIndent { Indent, NoIndent } |
enum | NewLinePos { Normal, Above, Below } |
typedef QList< QPair< int, int > > | OffsetList |
enum | SearchOption { Default = 0, Regex = 1 << 1, CaseInsensitive = 1 << 4, Backwards = 1 << 5, EscapeSequences = 1 << 10, WholeWords = 1 << 11, MaxSearchOption = 1 << 31 } |
typedef QFlags< SearchOption > | SearchOptions |
enum | TextTransform { Uppercase, Lowercase, Capitalize } |
Signals | |
void | aboutToRemoveText (KTextEditor::Range) |
void | annotationModelChanged (KTextEditor::AnnotationModel *, KTextEditor::AnnotationModel *) |
void | charactersSemiInteractivelyInserted (KTextEditor::Cursor position, const QString &text) |
void | defaultDictionaryChanged (KTextEditor::DocumentPrivate *document) |
void | dictionaryRangesPresent (bool yesNo) |
void | editLineUnWrapped (int line, int col) |
void | editLineWrapped (int line, int col, int len) |
void | loaded (KTextEditor::DocumentPrivate *document) |
void | textInsertedRange (KTextEditor::Document *document, KTextEditor::Range range) |
void | textRemoved (KTextEditor::Document *document, KTextEditor::Range range, const QString &oldText) |
void | undoChanged () |
Public Slots | |
void | addMark (int line, uint markType) override |
bool | clear () override |
void | clearDictionaryRanges () |
void | clearEditingPosStack () |
void | clearMark (int line) override |
void | clearMarks () override |
bool | documentReload () override |
bool | documentSave () override |
bool | documentSaveAs () override |
bool | documentSaveAsWithEncoding (const QString &encoding) |
void | documentSaveCopyAs () |
bool | handleMarkClick (int line) |
bool | handleMarkContextMenu (int line, QPoint position) |
bool | insertLine (int line, const QString &s) override |
bool | insertLines (int line, const QStringList &s) override |
bool | insertText (KTextEditor::Cursor position, const QString &s, bool block=false) override |
bool | insertText (KTextEditor::Cursor position, const QStringList &text, bool block=false) override |
void | messageDestroyed (KTextEditor::Message *message) |
void | onTheFlySpellCheckingEnabled (bool enable) |
void | openWithLineLengthLimitOverride () |
bool | print () override |
void | printPreview () override |
void | redo () |
void | refreshOnTheFlyCheck (KTextEditor::Range range=KTextEditor::Range::invalid()) |
bool | removeLine (int line) override |
void | removeMark (int line, uint markType) override |
bool | removeText (KTextEditor::Range range, bool block=false) override |
bool | replaceText (KTextEditor::Range r, const QStringList &l, bool b) override |
bool | replaceText (KTextEditor::Range range, const QString &s, bool block=false) override |
void | requestMarkTooltip (int line, QPoint position) |
bool | save () override |
void | saveEditingPositions (const KTextEditor::Cursor cursor) |
void | setDefaultDictionary (const QString &dict) |
void | setDictionary (const QString &dict, KTextEditor::Range range) |
void | setDictionary (const QString &dict, KTextEditor::Range range, bool blockmode) |
void | setEditableMarks (uint markMask) override |
void | setMark (int line, uint markType) override |
void | setMarkDescription (Document::MarkTypes, const QString &) override |
void | setMarkIcon (Document::MarkTypes markType, const QIcon &icon) override |
void | setMarkPixmap (Document::MarkTypes, const QPixmap &) override |
void | setPageUpDownMovesCursor (bool on) |
bool | setText (const QString &) override |
bool | setText (const QStringList &text) override |
void | setWordWrap (bool on) |
void | setWordWrapAt (uint col) |
virtual void | slotModifiedOnDisk (KTextEditor::View *v=nullptr) |
void | slotQueryClose_save (bool *handled, bool *abortClosing) |
void | tagLine (int line) |
void | tagLines (KTextEditor::LineRange lineRange) |
void | undo () |
Public Member Functions | |
virtual KTextEditor::View * | activeView () const |
void | addView (KTextEditor::View *) |
void | align (KTextEditor::ViewPrivate *view, KTextEditor::Range range) |
void | alignOn (KTextEditor::Range range, const QString &pattern, bool blockwise) |
KTextEditor::AnnotationModel * | annotationModel () const override |
KToggleAction * | autoReloadToggleAction () |
void | backspace (KTextEditor::ViewPrivate *view) |
void | bomSetByUser () |
KateBuffer & | buffer () |
void | bufferHlChanged () |
QChar | characterAt (KTextEditor::Cursor position) const override |
QByteArray | checksum () const override |
void | clearMisspellingForWord (const QString &word) |
bool | closeUrl () override |
void | comment (KTextEditor::ViewPrivate *view, uint line, uint column, CommentType change) |
KateDocumentConfig * | config () |
KateDocumentConfig * | config () const |
QStringList | configKeys () const override |
QVariant | configValue (const QString &key) override |
bool | containsCharacterEncoding (KTextEditor::Range range) |
KTextEditor::View * | createView (QWidget *parent, KTextEditor::MainWindow *mainWindow=nullptr) override |
int | cursorToOffset (KTextEditor::Cursor c) const |
QString | decodeCharacters (KTextEditor::Range range, KTextEditor::DocumentPrivate::OffsetList &decToEncOffsetList, KTextEditor::DocumentPrivate::OffsetList &encToDecOffsetList) |
QString | defaultDictionary () const |
KSyntaxHighlighting::Theme::TextStyle | defaultStyleAt (KTextEditor::Cursor position) const override |
KSyntaxHighlighting::Theme::TextStyle | defStyleNum (int line, int column) |
void | del (KTextEditor::ViewPrivate *view, const KTextEditor::Cursor) |
void | delayAutoReload () |
QString | dictionaryForMisspelledRange (KTextEditor::Range range) const |
QList< QPair< KTextEditor::MovingRange *, QString > > | dictionaryRanges () const |
void | discardDataRecovery () override |
KTextEditor::Cursor | documentEnd () const override |
QString | documentName () const override |
DocumentPrivate (bool bSingleViewMode=false, bool bReadOnly=false, QWidget *parentWidget=nullptr, QObject *=nullptr) | |
DocumentPrivate (const KPluginMetaData &data, bool bSingleViewMode=false, bool bReadOnly=false, QWidget *parentWidget=nullptr, QObject *=nullptr) | |
uint | editableMarks () const override |
bool | editEnd () |
bool | editInsertLine (int line, const QString &s) |
bool | editInsertText (int line, int col, const QString &s) |
bool | editMarkLineAutoWrapped (int line, bool autowrapped) |
bool | editRemoveLine (int line) |
bool | editRemoveLines (int from, int to) |
bool | editRemoveText (int line, int col, int len) |
bool | editStart () |
bool | editUnWrapLine (int line, bool removeLine=true, int length=0) |
bool | editWrapLine (int line, int col, bool newLine=true, bool *newLineAdded=nullptr) |
QStringList | embeddedHighlightingModes () const override |
QString | encoding () const override |
QString | fileType () const |
KTextEditor::Range | findMatchingBracket (const KTextEditor::Cursor start, int maxLines) |
int | findTouchedLine (int startLine, bool down) |
int | fromVirtualColumn (const KTextEditor::Cursor) const |
int | fromVirtualColumn (int line, int column) const |
KateHighlighting * | highlight () const |
QString | highlightingMode () const override |
QString | highlightingModeAt (KTextEditor::Cursor position) override |
QStringList | highlightingModes () const override |
QString | highlightingModeSection (int index) const override |
void | indent (KTextEditor::Range range, int change) |
void | inputMethodEnd () |
void | inputMethodStart () |
void | insertTab (KTextEditor::ViewPrivate *view, const KTextEditor::Cursor) |
bool | isAutoReload () |
bool | isComment (int line, int column) |
bool | isDataRecoveryAvailable () const override |
bool | isEditingTransactionRunning () const override |
bool | isEditRunning () const |
bool | isLineModified (int line) const override |
bool | isLineSaved (int line) const override |
bool | isLineTouched (int line) const override |
bool | isModifiedOnDisc () |
bool | isOnTheFlySpellCheckingEnabled () const |
bool | isValidTextPosition (KTextEditor::Cursor cursor) const override |
void | joinLines (uint first, uint last) |
Kate::TextLine | kateTextLine (int i) |
KTextEditor::Cursor | lastEditingPosition (EditingPositionKind nextOrPrevious, KTextEditor::Cursor) |
int | lastLine () const |
qint64 | lastSavedRevision () const override |
QString | line (int line) const override |
int | lineLength (int line) const override |
int | lineLengthLimit () const |
int | lines () const override |
void | lockRevision (qint64 revision) override |
uint | mark (int line) override |
virtual QColor | markColor (Document::MarkTypes) const |
QString | markDescription (Document::MarkTypes) const override |
QIcon | markIcon (Document::MarkTypes markType) const override |
QPixmap | markPixmap (Document::MarkTypes) const override |
const QHash< int, KTextEditor::Mark * > & | marks () override |
QString | mimeType () override |
QString | mode () const override |
QStringList | modes () const override |
QString | modeSection (int index) const override |
bool | multiPaste (KTextEditor::ViewPrivate *view, const QStringList &texts) |
void | newLine (KTextEditor::ViewPrivate *view, NewLineIndent indent=NewLineIndent::Indent, NewLinePos newLinePos=Normal) |
KTextEditor::MovingCursor * | newMovingCursor (KTextEditor::Cursor position, KTextEditor::MovingCursor::InsertBehavior insertBehavior=KTextEditor::MovingCursor::MoveOnInsert) override |
KTextEditor::MovingRange * | newMovingRange (KTextEditor::Range range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors=KTextEditor::MovingRange::DoNotExpand, KTextEditor::MovingRange::EmptyBehavior emptyBehavior=KTextEditor::MovingRange::AllowEmpty) override |
KTextEditor::Cursor | offsetToCursor (int offset) const |
KateOnTheFlyChecker * | onTheFlySpellChecker () const |
bool | openFile () override |
bool | openUrl (const QUrl &url) override |
bool | ownedView (KTextEditor::ViewPrivate *) |
bool | pageUpDownMovesCursor () const |
void | paste (KTextEditor::ViewPrivate *view, const QString &text) |
Kate::TextLine | plainKateTextLine (int i) |
void | popEditState () |
bool | postMessage (KTextEditor::Message *message) override |
void | pushEditState () |
bool | queryClose () override |
KTextEditor::Range | rangeOnLine (KTextEditor::Range range, int line) const |
bool | readOnly () const |
void | readSessionConfig (const KConfigGroup &config, const QSet< QString > &flags=QSet< QString >()) override |
void | recoverData () override |
uint | redoCount () const |
void | rememberUserDidSetIndentationMode () |
void | removeAllTrailingSpaces () |
void | removeView (KTextEditor::View *) |
void | repaintViews (bool paintOnlyDirty=true) |
void | replaceCharactersByEncoding (KTextEditor::Range range) |
qint64 | revision () const override |
bool | saveAs (const QUrl &url) override |
bool | saveFile () override |
QVector< KTextEditor::Range > | searchText (KTextEditor::Range range, const QString &pattern, const KTextEditor::SearchOptions options) const |
void | setActiveTemplateHandler (KateTemplateHandler *handler) |
void | setActiveView (KTextEditor::View *) |
void | setAnnotationModel (KTextEditor::AnnotationModel *model) override |
void | setConfigValue (const QString &key, const QVariant &value) override |
void | setDontChangeHlOnSave () |
bool | setEncoding (const QString &e) override |
bool | setHighlightingMode (const QString &name) override |
bool | setMode (const QString &name) override |
void | setModified (bool m) override |
void | setModifiedOnDisk (ModifiedOnDiskReason reason) override |
void | setModifiedOnDiskWarning (bool on) override |
void | setReadWrite (bool rw=true) override |
void | setUndoMergeAllEdits (bool merge) |
virtual void | setVariable (const QString &name, const QString &value) |
bool | singleViewMode () const |
Kate::SwapFile * | swapFile () |
void | swapTextRanges (KTextEditor::Range firstWord, KTextEditor::Range secondWord) |
QString | text () const override |
QString | text (KTextEditor::Range range, bool blockwise=false) const override |
QStringList | textLines (KTextEditor::Range range, bool block=false) const override |
int | totalCharacters () const override |
int | toVirtualColumn (const KTextEditor::Cursor) const |
int | toVirtualColumn (int line, int column) const |
void | transform (KTextEditor::ViewPrivate *view, KTextEditor::Cursor, TextTransform) |
void | transformCursor (int &line, int &column, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision=-1) override |
void | transformCursor (KTextEditor::Cursor &cursor, KTextEditor::MovingCursor::InsertBehavior insertBehavior, qint64 fromRevision, qint64 toRevision=-1) override |
void | transformRange (KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors, KTextEditor::MovingRange::EmptyBehavior emptyBehavior, qint64 fromRevision, qint64 toRevision=-1) override |
void | transpose (const KTextEditor::Cursor) |
void | typeChars (KTextEditor::ViewPrivate *view, QString chars) |
uint | undoCount () const |
KateUndoManager * | undoManager () |
void | unlockRevision (qint64 revision) override |
void | updateConfig () |
bool | updateFileType (const QString &newType, bool user=false) |
void | userSetEncodingForNextReload () |
virtual QString | variable (const QString &name) const |
QList< KTextEditor::View * > | views () const override |
QWidget * | widget () override |
QString | wordAt (KTextEditor::Cursor cursor) const override |
KTextEditor::Range | wordRangeAt (KTextEditor::Cursor cursor) const override |
bool | wordWrap () const |
uint | wordWrapAt () const |
bool | wrapParagraph (int first, int last) |
bool | wrapText (int startLine, int endLine) |
void | writeSessionConfig (KConfigGroup &config, const QSet< QString > &flags=QSet< QString >()) override |
Static Public Member Functions | |
static int | computePositionWrtOffsets (const OffsetList &offsetList, int pos) |
Protected Member Functions | |
void | deleteDictionaryRange (KTextEditor::MovingRange *movingRange) |
void | rangeEmpty (KTextEditor::MovingRange *movingRange) override |
void | rangeInvalid (KTextEditor::MovingRange *movingRange) override |
Protected Attributes | |
QString | m_defaultDictionary |
QList< QPair< KTextEditor::MovingRange *, QString > > | m_dictionaryRanges |
KateOnTheFlyChecker * | m_onTheFlyChecker = nullptr |
KateUndoManager *const | m_undoManager |
Detailed Description
Backend of KTextEditor::Document related public KTextEditor interfaces.
- Warning
- This file is private API and not part of the public KTextEditor interfaces.
Definition at line 65 of file katedocument.h.
Member Typedef Documentation
◆ SearchOptions
typedef QFlags< SearchOption > KTextEditor::SearchOptions |
Stores a combination of SearchOption values.
Definition at line 66 of file document.h.
Member Enumeration Documentation
◆ SearchOption
Search flags for use with searchText.
Modifies the behavior of searchText. By default it is searched for a case-sensitive plaintext pattern, without processing of escape sequences, with "whole words" off, in forward direction, within a non-block-mode text range.
- See also
- SearchOptions
Definition at line 48 of file document.h.
Member Function Documentation
◆ bomSetByUser()
void KTextEditor::bomSetByUser | ( | ) |
Set that the BOM marker is forced via the tool menu.
◆ buffer()
|
inline |
Get access to buffer of this document.
Is needed to create cursors and ranges for example.
- Returns
- document buffer
Definition at line 1096 of file katedocument.h.
◆ checksum()
|
override |
Returns a git compatible sha1 checksum of this document on disk.
- Returns
- checksum for this document on disk
◆ clearEditingPosStack
|
slot |
Removes all the elements in m_editingStack of the respective document.
◆ config()
|
inline |
Configuration.
Definition at line 1161 of file katedocument.h.
◆ decodeCharacters()
QString KTextEditor::decodeCharacters | ( | KTextEditor::Range | range, |
KTextEditor::DocumentPrivate::OffsetList & | decToEncOffsetList, | ||
KTextEditor::DocumentPrivate::OffsetList & | encToDecOffsetList | ||
) |
The first OffsetList is from decoded to encoded, and the second OffsetList from encoded to decoded.
◆ defaultStyleAt()
|
override |
Get the default style of the character located at position
.
If position
is not a valid text position, the default style KSyntaxHighlighting::Theme::TextStyle::Normal is returned.
- Note
- Further information about the colors of default styles depend on the currently chosen schema. Since each View may have a different color schema, the color information can be obtained through View::defaultStyleAttribute() and View::lineAttributes().
- Parameters
-
position text position
- Returns
- default style, see enum KSyntaxHighlighting::Theme::TextStyle
◆ documentReload
|
overrideslot |
Reloads the current document from disk if possible.
◆ editEnd()
bool KTextEditor::editEnd | ( | ) |
End a editor operation.
- See also
- editStart()
◆ editInsertLine()
bool KTextEditor::editInsertLine | ( | int | line, |
const QString & | s | ||
) |
Insert a string at the given line.
- Parameters
-
line line number s string to insert
- Returns
- true on success
◆ editInsertText()
bool KTextEditor::editInsertText | ( | int | line, |
int | col, | ||
const QString & | s | ||
) |
Add a string in the given line/column.
- Parameters
-
line line number col column s string to be inserted
- Returns
- true on success
◆ editLineUnWrapped
|
signal |
Emitted each time text from nextLine
was upwrapped onto line
.
◆ editLineWrapped
|
signal |
Emitted when text from line
was wrapped at position pos onto line nextLine
.
◆ editMarkLineAutoWrapped()
bool KTextEditor::editMarkLineAutoWrapped | ( | int | line, |
bool | autowrapped | ||
) |
Mark line
as autowrapped
.
This is necessary if static word warp is enabled, because we have to know whether to insert a new line or add the wrapped words to the following line.
- Parameters
-
line line number autowrapped autowrapped?
- Returns
- true on success
◆ editRemoveLine()
bool KTextEditor::editRemoveLine | ( | int | line | ) |
Remove a line.
- Parameters
-
line line number
- Returns
- true on success
◆ editRemoveText()
bool KTextEditor::editRemoveText | ( | int | line, |
int | col, | ||
int | len | ||
) |
Remove a string in the given line/column.
- Parameters
-
line line number col column len length of text to be removed
- Returns
- true on success
◆ editStart()
bool KTextEditor::editStart | ( | ) |
Enclose editor actions with editStart()
and editEnd()
to group them.
◆ editUnWrapLine()
bool KTextEditor::editUnWrapLine | ( | int | line, |
bool | removeLine = true , |
||
int | length = 0 |
||
) |
Unwrap line
.
If removeLine
is true, we force to join the lines. If removeLine
is true, length
is ignored (eg not needed).
- Parameters
-
line line number removeLine if true, force to remove the next line
- Returns
- true on success
◆ editWrapLine()
bool KTextEditor::editWrapLine | ( | int | line, |
int | col, | ||
bool | newLine = true , |
||
bool * | newLineAdded = nullptr |
||
) |
Wrap line
.
If newLine
is true, ignore the textline's flag KateTextLine::flagAutoWrapped and force a new line. Whether a new line was needed/added you can grab with newLineAdded
.
- Parameters
-
line line number col column newLine if true, force a new line newLineAdded return value is true, if new line was added (may be 0)
- Returns
- true on success
◆ findTouchedLine()
int KTextEditor::findTouchedLine | ( | int | startLine, |
bool | down | ||
) |
Find the next modified/saved line, starting at startLine
.
If down
is true, the search is performed downwards, otherwise upwards.
- Returns
- the touched line in the requested search direction, or -1 if not found
◆ handleMarkClick
|
slot |
Returns true if the click on the mark should not be further processed.
◆ handleMarkContextMenu
|
slot |
Returns true if the context-menu event should not further be processed.
◆ highlightingMode()
|
override |
Return the name of the currently used mode.
- Returns
- name of the used mode
◆ highlightingModes()
|
override |
Return a list of the names of all possible modes.
- Returns
- list of mode names
◆ highlightingModeSection()
|
override |
Returns the name of the section for a highlight given its index
in the highlight list (as returned by highlightModes()).
You can use this function to build a tree of the highlight names, organized in sections.
- Parameters
-
index in the highlight list for which to find the section name.
◆ isModifiedOnDisc()
|
inline |
- Returns
- whether the document is modified on disk since last saved
Definition at line 965 of file katedocument.h.
◆ joinLines()
void KTextEditor::joinLines | ( | uint | first, |
uint | last | ||
) |
Unwrap a range of lines.
◆ kateTextLine()
Kate::TextLine KTextEditor::kateTextLine | ( | int | i | ) |
Same as plainKateTextLine(), except that it is made sure the line is highlighted.
◆ lastEditingPosition()
KTextEditor::Cursor KTextEditor::lastEditingPosition | ( | EditingPositionKind | nextOrPrevious, |
KTextEditor::Cursor | |||
) |
Returns the next or previous position cursor in this document from the stack depending on the argument passed.
- Returns
- cursor invalid if m_editingStack empty
◆ lastLine()
|
inline |
gets the last line number (lines() - 1)
Definition at line 768 of file katedocument.h.
◆ lastSavedRevision()
|
override |
Last revision the buffer got successful saved.
- Returns
- last revision buffer got saved, -1 if none
◆ lineLengthLimit()
int KTextEditor::lineLengthLimit | ( | ) | const |
reads the line length limit from config, if it is not overridden
◆ lockRevision()
|
override |
Lock a revision, this will keep it around until released again.
But all revisions will always be cleared on buffer clear() (and therefor load())
- Parameters
-
revision revision to lock
◆ mimeType()
|
override |
Tries to detect mime-type based on file name and content of buffer.
- Returns
- the name of the mimetype for the document.
◆ mode()
|
override |
Return the name of the currently used mode.
- Returns
- name of the used mode
◆ modes()
|
override |
Return a list of the names of all possible modes.
- Returns
- list of mode names
◆ modeSection()
|
override |
Returns the name of the section for a mode given its index
in the highlight list (as returned by modes()).
You can use this function to build a tree of the mode names, organized in sections.
- Parameters
-
index index in the highlight list for which to find the section name.
◆ newMovingCursor()
|
override |
Create a new moving cursor for this document.
- Parameters
-
position position of the moving cursor to create insertBehavior insertion behavior
- Returns
- new moving cursor for the document
◆ newMovingRange()
|
override |
Create a new moving range for this document.
- Parameters
-
range range of the moving range to create insertBehaviors insertion behaviors emptyBehavior behavior on becoming empty
- Returns
- new moving range for the document
◆ openFile()
|
override |
open the file obtained by the kparts framework the framework abstracts the loading of remote files
- Returns
- success
◆ plainKateTextLine()
Kate::TextLine KTextEditor::plainKateTextLine | ( | int | i | ) |
Return line lineno
.
Highlighting of returned line might be out-dated, which may be sufficient for pure text manipulation functions, like search/replace. If you require highlighting to be up to date, call ensureHighlighted prior to this method.
◆ rangeEmpty()
|
overrideprotectedvirtual |
The range is now empty (ie.
the start and end cursors are the same). If the range has invalidateIfEmpty set, this will never be emitted, but instead rangeInvalid is triggered. You may delete the range inside this method, but don't alter the range here (for example by using setRange).
- Parameters
-
range pointer to the range which generated the notification.
Reimplemented from KTextEditor::MovingRangeFeedback.
◆ rangeInvalid()
|
overrideprotectedvirtual |
The range is now invalid (ie.
the start and end cursors are invalid). You may delete the range inside this method, but don't alter the range here (for example by using setRange).
- Parameters
-
range pointer to the range which generated the notification.
Reimplemented from KTextEditor::MovingRangeFeedback.
◆ readSessionConfig()
|
override |
Read session settings from the given config
.
Known flags: "SkipUrl" => don't save/restore the file "SkipMode" => don't save/restore the mode "SkipHighlighting" => don't save/restore the highlighting "SkipEncoding" => don't save/restore the encoding
- Parameters
-
config read the session settings from this KConfigGroup flags additional flags
- See also
- writeSessionConfig()
◆ rememberUserDidSetIndentationMode()
|
inline |
set indentation mode by user this will remember that a user did set it and will avoid reset on save
Definition at line 1105 of file katedocument.h.
◆ removeAllTrailingSpaces()
void KTextEditor::removeAllTrailingSpaces | ( | ) |
This function doesn't check for config and is available for use all the time via an action.
◆ removeView()
void KTextEditor::removeView | ( | KTextEditor::View * | ) |
removes the view from the list of views.
The view is not deleted. That's your job. Or, easier, just delete the view in the first place. It will remove itself. TODO: this could be converted to a private slot connected to the view's destroyed() signal. It is not currently called anywhere except from the KTextEditor::ViewPrivate destructor.
◆ revision()
|
override |
Current revision.
- Returns
- current revision
◆ saveEditingPositions
|
slot |
Saves the editing positions into the stack.
If the consecutive editings happens in the same line, then remove the previous and add the new one with updated column no.
◆ saveFile()
|
override |
save the file obtained by the kparts framework the framework abstracts the uploading of remote files
- Returns
- success
◆ setDontChangeHlOnSave()
void KTextEditor::setDontChangeHlOnSave | ( | ) |
allow to mark, that we changed hl on user wish and should not reset it atm used for the user visible menu to select highlightings
◆ setHighlightingMode()
|
override |
Set the current mode of the document by giving its name.
- Parameters
-
name name of the mode to use for this document
- Returns
- true on success, otherwise false
◆ setMode()
|
override |
Set the current mode of the document by giving its name.
- Parameters
-
name name of the mode to use for this document
- Returns
- true on success, otherwise false
◆ setVariable()
Set the variable name
to value
.
Setting and changing a variable has immediate effect on the Document. For instance, setting the variable indent-mode to cstyle will immediately cause the Document to load the C Style indenter.
// TODO KF6: expose in KTextEditor::Document?
- Parameters
-
name the variable name value the value to be set
- See also
- variable()
◆ slotModifiedOnDisk
|
virtualslot |
Ask the user what to do, if the file has been modified on disk.
Reimplemented from KTextEditor::Document.
◆ textInsertedRange
|
signal |
The document
emits this signal whenever text was inserted.
The insertion occurred at range.start(), and new text now occupies up to range.end().
- Parameters
-
document document which emitted this signal range range that the newly inserted text occupies
- See also
- insertText(), insertLine()
◆ textRemoved
|
signal |
The document
emits this signal whenever range
was removed, i.e.
text was removed.
- Parameters
-
document document which emitted this signal range range that the removed text previously occupied oldText the text that has been removed
- See also
- removeText(), removeLine(), clear()
◆ transform()
void KTextEditor::transform | ( | KTextEditor::ViewPrivate * | view, |
KTextEditor::Cursor | , | ||
TextTransform | |||
) |
Handling uppercase, lowercase and capitalize for the view.
If there is a selection, that is transformed, otherwise for uppercase or lowercase the character right of the cursor is transformed, for capitalize the word under the cursor is transformed.
◆ transformCursor() [1/2]
|
override |
Transform a cursor from one revision to an other.
- Parameters
-
line line number of the cursor to transform column column number of the cursor to transform insertBehavior behavior of this cursor on insert of text at its position fromRevision from this revision we want to transform toRevision to this revision we want to transform, default of -1 is current revision
◆ transformCursor() [2/2]
|
override |
Transform a cursor from one revision to an other.
- Parameters
-
cursor cursor to transform insertBehavior behavior of this cursor on insert of text at its position fromRevision from this revision we want to transform toRevision to this revision we want to transform, default of -1 is current revision
◆ transformRange()
|
override |
Transform a range from one revision to an other.
- Parameters
-
range range to transform insertBehaviors behavior of this range on insert of text at its position emptyBehavior behavior on becoming empty fromRevision from this revision we want to transform toRevision to this revision we want to transform, default of -1 is current revision
◆ typeChars()
void KTextEditor::typeChars | ( | KTextEditor::ViewPrivate * | view, |
QString | chars | ||
) |
Type chars in a view.
Characters are filtered in KateViewInternal::isAcceptableInput() before calling typeChars.
- Parameters
-
view view that received the input chars characters to type
◆ unlockRevision()
|
override |
Release a revision.
- Parameters
-
revision revision to release
◆ updateFileType()
bool KTextEditor::updateFileType | ( | const QString & | newType, |
bool | user = false |
||
) |
- Returns
- false if
newType
is an invalid mode.
◆ userSetEncodingForNextReload()
|
inline |
User did set encoding for next reload => enforce it!
Definition at line 1113 of file katedocument.h.
◆ variable()
Returns the value for the variable name
.
If the Document does not have a variable called name
, an empty QString() is returned.
// TODO KF6: expose in KTextEditor::Document?
- Parameters
-
name variable to query
- Returns
- value of the variable
name
- See also
- setVariable()
◆ widget()
|
override |
- Returns
- The widget defined by this part, set by setWidget().
◆ wrapParagraph()
bool KTextEditor::wrapParagraph | ( | int | first, |
int | last | ||
) |
Wrap lines touched by the selection with respect of existing paragraphs.
To do so will the paragraph prior to the wrap joined as one single line which cause an almost perfect wrapped paragraph as long as there are no unneeded spaces exist or some formatting like this comment block. Without any selection the current line is wrapped. Empty lines around each paragraph are untouched.
- Parameters
-
first line to begin wrapping last line to stop wrapping
- Returns
- true on success
◆ wrapText()
bool KTextEditor::wrapText | ( | int | startLine, |
int | endLine | ||
) |
Warp a line.
- Parameters
-
startLine line to begin wrapping endLine line to stop wrapping
- Returns
- true on success
◆ writeSessionConfig()
|
override |
Write session settings to the config
.
See readSessionConfig() for more details.
- Parameters
-
config write the session settings to this KConfigGroup flags additional flags
- See also
- readSessionConfig()
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Jun 7 2023 03:51:44 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.