• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KTextEditor

KTextEditor::ConfigInterface

KTextEditor::ConfigInterface Class Reference
[View Extension Interfaces]

Config interface extension for the View. More...

#include <configinterface.h>

List of all members.


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

Definition at line 81 of file configinterface.h.


Constructor & Destructor Documentation

ConfigInterface::ConfigInterface (  ) 

Definition at line 24 of file configinterface.cpp.

ConfigInterface::~ConfigInterface (  )  [virtual]

Virtual destructor.

Definition at line 29 of file configinterface.cpp.


Member Function Documentation

virtual QStringList KTextEditor::ConfigInterface::configKeys (  )  const [pure virtual]

Get a list of all available keys.

virtual QVariant KTextEditor::ConfigInterface::configValue ( const QString &  key  )  [pure virtual]

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:
  • configinterface.h
  • configinterface.cpp

KTextEditor

Skip menu "KTextEditor"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal