3
Copyright (c) 2000 Stefan Schimanski (1Stein@gmx.de)
4
1999-2000 Christian Esken (esken@kde.org)
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2, or (at your option)
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
32
class KaimanStyleElement : public QWidget
36
KaimanStyleElement(QWidget *parent, const char *name=0);
37
~KaimanStyleElement();
39
virtual void loadPixmaps(QString &val_s_filename);
50
bool optionStatuslight;
55
QVector<QPixmap> pixmaps;
58
void setPixmap( int num );
61
void paintEvent(QPaintEvent *qpe);
62
void dropEvent( QDropEvent *event );
63
void dragEnterEvent( QDragEnterEvent *event );
72
class KaimanStyleMasked : public KaimanStyleElement
76
KaimanStyleMasked(QWidget *parent, const char *name=0)
77
: KaimanStyleElement( parent, name ) {};
79
virtual void loadPixmaps(QString &val_s_filename)
81
KaimanStyleElement::loadPixmaps( val_s_filename );
82
if(pixmaps[0]->mask())
83
setMask(*pixmaps[0]->mask());
88
class KaimanStyleButton : public KaimanStyleMasked
92
KaimanStyleButton(QWidget *parent, const char *name=0);
96
enum { NormalUp=0, NormalDown, LitUp, LitDown, PrelightUp, PrelightLitUp, StateListEND };
98
QVector<int> I_pmIndex;
101
void setPrelight(bool);
106
void updateButtonState();
112
void mousePressEvent(QMouseEvent *qme);
113
void mouseReleaseEvent(QMouseEvent *qme);
114
void enterEvent(QEvent * );
115
void leaveEvent ( QEvent * );
118
int i_i_currentState;
125
class KaimanStyleSlider : public KaimanStyleMasked
129
KaimanStyleSlider(int min, int max, QWidget *parent, const char *name=0);
130
~KaimanStyleSlider();
132
int value() { return _value; };
134
static const bool optionVertical = 1;
135
static const bool optionReversed = 2;
138
void setValue( int value );
139
void setValue( int value, int min, int max );
142
void newValue( int value );
143
void newValueDrag( int value );
144
void newValueDrop( int value );
147
void mouseMoveEvent(QMouseEvent *qme);
148
void mousePressEvent(QMouseEvent *qme);
149
void mouseReleaseEvent(QMouseEvent *qme);
150
void paintEvent(QPaintEvent *qpe);
151
void enterEvent(QEvent * );
152
void leaveEvent ( QEvent * );
154
int pos2value( int x, int y );
163
class KaimanStyleBackground : public KaimanStyleMasked
167
KaimanStyleBackground(QWidget *parent, const char *name=0);
168
~KaimanStyleBackground();
171
void mousePressEvent(QMouseEvent *qme);
172
void mouseReleaseEvent(QMouseEvent *qme);
173
void mouseMoveEvent(QMouseEvent *qme);
177
QPoint i_point_dragStart;
178
QPoint i_point_lastPos;
182
class KaimanStyleValue : public KaimanStyleMasked
186
KaimanStyleValue(int min, int max, QWidget *parent, const char *name=0);
189
int value() { return _value; };
192
void setValue( int value );
193
void setValue( int value, int min, int max );
196
int _min, _max, _value;
200
class KaimanStyleState : public KaimanStyleMasked
204
KaimanStyleState(QWidget *parent, const char *name=0);
207
int value() { return _value; };
210
void setValue( int value );
216
void mousePressEvent(QMouseEvent *qme);
223
class KaimanStyleNumber : public KaimanStyleElement
227
KaimanStyleNumber(QWidget *parent, const char *name=0);
228
~KaimanStyleNumber();
230
virtual void loadPixmaps(QString &val_s_filename);
232
static const bool optionCentered = 1;
234
int value() { return _value; };
237
void setValue( int value );
240
void paintEvent(QPaintEvent *qpe);
247
class KaimanStyleText : public KaimanStyleElement
251
KaimanStyleText(QWidget *parent, const char *name=0);
254
virtual void loadPixmaps(QString &val_s_filename);
256
static const bool optionExtended = 1;
258
QString value() { return _value; };
260
void startAnimation( int delay );
261
void stopAnimation();
264
void setValue( QString value );
267
void paintEvent(QPaintEvent *qpe);
281
class KaimanStyleAnimation : public KaimanStyleMasked
285
KaimanStyleAnimation(int delay, QWidget *parent, const char *name=0);
286
~KaimanStyleAnimation();
301
class KaimanStyle : public QWidget
305
KaimanStyle(QWidget *parent, const char *name=0);
308
enum { background, mask, play_Button, stop_Button, pause_Button, prev_Button, next_Button, repeat_Button, shuffle_Button, playlist_Button, mixer_Button, exit_Button, Iconify_Button, Config_Button, Alt_Skin_Button, Minute_Number, Second_Number, in_Rate_Number, in_Hz_Number, song_Number, status_Item, cPU_Number, digit_Large, digit_Small_Default, title, volume_Item, volume_Slider, position_Item, position_Slider };
310
enum { ParsingError=1, FileNotFound };
312
/// Finds a style element, according to it's name. Returns 0 when element is not available.
313
KaimanStyleElement* find(const char* val_s_elemName);
315
/// Tries to load the given style and returns success (true) or failure (false)
316
bool loadStyle(const QString &styleName, const QString &descFile="skindata" );
317
QString skinName() { return i_skinName; };
322
virtual bool eventFilter( QObject *o, QEvent *e );
325
// Parses the "skindata" file and returns success (true) or failure (false)
326
int parseStyleFile(QString &l_s_tmpName);
327
QString getToken(QString &val_s_string, char val_c_separator);
328
void interpretTokens(QStringList& ref_s_tokens);
331
/// The name of the style, e.g. "k9"
332
QString i_s_styleName;
333
/// The base directory, where the style is found. For example
334
/// "/opt/kde/share/apps/kaiman/Skins/k9/" or "/opt/kde/share/apps/kaiman/Skins/k9.tgz"
335
QString i_s_styleBase;
338
// The mask of the complete style. Used for doing shaped windows
339
QBitmap i_bitmap_Mask;
341
/// All style elements are stored here.
342
QVector<KaimanStyleElement> I_styleElem;
344
// The parent window. In other words: The container that holds all the KaimanStyleElement's
345
QWidget* i_qw_parent;
347
QList<QWidget> i_sliders;
348
bool i_eventSemaphore;