2
* iconset.h - various graphics handling classes
3
* Copyright (C) 2001-2003 Justin Karneges, Michail Pishchagin
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
#include <qstringlist.h>
30
#include <qvaluevector.h>
35
class QMimeSourceFactory;
42
Impix(const QPixmap &);
43
Impix(const QImage &);
45
Impix & operator=(const Impix &from);
51
const QPixmap & pixmap() const;
52
const QImage & image() const;
53
void setPixmap(const QPixmap &);
54
void setImage(const QImage &);
56
operator const QPixmap &() const { return pixmap(); }
57
operator const QImage &() const { return image(); }
58
Impix & operator=(const QPixmap &from) { setPixmap(from); return *this; }
59
Impix & operator=(const QImage &from) { setImage(from); return *this; }
61
bool loadFromData(const QByteArray &);
71
class Icon : public QObject
79
Icon & operator= (const Icon &);
82
//! Returns impix().pixmap().
83
operator const QPixmap &() const { return impix().pixmap(); }
86
//! Returns impix().image().
87
operator const QImage &() const { return impix().image(); }
91
operator const QIconSet &() const { return iconSet(); }
93
virtual bool isAnimated() const;
94
virtual const QPixmap &pixmap() const;
95
virtual const QImage &image() const;
96
virtual const QIconSet & iconSet() const;
98
virtual const Impix &impix() const;
99
virtual const Impix &frameImpix() const;
100
void setImpix(const Impix &, bool doDetach = true);
102
const Anim *anim() const;
103
void setAnim(const Anim &, bool doDetach = true);
104
void removeAnim(bool doDetach = true);
106
const QString &name() const;
107
void setName(const QString &);
108
void setName(const char *);
110
const QRegExp ®Exp() const;
111
void setRegExp(const QRegExp &);
113
const QDict<QString> &text() const;
114
void setText(const QDict<QString> &);
116
const QString &sound() const;
117
void setSound(const QString &);
119
bool loadFromData(const QByteArray &, bool isAnimation);
121
void stripFirstAnimFrame();
127
void pixmapChanged(const QPixmap &);
128
void iconModified(const QPixmap &);
131
virtual void activated(bool playSound = true); // it just has been inserted in the text, or now it's being displayed by
132
// some widget. icon should play sound and start animation
134
virtual void stop(); // this icon is no more displaying. stop animation
146
Iconset(const Iconset &);
149
Iconset &operator=(const Iconset &);
150
Iconset &operator+=(const Iconset &);
155
bool load(const QString &dir);
157
const Icon *icon(const QString &) const;
158
void setIcon(const QString &, const Icon &);
159
void removeIcon(const QString &);
161
const QString &name() const;
162
const QString &version() const;
163
const QString &description() const;
164
const QStringList &authors() const;
165
const QString &creation() const;
166
const QString &homeUrl() const;
168
const QString &fileName() const;
169
void setFileName(const QString &);
171
const QDict<QString> info() const;
172
void setInfo(const QDict<QString> &);
174
QPtrListIterator<Icon> iterator() const;
176
QMimeSourceFactory *createMimeSourceFactory() const;
178
void addToFactory() const;
179
void removeFromFactory() const;
181
static void setSoundPrefs(QString unpackPath, QObject *receiver, const char *slot);
183
Iconset copy() const;
194
static Icon icon(const QString &name);
195
static const Icon *iconPtr(const QString &name);
196
static const QStringList icons();