.TH "KPalette" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KPalette \- Class for handling Palettes.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kpalette.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBEditable\fP { \fBYes\fP, \fBNo\fP, \fBAsk\fP }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKPalette\fP (const \fBQString\fP &name=QString::null)"
.br
.ti -1c
.RI "\fBKPalette\fP (const \fBKPalette\fP &)"
.br
.ti -1c
.RI "virtual \fB~KPalette\fP ()"
.br
.ti -1c
.RI "\fBKPalette\fP & \fBoperator=\fP (const \fBKPalette\fP &)"
.br
.ti -1c
.RI "bool \fBsave\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBdescription\fP () const "
.br
.ti -1c
.RI "void \fBsetDescription\fP (const \fBQString\fP &desc)"
.br
.ti -1c
.RI "\fBQString\fP \fBname\fP () const "
.br
.ti -1c
.RI "void \fBsetName\fP (const \fBQString\fP &name)"
.br
.ti -1c
.RI "\fBEditable\fP \fBeditable\fP () const "
.br
.ti -1c
.RI "void \fBsetEditable\fP (\fBEditable\fP editable)"
.br
.ti -1c
.RI "int \fBnrColors\fP () const "
.br
.ti -1c
.RI "\fBQColor\fP \fBcolor\fP (int index)"
.br
.ti -1c
.RI "int \fBfindColor\fP (const \fBQColor\fP &color) const "
.br
.ti -1c
.RI "\fBQString\fP \fBcolorName\fP (int index)"
.br
.ti -1c
.RI "\fBQString\fP \fBcolorName\fP (const \fBQColor\fP &color)"
.br
.ti -1c
.RI "int \fBaddColor\fP (const \fBQColor\fP &newColor, const \fBQString\fP &newColorName=QString::null)"
.br
.ti -1c
.RI "int \fBchangeColor\fP (int index, const \fBQColor\fP &newColor, const \fBQString\fP &newColorName=QString::null)"
.br
.ti -1c
.RI "int \fBchangeColor\fP (const \fBQColor\fP &oldColor, const \fBQColor\fP &newColor, const \fBQString\fP &newColorName=QString::null)"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBQStringList\fP \fBgetPaletteList\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
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.
.PP
This class uses the 'GIMP' palette file format.
.PP
This class is totally unrelated to \fBQPalette\fP.
.PP
\fBAuthor:\fP
.RS 4
Waldo Bastian (bastian@kde.org) 
.RE
.PP

.PP
Definition at line 46 of file kpalette.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKPalette::Editable\fP"
.PP
Used to specify whether a palette may be edited. 
.PP
\fBSee also:\fP
.RS 4
\fBeditable()\fP 
.PP
\fBsetEditable()\fP 
.RE
.PP

.PP
\fBEnumeration values: \fP
.in +1c
.TP
\fB\fIYes \fP\fP
Palette may be edited. 
.TP
\fB\fINo \fP\fP
Palette may not be edited. 
.TP
\fB\fIAsk \fP\fP
Ask user before editing. 
.PP
Definition at line 118 of file kpalette.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KPalette::KPalette (const \fBQString\fP & name = \fCQString::null\fP)"
.PP
KPalette constructor. 
.PP
Creates a KPalette from a file the filename is derived from the name. 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP The name of palette as returned by \fBgetPaletteList()\fP 
.RE
.PP

.PP
Definition at line 50 of file kpalette.cpp.
.PP
References QPtrList::append(), QString::ascii(), QFile::exists(), QString::find(), QString::isEmpty(), QString::mid(), QFile::open(), QFile::readLine(), QPtrList::setAutoDelete(), and QString::stripWhiteSpace().
.SS "KPalette::KPalette (const \fBKPalette\fP &)"
.PP
KPalette copy constructor. 
.PP
Definition at line 112 of file kpalette.cpp.
.PP
References QPtrList::append(), QPtrList::first(), QPtrList::next(), and QPtrList::setAutoDelete().
.SS "KPalette::~\fBKPalette\fP ()\fC [virtual]\fP"
.PP
KPalette destructor. 
.PP
Definition at line 126 of file kpalette.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBQStringList\fP KPalette::getPaletteList ()\fC [static]\fP"
.PP
Query which \fBKDE\fP palettes are installed. 
.PP
\fBReturns:\fP
.RS 4
A list with a palette names. 
.RE
.PP

.PP
Definition at line 34 of file kpalette.cpp.
.PP
References KGlobal::dirs(), and KStandardDirs::findAllResources().
.SS "\fBKPalette\fP & KPalette::operator= (const \fBKPalette\fP &)"
.PP
KPalette assignment operator. 
.PP
Definition at line 159 of file kpalette.cpp.
.PP
References QPtrList::append(), QPtrList::clear(), QPtrList::first(), and QPtrList::next().
.SS "bool KPalette::save ()"
.PP
Save the palette. 
.PP
\fBReturns:\fP
.RS 4
'true' if successful 
.RE
.PP

.PP
Definition at line 132 of file kpalette.cpp.
.PP
References KSaveFile::close(), description(), QPtrList::first(), QPtrList::next(), QStringList::split(), KSaveFile::status(), QString::stripWhiteSpace(), and KSaveFile::textStream().
.SS "\fBQString\fP KPalette::description () const\fC [inline]\fP"
.PP
Get the description of the palette. 
.PP
\fBReturns:\fP
.RS 4
the description of the palette. 
.RE
.PP

