00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KDELABEL_H
00023 #define KDELABEL_H
00024
00025 #include "kdmitem.h"
00026
00027 #include <tqcolor.h>
00028 #include <tqfont.h>
00029
00030 class TQTimer;
00031
00032
00033
00034
00035
00036 class KdmLabel : public KdmItem {
00037 Q_OBJECT
00038
00039 public:
00040 KdmLabel( KdmItem *parent, const TQDomNode &node, const char *name = 0 );
00041 void setText( const TQString &txt );
00042
00043 protected:
00044
00045 virtual TQSize sizeHint();
00046
00047
00048 virtual void drawContents( TQPainter *p, const TQRect &r );
00049
00050
00051 virtual void statusChanged();
00052
00053 public:
00054 struct LabelStruct {
00055 TQString text;
00056 bool isTimer;
00057 bool hasId;
00058 TQString id;
00059 struct LabelClass {
00060 TQColor color;
00061 TQFont font;
00062 bool present;
00063 } normal, active, prelight;
00064 int maximumWidth;
00065 } label;
00066
00067 TQTimer *timer;
00068
00069 public slots:
00070 void update();
00071 void slotAccel();
00072
00073 private:
00074
00075 TQString lookupStock( const TQString &stock );
00076
00077
00078 TQString lookupText( const TQString &t );
00079
00080 TQString cText;
00081 int cAccel;
00082 TQAccel *myAccel;
00083
00084 void setTextInt(const TQString &);
00085 };
00086
00087 #endif