22#ifndef KDELIBS_KPALETTE_H
23#define KDELIBS_KPALETTE_H
28#include <tqstringlist.h>
29#include "tdelibs_export.h"
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;
Class for handling Palettes.
TQString colorName(const TQColor &color)
Find color name by color.
TQString name() const
Get the name of the palette.
void setEditable(Editable editable)
Change whether the palette may be edited.
int nrColors() const
Return the number of colors in the palette.
void setDescription(const TQString &desc)
Set the description of the palette.
int changeColor(const TQColor &oldColor, const TQColor &newColor, const TQString &newColorName=TQString::null)
Change a color.
Editable editable() const
Returns whether the palette may be edited.
void setName(const TQString &name)
Set the name of the palette.
TQString description() const
Get the description of the palette.
Editable
Used to specify whether a palette may be edited.
@ No
Palette may not be edited.