KateConfig

Search for usage in LXR

#include <kateconfig.h>

Inherited by KateDocumentConfig, KateGlobalConfig, KateRendererConfig, and KateViewConfig.

Classes

class  ConfigEntry
 

Public Member Functions

void configEnd ()
 
QStringList configKeys () const
 
void configStart ()
 
bool isGlobal () const
 
bool isSet (const int key) const
 
bool setValue (const int key, const QVariant &value)
 
bool setValue (const QString &key, const QVariant &value)
 
QVariant value (const int key) const
 
QVariant value (const QString &key) const
 

Protected Member Functions

 KateConfig (const KateConfig *parent=nullptr)
 
virtual ~KateConfig ()
 
void addConfigEntry (ConfigEntry &&entry)
 
void finalizeConfigEntries ()
 
void readConfigEntries (const KConfigGroup &config)
 
virtual void updateConfig ()=0
 
void writeConfigEntries (KConfigGroup &config) const
 

Detailed Description

Base Class for the Kate Config Classes Current childs are KateDocumentConfig/KateDocumentConfig/KateDocumentConfig.

Definition at line 50 of file kateconfig.h.

Constructor & Destructor Documentation

◆ KateConfig()

KateConfig::KateConfig ( const KateConfig parent = nullptr)
protected

Construct a KateConfig.

Parameters
parentparent config object, if any

Definition at line 29 of file kateconfig.cpp.

◆ ~KateConfig()

KateConfig::~KateConfig ( )
protectedvirtualdefault

Virtual Destructor.

Member Function Documentation

◆ addConfigEntry()

void KateConfig::addConfigEntry ( ConfigEntry &&  entry)
protected

Register a new config entry.

Used by the sub classes to register all there known ones.

Parameters
entrynew entry to add

Definition at line 38 of file kateconfig.cpp.

◆ configEnd()

void KateConfig::configEnd ( )

End a config change transaction, update the concerned KateDocumentConfig/KateDocumentConfig/KateDocumentConfig.

Definition at line 101 of file kateconfig.cpp.

◆ configKeys()

QStringList KateConfig::configKeys ( ) const
inline

All known config keys.

This will use the knowledge about all registered keys of the global object.

Returns
all known config keys

Definition at line 80 of file kateconfig.h.

◆ configStart()

void KateConfig::configStart ( )

Start some config changes.

This method is needed to init some kind of transaction for config changes, update will only be done once, at configEnd() call.

Definition at line 90 of file kateconfig.cpp.

◆ finalizeConfigEntries()

void KateConfig::finalizeConfigEntries ( )
protected

Finalize the config entries.

Called by the sub classes after all entries are registered

Definition at line 51 of file kateconfig.cpp.

◆ isGlobal()

bool KateConfig::isGlobal ( ) const
inline

Is this a global config object?

Returns
true when this is a global config object

Definition at line 70 of file kateconfig.h.

◆ isSet()

bool KateConfig::isSet ( const int  key) const
inline

Is given key set in this config object?

Parameters
keyconfig key, aka enum from KateConfig* classes
Returns
is the wanted key set?

Definition at line 90 of file kateconfig.h.

◆ readConfigEntries()

void KateConfig::readConfigEntries ( const KConfigGroup config)
protected

Read all config entries from given config group.

Parameters
configconfig group to read from

Definition at line 70 of file kateconfig.cpp.

◆ setValue() [1/2]

bool KateConfig::setValue ( const int  key,
const QVariant value 
)

Set a config value.

Will assert if key is invalid. Might not alter the value if given value fails validation.

Parameters
keyconfig key, aka enum from KateConfig* classes
valuevalue to set
Returns
true on success

Definition at line 137 of file kateconfig.cpp.

◆ setValue() [2/2]

bool KateConfig::setValue ( const QString key,
const QVariant value 
)

Set a config value.

Will do nothing if key is not known or the given value fails validation.

Parameters
keyconfig key, aka commandName from KateConfig* classes
valuevalue to set
Returns
true on success

Definition at line 190 of file kateconfig.cpp.

◆ updateConfig()

virtual void KateConfig::updateConfig ( )
protectedpure virtual

do the real update

◆ value() [1/2]

QVariant KateConfig::value ( const int  key) const

Get a config value.

Parameters
keyconfig key, aka enum from KateConfig* classes
Returns
value for the wanted key, will assert if key is not valid

Definition at line 118 of file kateconfig.cpp.

◆ value() [2/2]

QVariant KateConfig::value ( const QString key) const

Get a config value for the string key.

Parameters
keyconfig key, aka commandName from KateConfig* classes
Returns
value for the wanted key, will return invalid variant if key is not known

Definition at line 177 of file kateconfig.cpp.

◆ writeConfigEntries()

void KateConfig::writeConfigEntries ( KConfigGroup config) const
protected

Write all config entries to given config group.

Parameters
configconfig group to write to

Definition at line 82 of file kateconfig.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Jun 26 2022 03:49:55 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.