KTextEditor
editor.h
237 * Individual views might have set different fonts, can be queried with the "font" key via \see KTextEditor::ConfigInterface::configValue().
308 // using ExpandFunction = std::function<QString(const QStringView &text, KTextEditor::View *view)>;
321 bool registerVariableMatch(const QString &name, const QString &description, ExpandFunction expansionFunc);
337 bool registerVariablePrefix(const QString &prefix, const QString &description, ExpandFunction expansionFunc);
379 void addVariableExpansion(const QList<QWidget *> &widgets, const QStringList &variables = QStringList()) const;
This class allows the application that embeds the KTextEditor component to allow it access to applica...
Definition application.h:44
KTextEditor::EditorPrivate One instance of this class is hold alive during a kate part session,...
Definition kateglobal.h:65
QString(*)(const QStringView &text, KTextEditor::View *view) ExpandFunction
Function that is called to expand a variable in text.
Definition editor.h:309
bool expandVariable(const QString &variable, KTextEditor::View *view, QString &output) const
Expands a single variable, writing the expanded value to output.
Definition ktexteditor.cpp:118
void configChanged(KTextEditor::Editor *editor)
This signal is emitted whenever the editor configuration is changed.
virtual Command * queryCommand(const QString &cmd) const =0
Query for the command cmd.
QString expandText(const QString &text, KTextEditor::View *view) const
Expands arbitrary text that may contain arbitrary many variables.
Definition ktexteditor.cpp:123
virtual KTextEditor::Application * application() const =0
Current hosting application, if any set.
virtual ConfigPage * configPage(int number, QWidget *parent)=0
Get the config page with the number, config pages from 0 to configPages()-1 are available if configPa...
bool unregisterVariable(const QString &variableName)
Unregisters a variable that was previously registered with registerVariableMatch() or registerVariabl...
Definition ktexteditor.cpp:113
virtual void setApplication(KTextEditor::Application *application)=0
Set the global application object.
const KSyntaxHighlighting::Repository & repository() const
Get read-only access to the syntax highlighting repository the editor uses.
Definition ktexteditor.cpp:143
QString defaultEncoding() const
Get the current default encoding for this Editor part.
Definition ktexteditor.cpp:95
void documentCreated(KTextEditor::Editor *editor, KTextEditor::Document *document)
The editor emits this signal whenever a document was successfully created.
bool registerVariableMatch(const QString &name, const QString &description, ExpandFunction expansionFunc)
Registers a variable called name for exact matches.
Definition ktexteditor.cpp:101
virtual QStringList commandList() const =0
Get a list of available command line strings.
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
void repositoryReloaded(KTextEditor::Editor *editor)
This signal is emitted whenever the editor syntax repository is reloaded.
virtual void configDialog(QWidget *parent)=0
Show the editor's config dialog, changes will be applied to the editor and the configuration changes ...
virtual int configPages() const =0
Get the number of available config pages.
virtual QList< Command * > commands() const =0
Get a list of all registered commands.
virtual Document * createDocument(QObject *parent)=0
Create a new document object with parent.
void addVariableExpansion(const QList< QWidget * > &widgets, const QStringList &variables=QStringList()) const
Adds a QAction to the widget in widgets that whenever focus is gained.
Definition ktexteditor.cpp:128
virtual const KAboutData & aboutData() const =0
Get the about data of this Editor part.
virtual QList< Document * > documents()=0
Get a list of all documents of this editor.
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Definition katetextblock.h:18
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Thu Jan 23 2025 19:00:30 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Thu Jan 23 2025 19:00:30 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.