KateConfig

Search for usage in LXR

#include <kateconfig.h>

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
 

Protected Attributes

int configSessionNumber = 0
 

Detailed Description

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

Definition at line 46 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 30 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 39 of file kateconfig.cpp.

◆ configEnd()

void KateConfig::configEnd ( )

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

Definition at line 103 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 76 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 94 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 55 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 66 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 86 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 74 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 86 of file kateconfig.cpp.

Member Data Documentation

◆ configSessionNumber

int KateConfig::configSessionNumber = 0
protected

recursion depth

Definition at line 272 of file kateconfig.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:03:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.