00001 #ifndef STATUS_H
00002 #define STATUS_H
00003
00004 #ifdef HAVE_CONFIG_H
00005 #include <config.h>
00006 #endif
00007
00008 #include "portable.h"
00009
00010 #if defined( KDE2_PORT )
00011 #include <kapp.h>
00012 #include <kconfig.h>
00013 #endif
00014
00015 #include <qwidget.h>
00016 #include <qpixmap.h>
00017 #include <qstring.h>
00018 #include <qarray.h>
00019 #include <qlist.h>
00020 #include <qstrlist.h>
00021 #include <qregexp.h>
00022
00023 class Status : public QWidget
00024 {
00025 Q_OBJECT
00026 public:
00027 Status(QWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1);
00028 ~Status() {};
00029
00030 public slots:
00031 void setScheme(int scheme, int mode);
00032 void setLevel(int level);
00033 void setLifes(int lifes);
00034
00035 protected:
00036 void paintEvent(QPaintEvent *);
00037 int minHeight();
00038 int minWidth();
00039
00040 QString decodeHexOctString(QString str);
00041
00042 void fillArray(QArray<int> &, QString, int);
00043 void fillStrList(QStrList &, QString, int);
00044 void fillPixmapName(QStrList &);
00045
00046 void confScheme();
00047 void confLevels(bool defGroup=TRUE);
00048 void confMisc(bool defGroup=TRUE);
00049
00050 void initPixmaps();
00051
00052 private:
00053 QArray<int> levelPos;
00054 int actualLifes;
00055 int actualLevel;
00056
00057 QString pixmapDirectory;
00058
00059 QStrList lifesPixmapName;
00060 QStrList levelPixmapName;
00061
00062 QString lastLifesPixmapName;
00063 QString lastLevelPixmapName;
00064
00065 QList<QPixmap> *loadPixmap(QWidget *parent, QString pixmapName,
00066 QList<QPixmap> *pixmaps=0);
00067
00068 QList<QPixmap> *lifesPix;
00069 QList<QPixmap> *levelPix;
00070
00071 int maxLevel;
00072 int level;
00073
00074 int scheme;
00075 int mode;
00076 };
00077
00078 #endif // STATUS_H