00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef LABELINI_H
00021 #define LABELINI_H
00022
00023 #include <qlabel.h>
00024
00025 class KConfigGroup;
00026
00030 class LabelIni : public QLabel {
00031 private:
00032 typedef enum {
00033 Auto,
00034 Bin,
00035 Oct,
00036 Dec,
00037 Hex } Base;
00038
00039 Base base;
00040
00041 bool bFault;
00042
00043 QString keyName ( QString sKey,
00044 QString sName );
00045
00046 static unsigned int aBase [];
00047
00048 static QStringList aslBase;
00049
00050
00051 public:
00052 LabelIni ( QWidget * parent,
00053 const char * name = 0,
00054 WFlags f = 0 );
00055
00056 LabelIni ( const QString & text,
00057 QWidget * parent,
00058 const char * name = 0,
00059 WFlags f = 0 );
00060
00061 LabelIni ( QWidget * buddy,
00062 const QString & text,
00063 QWidget * parent,
00064 const char * name = 0,
00065 WFlags f = 0 );
00066
00067 ~LabelIni();
00068
00069 int read ( KConfigGroup * config,
00070 QString sKey,
00071 QString sName = "" );
00072
00073 void write ( KConfigGroup * config,
00074 int iValue,
00075 QString sKey,
00076 QString sName = "" );
00077
00078 bool readBool ( KConfigGroup * config,
00079 QString sKey,
00080 QString sName = "" );
00081
00082 void writeBool ( KConfigGroup * config,
00083 bool bValue,
00084 QString sKey,
00085 QString sName = "" );
00086
00087 bool isFault ( void );
00088
00089 bool setBase ( unsigned int uiBase );
00090
00091 bool setBase ( QString qs );
00092
00093 QString getBaseAsString ( void );
00094
00095 static QString getDefaultBase ( void );
00096
00097 static bool setDefaultBase ( unsigned int uiBase );
00098
00099 static bool setDefaultBase ( QString sBase );
00100
00101 static QString getDefaultBaseAsString ( void );
00102 };
00103
00104 #endif