KateConfig

#include <kateconfig.h>

Inheritance diagram for KateConfig:

Classes

class  ConfigEntry
 

Public Member Functions

void configEnd ()
 
QStringList configKeys () const
 
void configStart ()
 
bool isGlobal () 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 63 of file kateconfig.h.

Constructor & Destructor Documentation

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

Construct a KateConfig.

Parameters
parentparent config object, if any

Definition at line 42 of file kateconfig.cpp.

KateConfig::~KateConfig ( )
protectedvirtual

Virtual Destructor.

Definition at line 49 of file kateconfig.cpp.

Member Function Documentation

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

shall only be called for toplevel config

there shall be no gaps in the entries we might later want to use a vector

add new element

Definition at line 53 of file kateconfig.cpp.

void KateConfig::configEnd ( )

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

Definition at line 125 of file kateconfig.cpp.

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 93 of file kateconfig.h.

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 114 of file kateconfig.cpp.

void KateConfig::finalizeConfigEntries ( )
protected

Finalize the config entries.

Called by the sub classes after all entries are registered

shall only be called for toplevel config

compute list of all config keys + register map from key => config entry

we skip entries without a command name, these config entries are not exposed ATM

Definition at line 72 of file kateconfig.cpp.

bool KateConfig::isGlobal ( ) const
inline

Is this a global config object?

Returns
true when this is a global config object

Definition at line 83 of file kateconfig.h.

void KateConfig::readConfigEntries ( const KConfigGroup config)
protected

Read all config entries from given config group.

Parameters
configconfig group to read from

Definition at line 94 of file kateconfig.cpp.

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 161 of file kateconfig.cpp.

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

check if we know this key, if not, ignore the set

key known, dispatch to normal setValue() function with enum

Definition at line 218 of file kateconfig.cpp.

virtual void KateConfig::updateConfig ( )
protectedpure virtual

do the real update

Implemented in KateCompletionConfig.

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 142 of file kateconfig.cpp.

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

check if we know this key, if not, return invalid variant

key known, dispatch to normal value() function with enum

Definition at line 201 of file kateconfig.cpp.

void KateConfig::writeConfigEntries ( KConfigGroup config) const
protected

Write all config entries to given config group.

Parameters
configconfig group to write to

Definition at line 106 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-2020 The KDE developers.
Generated on Sun Jul 12 2020 22:58:02 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.