Konsole::ColorSchemeManager

Search for usage in LXR

Konsole::ColorSchemeManager Class Reference

#include <ColorScheme.h>

Public Member Functions

 ColorSchemeManager ()
 
 ~ColorSchemeManager ()
 
void addCustomColorSchemeDir (const QString &custom_dir)
 
QList< ColorScheme * > allColorSchemes ()
 
const ColorSchemedefaultColorScheme () const
 
bool deleteColorScheme (const QString &name)
 
const ColorSchemefindColorScheme (const QString &name)
 
bool loadCustomColorScheme (const QString &path)
 

Static Public Member Functions

static ColorSchemeManagerinstance ()
 

Detailed Description

Manages the color schemes available for use by terminal displays.

See ColorScheme

Definition at line 249 of file ColorScheme.h.

Constructor & Destructor Documentation

◆ ColorSchemeManager()

ColorSchemeManager::ColorSchemeManager ( )

Constructs a new ColorSchemeManager and loads the list of available color schemes.

The color schemes themselves are not loaded until they are first requested via a call to findColorScheme()

Definition at line 502 of file ColorScheme.cpp.

◆ ~ColorSchemeManager()

ColorSchemeManager::~ColorSchemeManager ( )
default

Destroys the ColorSchemeManager and saves any modified color schemes to disk.

Member Function Documentation

◆ addCustomColorSchemeDir()

void ColorSchemeManager::addCustomColorSchemeDir ( const QString & custom_dir)

Allows to add a custom location of color schemes.

Parameters
[in]custom_dirCustom location of color schemes (must end with /).

Definition at line 563 of file ColorScheme.cpp.

◆ allColorSchemes()

QList< ColorScheme * > ColorSchemeManager::allColorSchemes ( )

Returns a list of the all the available color schemes.

This may be slow when first called because all of the color scheme resources on disk must be located, read and parsed.

Subsequent calls will be inexpensive.

Definition at line 528 of file ColorScheme.cpp.

◆ defaultColorScheme()

const ColorScheme * ColorSchemeManager::defaultColorScheme ( ) const

Returns the default color scheme for Konsole.

Definition at line 625 of file ColorScheme.cpp.

◆ deleteColorScheme()

bool ColorSchemeManager::deleteColorScheme ( const QString & name)

Deletes a color scheme.

Returns true on successful deletion or false otherwise.

Definition at line 630 of file ColorScheme.cpp.

◆ findColorScheme()

const ColorScheme * ColorSchemeManager::findColorScheme ( const QString & name)

Returns the color scheme with the given name or 0 if no scheme with that name exists.

If name is empty, the default color scheme is returned.

The first time that a color scheme with a particular name is requested, the configuration information is loaded from disk.

Definition at line 665 of file ColorScheme.cpp.

◆ instance()

ColorSchemeManager * ColorSchemeManager::instance ( )
static

Returns the global color scheme manager instance.

Definition at line 688 of file ColorScheme.cpp.

◆ loadCustomColorScheme()

bool ColorSchemeManager::loadCustomColorScheme ( const QString & path)

Loads a custom color scheme under given path.

The path may refer to either KDE 4 .colorscheme or KDE 3 .schema file

The loaded color scheme is available under the name equal to the base name of the path via the allColorSchemes() and findColorScheme() methods after this call if loaded successfully.

Parameters
[in]pathThe path to KDE 4 .colorscheme or KDE 3 .schema.
Returns
Whether the color scheme is loaded successfully.

Definition at line 555 of file ColorScheme.cpp.


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 Mon Nov 18 2024 12:10:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.