22 #ifndef KDELIBS_KPALETTE_H
23 #define KDELIBS_KPALETTE_H
26 #include <tqptrlist.h>
28 #include <tqstringlist.h>
29 #include "tdelibs_export.h"
31 class KPalettePrivate;
54 static TQStringList getPaletteList();
61 KPalette(
const TQString &name=TQString::null);
128 {
return mEditable; }
135 { mEditable = editable; }
142 {
return (
int) mKolorList.count(); }
149 TQColor color(
int index);
157 int findColor(
const TQColor &color)
const;
166 TQString colorName(
int index);
176 {
return colorName( findColor(color)); }
185 int addColor(
const TQColor &newColor,
186 const TQString &newColorName = TQString::null);
197 int changeColor(
int index,
198 const TQColor &newColor,
199 const TQString &newColorName = TQString::null);
211 const TQColor &newColor,
212 const TQString &newColorName = TQString::null)
213 {
return changeColor( findColor(oldColor), newColor, newColorName); }
216 typedef struct { TQColor color; TQString name; } kolor;
217 TQPtrList<kolor> mKolorList;
227 #endif // KDELIBS_KPALETTE_H
void setName(const TQString &name)
Set the name of the palette.
Editable editable() const
Returns whether the palette may be edited.
Editable
Used to specify whether a palette may be edited.
Class for handling Palettes.
int nrColors() const
Return the number of colors in the palette.
void setDescription(const TQString &desc)
Set the description of the palette.
TQString name() const
Get the name of the palette.
TQString description() const
Get the description of the palette.
TQString colorName(const TQColor &color)
Find color name by color.
Palette may not be edited.
int changeColor(const TQColor &oldColor, const TQColor &newColor, const TQString &newColorName=TQString::null)
Change a color.
void setEditable(Editable editable)
Change whether the palette may be edited.