• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
kpalette.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; version
7  2 of the License.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 //-----------------------------------------------------------------------------
20 // KDE color palette.
21 
22 #ifndef KDELIBS_KPALETTE_H
23 #define KDELIBS_KPALETTE_H
24 
25 #include <tqcolor.h>
26 #include <tqptrlist.h>
27 #include <tqstring.h>
28 #include <tqstringlist.h>
29 #include "tdelibs_export.h"
30 
31 class KPalettePrivate;
32 
46 class TDECORE_EXPORT KPalette
47 {
48 public:
54  static TQStringList getPaletteList();
55 
61  KPalette(const TQString &name=TQString::null);
62 
66  KPalette(const KPalette &);
67 
71  virtual ~KPalette();
72 
76  KPalette& operator=( const KPalette &);
77 
83  bool save();
84 
89  TQString description() const
90  { return mDesc; }
91 
96  void setDescription(const TQString &desc)
97  { mDesc = desc; }
98 
103  TQString name() const
104  { return mName; }
105 
110  void setName(const TQString &name)
111  { mName = name; }
112 
118  enum Editable { Yes,
119  No,
120  Ask
121  };
122 
127  Editable editable() const
128  { return mEditable; }
129 
134  void setEditable(Editable editable)
135  { mEditable = editable; }
136 
141  int nrColors() const
142  { return (int) mKolorList.count(); }
143 
149  TQColor color(int index);
150 
157  int findColor(const TQColor &color) const;
158 
166  TQString colorName(int index);
167 
175  TQString colorName(const TQColor &color)
176  { return colorName( findColor(color)); }
177 
185  int addColor(const TQColor &newColor,
186  const TQString &newColorName = TQString::null);
187 
197  int changeColor(int index,
198  const TQColor &newColor,
199  const TQString &newColorName = TQString::null);
200 
210  int changeColor(const TQColor &oldColor,
211  const TQColor &newColor,
212  const TQString &newColorName = TQString::null)
213  { return changeColor( findColor(oldColor), newColor, newColorName); }
214 
215 private:
216  typedef struct { TQColor color; TQString name; } kolor;
217  TQPtrList<kolor> mKolorList;
218 
219  TQString mName;
220  TQString mDesc;
221  Editable mEditable;
222 
223  KPalettePrivate *d;
224 };
225 
226 
227 #endif // KDELIBS_KPALETTE_H
228 
KPalette::setName
void setName(const TQString &name)
Set the name of the palette.
Definition: kpalette.h:110
KPalette::editable
Editable editable() const
Returns whether the palette may be edited.
Definition: kpalette.h:127
KPalette::Editable
Editable
Used to specify whether a palette may be edited.
Definition: kpalette.h:118
KPalette
Class for handling Palettes.
Definition: kpalette.h:46
KPalette::nrColors
int nrColors() const
Return the number of colors in the palette.
Definition: kpalette.h:141
KPalette::setDescription
void setDescription(const TQString &desc)
Set the description of the palette.
Definition: kpalette.h:96
KPalette::name
TQString name() const
Get the name of the palette.
Definition: kpalette.h:103
KPalette::description
TQString description() const
Get the description of the palette.
Definition: kpalette.h:89
KPalette::colorName
TQString colorName(const TQColor &color)
Find color name by color.
Definition: kpalette.h:175
KPalette::No
Palette may not be edited.
Definition: kpalette.h:119
KPalette::Yes
Palette may be edited.
Definition: kpalette.h:118
KPalette::changeColor
int changeColor(const TQColor &oldColor, const TQColor &newColor, const TQString &newColorName=TQString::null)
Change a color.
Definition: kpalette.h:210
KPalette::setEditable
void setEditable(Editable editable)
Change whether the palette may be edited.
Definition: kpalette.h:134

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.8.8
This website is maintained by Timothy Pearson.