.PP
Definition at line 89 of file kpalette.h.
.PP
Referenced by save().
.SS "void KPalette::setDescription (const \fBQString\fP & desc)\fC [inline]\fP"
.PP
Set the description of the palette. 
.PP
\fBParameters:\fP
.RS 4
\fIdesc\fP the new description 
.RE
.PP

.PP
Definition at line 96 of file kpalette.h.
.SS "\fBQString\fP KPalette::name () const\fC [inline]\fP"
.PP
Get the name of the palette. 
.PP
\fBReturns:\fP
.RS 4
the name of the palette 
.RE
.PP

.PP
Definition at line 103 of file kpalette.h.
.SS "void KPalette::setName (const \fBQString\fP & name)\fC [inline]\fP"
.PP
Set the name of the palette. 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the name of the palette 
.RE
.PP

.PP
Definition at line 110 of file kpalette.h.
.SS "\fBEditable\fP KPalette::editable () const\fC [inline]\fP"
.PP
Returns whether the palette may be edited. 
.PP
\fBReturns:\fP
.RS 4
the state of the palette 
.RE
.PP

.PP
Definition at line 127 of file kpalette.h.
.SS "void KPalette::setEditable (\fBEditable\fP editable)\fC [inline]\fP"
.PP
Change whether the palette may be edited. 
.PP
\fBParameters:\fP
.RS 4
\fIeditable\fP the state of the palette 
.RE
.PP

.PP
Definition at line 134 of file kpalette.h.
.SS "int KPalette::nrColors () const\fC [inline]\fP"
.PP
Return the number of colors in the palette. 
.PP
\fBReturns:\fP
.RS 4
the number of colors 
.RE
.PP

.PP
Definition at line 141 of file kpalette.h.
.PP
Referenced by addColor(), changeColor(), color(), and colorName().
.SS "\fBQColor\fP KPalette::color (int index)"
.PP
Find color by index. 
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP the index of the desired color 
.RE
.PP
\fBReturns:\fP
.RS 4
The \fCindex\fP -th color of the palette, null if not found. 
.RE
.PP

.PP
Definition at line 178 of file kpalette.cpp.
.PP
References QPtrList::at(), and nrColors().
.PP
Referenced by findColor().
.SS "int KPalette::findColor (const \fBQColor\fP & color) const"
.PP
Find index by \fCcolor\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIcolor\fP the color to find 
.RE
.PP
\fBReturns:\fP
.RS 4
The index of the color in the palette or -1 if the color is not found. 
.RE
.PP

.PP
Definition at line 191 of file kpalette.cpp.
.PP
References color(), and QPtrListIterator::current().
.SS "\fBQString\fP KPalette::colorName (int index)"
.PP
Find color name by \fCindex\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP the index of the color 
.RE
.PP
\fBReturns:\fP
.RS 4
The name of the \fCindex\fP -th color. Note that not all palettes have named the colors. Null is returned if the color does not exist or has no name. 
.RE
.PP

.PP
Definition at line 204 of file kpalette.cpp.
.PP
References QPtrList::at(), and nrColors().
.SS "\fBQString\fP KPalette::colorName (const \fBQColor\fP & color)\fC [inline]\fP"
.PP
Find color name by \fCcolor\fP. 
.PP
\fBReturns:\fP
.RS 4
The name of color according to this palette. Note that not all palettes have named the colors. Note also that each palette can give the same color a different name. 
.RE
.PP

.PP
Definition at line 175 of file kpalette.h.
.SS "int KPalette::addColor (const \fBQColor\fP & newColor, const \fBQString\fP & newColorName = \fCQString::null\fP)"
.PP
Add a color. 
.PP
\fBParameters:\fP
.RS 4
\fInewColor\fP The color to add. 
.br
\fInewColorName\fP The name of the color, null to remove the name. 
.RE
.PP
\fBReturns:\fP
.RS 4
The index of the added color. 
.RE
.PP

.PP
Definition at line 217 of file kpalette.cpp.
.PP
References QPtrList::append(), and nrColors().
.SS "int KPalette::changeColor (int index, const \fBQColor\fP & newColor, const \fBQString\fP & newColorName = \fCQString::null\fP)"
.PP
Change a color. 
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP Index of the color to change 
.br
\fInewColor\fP The new color. 
.br
\fInewColorName\fP The new color name, null to remove the name. 
.RE
.PP
\fBReturns:\fP
.RS 4
The index of the new color or -1 if the color couldn't be changed. 
.RE
.PP

.PP
Definition at line 227 of file kpalette.cpp.
.PP
References QPtrList::at(), and nrColors().
.SS "int KPalette::changeColor (const \fBQColor\fP & oldColor, const \fBQColor\fP & newColor, const \fBQString\fP & newColorName = \fCQString::null\fP)\fC [inline]\fP"
.PP
Change a color. 
.PP
\fBParameters:\fP
.RS 4
\fIoldColor\fP The original color 
.br
\fInewColor\fP The new color. 
.br
\fInewColorName\fP The new color name, null to remove the name. 
.RE
.PP
\fBReturns:\fP
.RS 4
The index of the new color or -1 if the color couldn't be changed. 
.RE
.PP

.PP
Definition at line 210 of file kpalette.h.

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
