• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Konsole

  • kde-4.14
  • applications
  • konsole
  • src
ColorSchemeManager.h
Go to the documentation of this file.
1 /*
2  This source file is part of Konsole, a terminal emulator.
3 
4  Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  02110-1301 USA.
20 */
21 
22 #ifndef COLORSCHEMEMANAGER_H
23 #define COLORSCHEMEMANAGER_H
24 
25 // Qt
26 #include <QtCore/QHash>
27 #include <QtCore/QStringList>
28 
29 // Konsole
30 #include "ColorScheme.h"
31 
32 namespace Konsole
33 {
38 class ColorSchemeManager
39 {
40 public:
48  ColorSchemeManager();
52  ~ColorSchemeManager();
53 
57  const ColorScheme* defaultColorScheme() const;
58 
67  const ColorScheme* findColorScheme(const QString& name);
68 
73  void addColorScheme(ColorScheme* scheme);
74 
78  bool deleteColorScheme(const QString& name);
79 
87  QList<const ColorScheme*> allColorSchemes();
88 
90  static ColorSchemeManager* instance();
91 
92 private:
93  // loads a color scheme from a KDE 4+ .colorscheme file
94  bool loadColorScheme(const QString& path);
95  // loads a color scheme from a KDE 3 .schema file
96  bool loadKDE3ColorScheme(const QString& path);
97  // returns a list of paths of color schemes in the KDE 4+ .colorscheme file format
98  QStringList listColorSchemes();
99  // returns a list of paths of color schemes in the .schema file format
100  // used in KDE 3
101  QStringList listKDE3ColorSchemes();
102  // loads all of the color schemes
103  void loadAllColorSchemes();
104  // finds the path of a color scheme
105  QString findColorSchemePath(const QString& name) const;
106 
107  QHash<QString, const ColorScheme*> _colorSchemes;
108 
109  bool _haveLoadedAll;
110 
111  static const ColorScheme _defaultColorScheme;
112 };
113 }
114 
115 #endif //COLORSCHEMEMANAGER_H
Konsole::ColorSchemeManager::ColorSchemeManager
ColorSchemeManager()
Constructs a new ColorSchemeManager and loads the list of available color schemes.
Definition: ColorSchemeManager.cpp:156
Konsole::ColorSchemeManager::deleteColorScheme
bool deleteColorScheme(const QString &name)
Deletes a color scheme.
Definition: ColorSchemeManager.cpp:310
Konsole::ColorSchemeManager::allColorSchemes
QList< const ColorScheme * > allColorSchemes()
Returns a list of the all the available color schemes.
Definition: ColorSchemeManager.cpp:204
Konsole::ColorSchemeManager
Manages the color schemes available for use by terminal displays.
Definition: ColorSchemeManager.h:38
QHash
Konsole::ColorSchemeManager::addColorScheme
void addColorScheme(ColorScheme *scheme)
Adds a new color scheme to the manager.
Definition: ColorSchemeManager.cpp:293
QString
QList
QStringList
Konsole::ColorSchemeManager::~ColorSchemeManager
~ColorSchemeManager()
Destroys the ColorSchemeManager and saves any modified color schemes to disk.
Definition: ColorSchemeManager.cpp:165
ColorScheme.h
Konsole::ColorSchemeManager::findColorScheme
const ColorScheme * findColorScheme(const QString &name)
Returns the color scheme with the given name or 0 if no scheme with that name exists.
Definition: ColorSchemeManager.cpp:326
Konsole::ColorSchemeManager::defaultColorScheme
const ColorScheme * defaultColorScheme() const
Returns the default color scheme for Konsole.
Definition: ColorSchemeManager.cpp:288
Konsole::ColorSchemeManager::instance
static ColorSchemeManager * instance()
Returns the global color scheme manager instance.
Definition: ColorSchemeManager.cpp:172
Konsole::ColorScheme
Represents a color scheme for a terminal display.
Definition: ColorScheme.h:72
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal