KProperty

KColorCollection.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Waldo Bastian ([email protected])
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 collection.
21 
22 #ifndef KDELIBS_KCOLORCOLLECTION_H
23 #define KDELIBS_KCOLORCOLLECTION_H
24 
25 #include <QColor>
26 #include <QStringList>
27 
38 class KColorCollection
39 {
40 public:
47 
53  explicit KColorCollection(const QString &name = QString());
54 
59 
64 
69 
75  bool save();
76 
81  QString description() const;
82 
87  void setDescription(const QString &desc);
88 
93  QString name() const;
94 
99  void setName(const QString &name);
100 
106  enum Editable { Yes,
107  No,
108  Ask
109  };
110 
115  Editable editable() const;
116 
122 
127  int count() const;
128 
134  QColor color(int index) const;
135 
142  int findColor(const QColor &color) const;
143 
151  QString name(int index) const;
152 
160  QString name(const QColor &color) const;
161 
169  int addColor(const QColor &newColor,
170  const QString &newColorName = QString());
171 
181  int changeColor(int index,
182  const QColor &newColor,
183  const QString &newColorName = QString());
184 
194  int changeColor(const QColor &oldColor,
195  const QColor &newColor,
196  const QString &newColorName = QString());
197 
198 private:
199  class KColorCollectionPrivate *d;
200 };
201 
202 #endif // KDELIBS_KCOLORCOLLECTION_H
203 
QString description() const
QColor color(int index) const
void setName(const QString &name)
void setEditable(Editable editable)
QString name() const
void setDescription(const QString &desc)
int addColor(const QColor &newColor, const QString &newColorName=QString())
int changeColor(int index, const QColor &newColor, const QString &newColorName=QString())
static QStringList installedCollections()
KColorCollection(const QString &name=QString())
Editable editable() const
Class for handling color collections ("palettes").
int findColor(const QColor &color) const
KColorCollection & operator=(const KColorCollection &)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 9 2020 23:10:56 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.