# class KTextEditor.ConfigInterface

### abstract class

Table of contents
Modules
ktexteditor Classes
All Classes

Module | ktexteditor
Namespace | ktexteditor
Class | KTextEditor.ConfigInterface
Inherits |

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 Author Matt Broadstone \<mbroadst@gmail.com\>

### methods

- ConfigInterface ()

  returns nothing

  Virtual destructor.

- configKeys ()

  returns (QStringList)
  pure virtual

  Get a list of all available keys.

- configValue (key)

  returns (QVariant)
  pure virtual

  Argument | Type | Default
  --- | --- | ---
  key | QString |

  Get a value for the key.

- setConfigValue (key, value)

  returns nothing
  pure virtual

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QVariant |

  Set a the key's value to value.