KTextEditor
KTextEditor::ConfigInterface Class Reference
[View Extension Interfaces]
Config interface extension for the View.
More...
#include <configinterface.h>
Public Member Functions | |
ConfigInterface () | |
virtual QStringList | configKeys () const =0 |
virtual QVariant | configValue (const QString &key)=0 |
virtual void | setConfigValue (const QString &key, const QVariant &value)=0 |
virtual | ~ConfigInterface () |
Detailed Description
Config interface extension for the View.
Introduction
The ConfigInterface provides methods to access and modify the low level config information for a given 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 View, i.e. the View inherits the interface provided that the KTextEditor library in use implements the interface. Use qobject_cast to access the interface:// view is of type KTextEditor::View* KTextEditor::ConfigInterface *iface = qobject_cast<KTextEditor::ConfigInterface*>( view ); if( iface ) { // the implementation supports the interface // do stuff }
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 KatePart has support for the following tuples:- line-numbers [bool], show/hide line numbers
- icon-bar [bool], show/hide icon bar
- dynamic-word-wrap [bool], enable/disable dynamic word wrap
As a small example, if you want to enable dynamic word wrap simply call
iface->setConfigValue("dynamic-word-wrap", true);
- See also:
- KTextEditor::View
Definition at line 81 of file configinterface.h.
Constructor & Destructor Documentation
ConfigInterface::ConfigInterface | ( | ) |
Definition at line 24 of file configinterface.cpp.
ConfigInterface::~ConfigInterface | ( | ) | [virtual] |
Member Function Documentation
virtual QStringList KTextEditor::ConfigInterface::configKeys | ( | ) | const [pure virtual] |
Get a list of all available keys.
Get a value for the key
.
virtual void KTextEditor::ConfigInterface::setConfigValue | ( | const QString & | key, | |
const QVariant & | value | |||
) | [pure virtual] |
Set a the key's
value to value
.
The documentation for this class was generated from the following files: