KTextEditor
#include <configinterface.h>
Public Member Functions | |
ConfigInterface () | |
virtual | ~ConfigInterface () |
virtual QStringList | configKeys () const =0 |
virtual QVariant | configValue (const QString &key)=0 |
virtual void | setConfigValue (const QString &key, const QVariant &value)=0 |
Detailed Description
Config interface extension for the Document and View.
Introduction
The ConfigInterface provides methods to access and modify the low level config information for a given Document or View. Examples of this config data can be displaying the icon bar, showing line numbers, etc. This generally allows access to settings that otherwise are only accessible during runtime.
Accessing the Interface
The ConfigInterface is supposed to be an extension interface for a Document or View, i.e. the Document or View inherits the interface provided that the KTextEditor library in use implements the interface. Use qobject_cast to access the interface:
Accessing Data
A list of available config variables (or keys) can be optained by calling configKeys(). For all available keys configValue() returns the corresponding value as QVariant. A value for a given key can be set by calling setConfigValue(). Right now, when using KatePart as editor component, KTextEditor::View has support for the following tuples:
- line-numbers [bool], show/hide line numbers
- icon-bar [bool], show/hide icon bar
- folding-bar [bool], show/hide the folding bar
- dynamic-word-wrap [bool], enable/disable dynamic word wrap
- background-color [QColor], read/set the default background color
- selection-color [QColor], read/set the default color for selections
- search-highlight-color [QColor], read/set the background color for search
- replace-highlight-color [QColor], read/set the background color for replaces
- default-mark-type [uint], read/set the default mark type
- allow-mark-menu [bool], enable/disable the menu shown when right clicking on the left gutter. When disabled, click on the gutter will always set or clear the mark of default type.
- icon-border-color [QColor] read/set the icon border color (on the left, with the line numbers)
- folding-marker-color [QColor] read/set folding marker colors (in the icon border)
- line-number-color [QColor] read/set line number colors (in the icon border)
- modification-markers [bool] read/set whether the modification markers are shown
KTextEditor::Document has support for the following:
- backup-on-save-local [bool], enable/disable backup when saving local files
- backup-on-save-remote [bool], enable/disable backup when saving remote files
- backup-on-save-suffix [string], set the suffix for file backups, e.g. "~"
- backup-on-save-prefix [string], set the prefix for file backups, e.g. "."
- tab-width [int], read/set the width for tabs
- indent-width [int], read/set the indentation width
Either interface should emit the configChanged
signal when appropriate. TODO: Add to interface in KDE 5.
For instance, if you want to enable dynamic word wrap of a KTextEditor::View simply call
- See also
- KTextEditor::View, KTextEditor::Document
Definition at line 105 of file configinterface.h.
Constructor & Destructor Documentation
ConfigInterface::ConfigInterface | ( | ) |
Definition at line 24 of file configinterface.cpp.
|
virtual |
Virtual destructor.
Definition at line 29 of file configinterface.cpp.
Member Function Documentation
|
pure virtual |
Get a list of all available keys.
Get a value for the key
.
|
pure virtual |
Set a the key's
value to value
.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.