/usr/include/KF5/KGuiAddons/kcolorcollection.h is in libkf5guiaddons-dev 5.28.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | /* This file is part of the KDE libraries
Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; version
2 of the License.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
//-----------------------------------------------------------------------------
// KDE color collection.
#ifndef KDELIBS_KCOLORCOLLECTION_H
#define KDELIBS_KCOLORCOLLECTION_H
#include <kguiaddons_export.h>
#include <QColor>
#include <QtCore/QList>
#include <QtCore/QString>
#include <QtCore/QStringList>
/**
* Class for handling color collections ("palettes").
*
* This class makes it easy to handle color collections, sometimes referred to
* as "palettes". This class can read and write collections from and to a file.
*
* This class uses the "GIMP" palette file format.
*
* @author Waldo Bastian (bastian@kde.org)
**/
class KGUIADDONS_EXPORT KColorCollection
{
public:
/**
* Query which KDE color collections are installed.
*
* @return A list with installed color collection names.
*/
static QStringList installedCollections();
/**
* KColorCollection constructor. Creates a KColorCollection from a file
* the filename is derived from the name.
* @param name The name of collection as returned by installedCollections()
**/
explicit KColorCollection(const QString &name = QString());
/**
* KColorCollection copy constructor.
**/
KColorCollection(const KColorCollection &);
/**
* KColorCollection destructor.
**/
~KColorCollection();
/**
* KColorCollection assignment operator
**/
KColorCollection &operator=(const KColorCollection &);
/**
* Save the collection
*
* @return 'true' if successful
**/
bool save();
/**
* Get the description of the collection.
* @return the description of the collection.
**/
QString description() const;
/**
* Set the description of the collection.
* @param desc the new description
**/
void setDescription(const QString &desc);
/**
* Get the name of the collection.
* @return the name of the collection
**/
QString name() const;
/**
* Set the name of the collection.
* @param name the name of the collection
**/
void setName(const QString &name);
/**
* Used to specify whether a collection may be edited.
* @see editable()
* @see setEditable()
*/
enum Editable { Yes, ///< Collection may be edited
No, ///< Collection may not be edited
Ask ///< Ask user before editing
};
/**
* Returns whether the collection may be edited.
* @return the state of the collection
**/
Editable editable() const;
/**
* Change whether the collection may be edited.
* @param editable the state of the collection
**/
void setEditable(Editable editable);
/**
* Return the number of colors in the collection.
* @return the number of colors
**/
int count() const;
/**
* Find color by index.
* @param index the index of the desired color
* @return The @p index -th color of the collection, null if not found.
**/
QColor color(int index) const;
/**
* Find index by @p color.
* @param color the color to find
* @return The index of the color in the collection or -1 if the
* color is not found.
**/
int findColor(const QColor &color) const;
/**
* Find color name by @p index.
* @param index the index of the color
* @return The name of the @p index -th color.
* Note that not all collections have named the colors. Null is
* returned if the color does not exist or has no name.
**/
QString name(int index) const;
/**
* Find color name by @p color.
* @return The name of color according to this collection.
* Note that not all collections have named the colors.
* Note also that each collection can give the same color
* a different name.
**/
QString name(const QColor &color) const;
/**
* Add a color.
* @param newColor The color to add.
* @param newColorName The name of the color, null to remove
* the name.
* @return The index of the added color.
**/
int addColor(const QColor &newColor,
const QString &newColorName = QString());
/**
* Change a color.
* @param index Index of the color to change
* @param newColor The new color.
* @param newColorName The new color name, null to remove
* the name.
* @return The index of the new color or -1 if the color couldn't
* be changed.
**/
int changeColor(int index,
const QColor &newColor,
const QString &newColorName = QString());
/**
* Change a color.
* @param oldColor The original color
* @param newColor The new color.
* @param newColorName The new color name, null to remove
* the name.
* @return The index of the new color or -1 if the color couldn't
* be changed.
**/
int changeColor(const QColor &oldColor,
const QColor &newColor,
const QString &newColorName = QString());
private:
class KColorCollectionPrivate *d;
};
#endif // KDELIBS_KCOLORCOLLECTION_H
|