KTextEditor
ktexteditor.cpp
48 if (startIndex < 0 || endIndex < 0 || commaIndex < 0 || commaIndex < startIndex || endIndex < commaIndex || endIndex < startIndex) {
101 bool Editor::registerVariableMatch(const QString &name, const QString &description, ExpandFunction expansionFunc)
107 bool Editor::registerVariablePrefix(const QString &prefix, const QString &description, ExpandFunction expansionFunc)
123 bool Editor::expandVariable(const QString &variable, KTextEditor::View *view, QString &output) const
133 void Editor::addVariableExpansion(const QVector<QWidget *> &widgets, const QStringList &variables) const
179 bool View::insertTemplate(KTextEditor::Cursor insertPosition, const QString &templateString, const QString &script)
303 void KTextEditor::InlineNoteProvider::inlineNoteActivated(const InlineNote ¬e, Qt::MouseButtons buttons, const QPoint &globalPos)
310 void KTextEditor::InlineNoteProvider::inlineNoteFocusInEvent(const KTextEditor::InlineNote ¬e, const QPoint &globalPos)
316 void KTextEditor::InlineNoteProvider::inlineNoteFocusOutEvent(const KTextEditor::InlineNote ¬e)
321 void KTextEditor::InlineNoteProvider::inlineNoteMouseMoveEvent(const KTextEditor::InlineNote ¬e, const QPoint &globalPos)
363 static_cast<KTextEditor::EditorPrivate *>(KTextEditor::Editor::instance())->cmdManager()->registerCommand(this);
370 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:408
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:403
virtual int configPages() const
Get the number of available config pages.
Definition: ktexteditor.cpp:249
InlineNoteProvider * provider() const
The provider which created this note.
Definition: ktexteditor.cpp:327
KTextEditor::Cursor position() const
The cursor position of this note.
Definition: ktexteditor.cpp:352
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
int lastDisplayedLine(LineType lineType=RealLine) const
Get the last displayed line in the view.
Definition: ktexteditor.cpp:413
virtual bool supportsRange(const QString &cmd)
Find out if a given command can act on a range.
Definition: ktexteditor.cpp:374
QVector< KTextEditor::Cursor > cursorPositions() const
Get the view's current cursor positions.
Definition: ktexteditor.cpp:199
Type
bool insertTemplate(KTextEditor::Cursor insertPosition, const QString &templateString, const QString &script=QString())
Insert a template into the document.
Definition: ktexteditor.cpp:179
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:379
const KSyntaxHighlighting::Repository & repository() const
Get read-only access to the syntax highlighting repository the editor uses.
Definition: ktexteditor.cpp:148
virtual void inlineNoteMouseMoveEvent(const InlineNote ¬e, const QPoint &globalPos)
Invoked when the mouse cursor moves inside the note.
Definition: ktexteditor.cpp:321
QRect textAreaRect() const
Get the view's text area rectangle excluding border, scrollbars, etc.
Definition: ktexteditor.cpp:418
QDebug & nospace()
QString defaultEncoding() const
Get the current default encoding for this Editor part.
Definition: ktexteditor.cpp:95
constexpr int line() const noexcept
Retrieve the line on which this cursor is situated.
Definition: cursor.h:174
QVector< KTextEditor::Range > selectionRanges() const
Get the ranges occupied by the current selections.
Definition: ktexteditor.cpp:209
QIcon fromTheme(const QString &name)
QDebug & space()
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:310
typedef MouseButtons
virtual bool insertText(KTextEditor::Cursor position, const QString &text, bool block=false)=0
Insert text at position.
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:389
Command(const QStringList &cmds, QObject *parent=nullptr)
Constructor with parent.
void setScrollPosition(KTextEditor::Cursor cursor)
Scroll view to cursor.
Definition: ktexteditor.cpp:393
KSyntaxHighlighting::Theme theme() const
Get the current active theme of this view.
Definition: ktexteditor.cpp:189
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:133
bool removeVariable(const QString &name)
Removes variable name.
Definition: katevariableexpansionmanager.cpp:281
void setHorizontalScrollPosition(int x)
Horizontally scroll view to position.
Definition: ktexteditor.cpp:398
bool underMouse() const
Returns whether the mouse cursor is currently over this note.
Definition: ktexteditor.cpp:298
bool expandVariable(const QString &variable, KTextEditor::View *view, QString &output) const
Expands a single variable, writing the expanded value to output.
Definition: ktexteditor.cpp:123
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:316
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:384
bool registerVariableMatch(const QString &name, const QString &description, ExpandFunction expansionFunc)
Registers a variable called name for exact matches.
Definition: ktexteditor.cpp:101
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:113
Definition: inlinenote.h:39
int toInt(bool *ok, int base) const const
QString toString() const
Returns the cursor position as string in the format "(line, column)".
Definition: ktexteditor.cpp:65
KCALENDARCORE_EXPORT uint qHash(const KCalendarCore::Period &key)
void setStatusBarEnabled(bool enable)
Show/hide the status bar of the view.
Definition: ktexteditor.cpp:168
bool unregisterVariablePrefix(const QString &variable)
Unregisters a prefix of variable that was previously registered with registerVariableMatch().
Definition: ktexteditor.cpp:118
KSyntaxHighlighting::Theme theme() const
Get the current global theme.
Definition: ktexteditor.cpp:143
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:204
virtual void inlineNoteActivated(const InlineNote ¬e, Qt::MouseButtons buttons, const QPoint &globalPos)
Invoked when a note is activated by the user.
Definition: ktexteditor.cpp:303
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:184
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:332
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
bool registerVariablePrefix(const QString &prefix, const QString &description, ExpandFunction expansionFunc)
Registers a variable for arbitrary text that matches the specified prefix.
Definition: ktexteditor.cpp:107
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:254
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
static Cursor fromString(QStringView str) noexcept
Returns a Cursor created from the string str containing the format "(line, column)".
Definition: ktexteditor.cpp:41
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:153
void setCursorPositions(const QVector< KTextEditor::Cursor > &positions)
Set the view's new cursors to positions.
Definition: ktexteditor.cpp:194
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:128
A source of inline notes for a document.
Definition: inlinenoteprovider.h:28
virtual ~SessionConfigInterface()
Virtual destructor.
constexpr int column() const noexcept
Retrieve the column on which this cursor is situated.
Definition: cursor.h:192
virtual QString fullName() const
Get a readable full name for the config page.
Definition: ktexteditor.cpp:222
cursor
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Jun 4 2023 03:50:33 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Jun 4 2023 03:50:33 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.