KDEUI
kcolorcollection.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 1999 Waldo Bastian (bastian@kde.org) 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; version 00007 2 of the License. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 //----------------------------------------------------------------------------- 00020 // KDE color collection. 00021 00022 #ifndef KDELIBS_KCOLORCOLLECTION_H 00023 #define KDELIBS_KCOLORCOLLECTION_H 00024 00025 #include <kdeui_export.h> 00026 00027 #include <QtGui/QColor> 00028 #include <QtCore/QList> 00029 #include <QtCore/QString> 00030 #include <QtCore/QStringList> 00031 00042 class KDEUI_EXPORT KColorCollection 00043 { 00044 public: 00050 static QStringList installedCollections(); 00051 00057 explicit KColorCollection(const QString &name=QString()); 00058 00062 KColorCollection(const KColorCollection &); 00063 00067 ~KColorCollection(); 00068 00072 KColorCollection& operator=( const KColorCollection &); 00073 00079 bool save(); 00080 00085 QString description() const; 00086 00091 void setDescription(const QString &desc); 00092 00097 QString name() const; 00098 00103 void setName(const QString &name); 00104 00110 enum Editable { Yes, 00111 No, 00112 Ask 00113 }; 00114 00119 Editable editable() const; 00120 00125 void setEditable(Editable editable); 00126 00131 int count() const; 00132 00138 QColor color(int index) const; 00139 00146 int findColor(const QColor &color) const; 00147 00155 QString name(int index) const; 00156 00164 QString name(const QColor &color) const; 00165 00173 int addColor(const QColor &newColor, 00174 const QString &newColorName = QString()); 00175 00185 int changeColor(int index, 00186 const QColor &newColor, 00187 const QString &newColorName = QString()); 00188 00198 int changeColor(const QColor &oldColor, 00199 const QColor &newColor, 00200 const QString &newColorName = QString()); 00201 00202 private: 00203 class KColorCollectionPrivate *d; 00204 }; 00205 00206 00207 #endif // KDELIBS_KCOLORCOLLECTION_H 00208
KDE 4.6 API Reference