KTextEditor
ktexteditor.cpp
56 if (startIndex < 0 || endIndex < 0 || commaIndex < 0 || commaIndex < startIndex || endIndex < commaIndex || endIndex < startIndex) {
63 const int line = str.mid(startIndex + 1, commaIndex - startIndex - 1).toString().toInt(&ok1); // FIXME KF6, Qt 5.15.2 and higher
64 const int column = str.mid(commaIndex + 1, endIndex - commaIndex - 1).toString().toInt(&ok2); // FIXME KF6, Qt 5.15.2 and higher
93 bool Editor::registerVariableMatch(const QString &name, const QString &description, ExpandFunction expansionFunc)
99 bool Editor::registerVariablePrefix(const QString &prefix, const QString &description, ExpandFunction expansionFunc)
115 bool Editor::expandVariable(const QString &variable, KTextEditor::View *view, QString &output) const
125 void Editor::addVariableExpansion(const QVector<QWidget *> &widgets, const QStringList &variables) const
171 bool View::insertTemplate(const KTextEditor::Cursor &insertPosition, const QString &templateString, const QString &script)
311 void KTextEditor::InlineNoteProvider::inlineNoteActivated(const InlineNote ¬e, Qt::MouseButtons buttons, const QPoint &globalPos)
318 void KTextEditor::InlineNoteProvider::inlineNoteFocusInEvent(const KTextEditor::InlineNote ¬e, const QPoint &globalPos)
324 void KTextEditor::InlineNoteProvider::inlineNoteFocusOutEvent(const KTextEditor::InlineNote ¬e)
329 void KTextEditor::InlineNoteProvider::inlineNoteMouseMoveEvent(const KTextEditor::InlineNote ¬e, const QPoint &globalPos)
371 static_cast<KTextEditor::EditorPrivate *>(KTextEditor::Editor::instance())->cmdManager()->registerCommand(this);
378 static_cast<KTextEditor::EditorPrivate *>(KTextEditor::Editor::instance())->cmdManager()->unregisterCommand(this);
virtual Document * document() const =0
Get the view's document, that means the view is a view of the returned document.
int firstDisplayedLine(LineType lineType=RealLine) const
Get the first displayed line in the view.
Definition: ktexteditor.cpp:416
virtual QString name() const =0
Get a readable name for the config page.
KTextEditor::Cursor maxScrollPosition() const
Get the cursor corresponding to the maximum position the view can vertically scroll to.
Definition: ktexteditor.cpp:411
virtual int configPages() const
Get the number of available config pages.
Definition: ktexteditor.cpp:241
InlineNoteProvider * provider() const
The provider which created this note.
Definition: ktexteditor.cpp:335
KTextEditor::Cursor position() const
The cursor position of this note.
Definition: ktexteditor.cpp:360
int lastDisplayedLine(LineType lineType=RealLine) const
Get the last displayed line in the view.
Definition: ktexteditor.cpp:421
virtual bool supportsRange(const QString &cmd)
Find out if a given command can act on a range.
Definition: ktexteditor.cpp:382
QVector< KTextEditor::Cursor > cursorPositions() const
Get the view's current cursor positions.
Definition: ktexteditor.cpp:191
Type
virtual KCompletion * completionObject(KTextEditor::View *view, const QString &cmdname)
Return a KCompletion object that will substitute the command line default one while typing the first ...
Definition: ktexteditor.cpp:387
const KSyntaxHighlighting::Repository & repository() const
Get read-only access to the syntax highlighting repository the editor uses.
Definition: ktexteditor.cpp:140
virtual void inlineNoteMouseMoveEvent(const InlineNote ¬e, const QPoint &globalPos)
Invoked when the mouse cursor moves inside the note.
Definition: ktexteditor.cpp:329
QRect textAreaRect() const
Get the view's text area rectangle excluding border, scrollbars, etc.
Definition: ktexteditor.cpp:426
QString defaultEncoding() const
Get the current default encoding for this Editor part.
Definition: ktexteditor.cpp:87
QVector< KTextEditor::Range > selectionRanges() const
Get the ranges occupied by the current selections.
Definition: ktexteditor.cpp:201
QIcon fromTheme(const QString &name)
virtual bool insertText(const Cursor &position, const QString &text, bool block=false)=0
Insert text at position.
int width() const const
virtual void inlineNoteFocusInEvent(const InlineNote ¬e, const QPoint &globalPos)
Invoked when the mouse cursor moves into the note when it was outside before.
Definition: ktexteditor.cpp:318
typedef MouseButtons
virtual void processText(KTextEditor::View *view, const QString &text)
This is called by the command line each time the argument text for the command changed,...
Definition: ktexteditor.cpp:397
Command(const QStringList &cmds, QObject *parent=nullptr)
Constructor with parent.
KSyntaxHighlighting::Theme theme() const
Get the current active theme of this view.
Definition: ktexteditor.cpp:181
void addVariableExpansion(const QVector< QWidget * > &widgets, const QStringList &variables=QStringList()) const
Adds a QAction to the widget in widgets that whenever focus is gained.
Definition: ktexteditor.cpp:125
bool removeVariable(const QString &name)
Removes variable name.
Definition: katevariableexpansionmanager.cpp:281
void setHorizontalScrollPosition(int x)
Horizontally scroll view to position.
Definition: ktexteditor.cpp:406
bool underMouse() const
Returns whether the mouse cursor is currently over this note.
Definition: ktexteditor.cpp:306
bool expandVariable(const QString &variable, KTextEditor::View *view, QString &output) const
Expands a single variable, writing the expanded value to output.
Definition: ktexteditor.cpp:115
bool addVariable(const KTextEditor::Variable &variable)
Adds variable to the expansion list view.
Definition: katevariableexpansionmanager.cpp:258
virtual void inlineNoteFocusOutEvent(const InlineNote ¬e)
Invoked when the mouse cursor leaves the note.
Definition: ktexteditor.cpp:324
virtual bool wantsToProcessText(const QString &cmdname)
Check, whether the command wants to process text interactively for the given command with name cmdnam...
Definition: ktexteditor.cpp:392
bool registerVariableMatch(const QString &name, const QString &description, ExpandFunction expansionFunc)
Registers a variable called name for exact matches.
Definition: ktexteditor.cpp:93
virtual QString variable(const QString &name) const
Returns the value for the variable name.
bool unregisterVariableMatch(const QString &variable)
Unregisters a variable that was previously registered with registerVariableMatch().
Definition: ktexteditor.cpp:105
Definition: inlinenote.h:39
int toInt(bool *ok, int base) const const
void setStatusBarEnabled(bool enable)
Show/hide the status bar of the view.
Definition: ktexteditor.cpp:160
bool unregisterVariablePrefix(const QString &variable)
Unregisters a prefix of variable that was previously registered with registerVariableMatch().
Definition: ktexteditor.cpp:110
KSyntaxHighlighting::Theme theme() const
Get the current global theme.
Definition: ktexteditor.cpp:135
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Definition: katetextblock.h:22
void setSelections(const QVector< KTextEditor::Range > &ranges)
Set the view's selection to the range selection.
Definition: ktexteditor.cpp:196
virtual void inlineNoteActivated(const InlineNote ¬e, Qt::MouseButtons buttons, const QPoint &globalPos)
Invoked when a note is activated by the user.
Definition: ktexteditor.cpp:311
KateVariableExpansionManager * variableExpansionManager()
Returns the variable expansion manager.
Definition: kateglobal.cpp:456
void setViewInputMode(InputMode inputMode)
Set the view's new input mode.
Definition: ktexteditor.cpp:176
QString(*)(const QStringView &text, KTextEditor::View *view) ExpandFunction
Function that is called to expand a variable in text.
Definition: editor.h:309
KDB_EXPORT KDbVersionInfo version()
virtual ~TextHintProvider()
Virtual destructor to allow inheritance.
const KTextEditor::View * view() const
The View this note is shown in.
Definition: ktexteditor.cpp:340
bool insertTemplate(const KTextEditor::Cursor &insertPosition, const QString &templateString, const QString &script=QString())
Insert a template into the document.
Definition: ktexteditor.cpp:171
bool registerVariablePrefix(const QString &prefix, const QString &description, ExpandFunction expansionFunc)
Registers a variable for arbitrary text that matches the specified prefix.
Definition: ktexteditor.cpp:99
virtual ConfigPage * configPage(int number, QWidget *parent)
Get the config page with the number, config pages from 0 to configPages()-1 are available if configPa...
Definition: ktexteditor.cpp:246
virtual bool blockSelection() const =0
Get the status of the selection mode.
KTextEditor::EditorPrivate One instance of this class is hold alive during a kate part session,...
Definition: kateglobal.h:63
virtual QSize inlineNoteSize(const InlineNote ¬e) const =0
Width to be reserved for the note in the text.
~InlineNoteProvider() override
Virtual destructor to allow inheritance.
Internal data container for KTextEditor::InlineNote interface.
Definition: inlinenotedata.h:24
virtual bool insertText(const QString &text)
This is a convenience function which inserts text at the view's current cursor position.
Definition: ktexteditor.cpp:145
void setCursorPositions(const QVector< KTextEditor::Cursor > &positions)
Set the view's new cursors to positions.
Definition: ktexteditor.cpp:186
virtual Cursor cursorPosition() const =0
Get the view's current cursor position.
QString mid(int position, int n) const const
void expandText(const QString &text, KTextEditor::View *view, QString &output) const
Expands arbitrary text that may contain arbitrary many variables.
Definition: ktexteditor.cpp:120
A source of inline notes for a document.
Definition: inlinenoteprovider.h:28
virtual ~SessionConfigInterface()
Virtual destructor.
void setScrollPosition(KTextEditor::Cursor &cursor)
Scroll view to cursor.
Definition: ktexteditor.cpp:401
virtual QString fullName() const
Get a readable full name for the config page.
Definition: ktexteditor.cpp:214
cursor
virtual ~ModificationInterface()
Virtual destructor.
static Cursor fromString(const QString &str) Q_DECL_NOEXCEPT
Returns a Cursor created from the string str containing the format "(line, column)".
Definition: cursor.h:138
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Dec 6 2023 03:52:04 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Dec 6 2023 03:52:04 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.