KPalette Class Reference
Class for handling Palettes. More...
#include <kpalette.h>
Collaboration diagram for KPalette:

| Public Types | |
| enum | Editable { Yes, No, Ask } | 
| Public Member Functions | |
| KPalette (const QString &name=QString::null) | |
| KPalette (const KPalette &) | |
| virtual | ~KPalette () | 
| KPalette & | operator= (const KPalette &) | 
| bool | save () | 
| QString | description () const | 
| void | setDescription (const QString &desc) | 
| QString | name () const | 
| void | setName (const QString &name) | 
| Editable | editable () const | 
| void | setEditable (Editable editable) | 
| int | nrColors () const | 
| QColor | color (int index) | 
| int | findColor (const QColor &color) const | 
| QString | colorName (int index) | 
| QString | colorName (const QColor &color) | 
| int | addColor (const QColor &newColor, const QString &newColorName=QString::null) | 
| int | changeColor (int index, const QColor &newColor, const QString &newColorName=QString::null) | 
| int | changeColor (const QColor &oldColor, const QColor &newColor, const QString &newColorName=QString::null) | 
| Static Public Member Functions | |
| QStringList | getPaletteList () | 
Detailed Description
Class for handling Palettes.This class makes it easy to handle palettes. A palette is a set of colors. This class can read and write palettes from and to a file.
This class uses the "GIMP" palette file format.
This class is totally unrelated to QPalette.
- Author:
- Waldo Bastian (bastian@kde.org)
- Version:
- Id
- kpalette.h,v 1.10 2003/08/16 19:44:57 coolo Exp
 
Definition at line 46 of file kpalette.h.
Member Enumeration Documentation
| 
 | 
| Used to specify whether a palette may be edited. 
 
 
 Definition at line 118 of file kpalette.h. Referenced by editable(). | 
Constructor & Destructor Documentation
| 
 | 
| KPalette constructor. Creates a KPalette from a file the filename is derived from the name. 
 Definition at line 50 of file kpalette.cpp. References QPtrList< kolor >::append(), QString::ascii(), QFile::exists(), QString::find(), QString::isEmpty(), QString::mid(), QFile::open(), QFile::readLine(), QPtrList< kolor >::setAutoDelete(), and QString::stripWhiteSpace(). | 
| 
 | 
| KPalette copy constructor. 
 Definition at line 112 of file kpalette.cpp. References QPtrList< kolor >::append(), QPtrList::first(), QPtrList::next(), and QPtrList< kolor >::setAutoDelete(). | 
| 
 | 
| KPalette destructor. 
 Definition at line 126 of file kpalette.cpp. | 
Member Function Documentation
| 
 | 
| Query which KDE palettes are installed. 
 
 Definition at line 34 of file kpalette.cpp. References KGlobal::dirs(), and KStandardDirs::findAllResources(). | 
| 
 | 
| KPalette assignment operator. 
 Definition at line 159 of file kpalette.cpp. References QPtrList< kolor >::append(), QPtrList< kolor >::clear(), QPtrList::first(), mDesc, mEditable, mKolorList, mName, and QPtrList::next(). | 
| 
 | 
| Save the palette. 
 
 Definition at line 132 of file kpalette.cpp. References KSaveFile::close(), description(), QPtrList::first(), QPtrList::next(), QStringList::split(), KSaveFile::status(), QString::stripWhiteSpace(), and KSaveFile::textStream(). | 
| 
 | 
| Get the description of the palette. 
 
 Definition at line 89 of file kpalette.h. Referenced by save(). | 
| 
 | 
| Set the description of the palette. 
 
 Definition at line 96 of file kpalette.h. | 
| 
 | 
| Get the name of the palette. 
 
 Definition at line 103 of file kpalette.h. | 
| 
 | 
| Set the name of the palette. 
 
 Definition at line 110 of file kpalette.h. | 
| 
 | 
| Returns whether the palette may be edited. 
 
 Definition at line 127 of file kpalette.h. References Editable. | 
| 
 | 
| Change whether the palette may be edited. 
 
 Definition at line 134 of file kpalette.h. | 
| 
 | 
| Return the number of colors in the palette. 
 
 Definition at line 141 of file kpalette.h. References QPtrList< kolor >::count(). Referenced by addColor(), changeColor(), color(), and colorName(). | 
| 
 | 
| Find color by index. 
 
 
 Definition at line 178 of file kpalette.cpp. References QPtrList< kolor >::at(), and nrColors(). | 
| 
 | 
| 
Find index by  
 
 
 Definition at line 191 of file kpalette.cpp. References QPtrListIterator::current(). Referenced by changeColor(), and colorName(). | 
| 
 | 
| 
Find color name by  
 
 
 Definition at line 204 of file kpalette.cpp. References QPtrList< kolor >::at(), and nrColors(). Referenced by colorName(). | 
| 
 | 
| 
Find color name by  
 
 Definition at line 175 of file kpalette.h. References colorName(), and findColor(). | 
| 
 | ||||||||||||
| Add a color. 
 
 
 Definition at line 217 of file kpalette.cpp. References QPtrList< kolor >::append(), QColor::name(), and nrColors(). | 
| 
 | ||||||||||||||||
| Change a color. 
 
 
 Definition at line 227 of file kpalette.cpp. References QPtrList< kolor >::at(), QColor::name(), and nrColors(). Referenced by changeColor(). | 
| 
 | ||||||||||||||||
| Change a color. 
 
 
 Definition at line 210 of file kpalette.h. References changeColor(), and findColor(). | 
The documentation for this class was generated from the following files:

