00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef KSCOREDIALOG_H
00026 #define KSCOREDIALOG_H
00027
00028 #include <tqmap.h>
00029 #include <tqptrlist.h>
00030
00031 #include <kdialogbase.h>
00032 #include <kdemacros.h>
00033 class TQGridLayout;
00034 class TQLineEdit;
00035 class TQWidgetStack;
00036
00040 class KDE_EXPORT KScoreDialog : public KDialogBase {
00041 Q_OBJECT
00042 TQ_OBJECT
00043
00044 public:
00045 enum Fields { Name = 1 << 0,
00046 Level = 1 << 1,
00047
00048 Custom1 = 1 << 10,
00049 Custom2 = 1 << 11,
00050 Custom3 = 1 << 12,
00051
00052 Date = 1 << 27,
00053 Time = 1 << 28,
00054 Score = 1 << 29 };
00055
00056 typedef TQMap<int, TQString> FieldInfo;
00057
00063 KScoreDialog(int fields, TQWidget *parent=0, const char *name=0);
00064
00065 ~KScoreDialog();
00066
00071 void setConfigGroup(const TQString &group);
00072
00077 void setComment(const TQString &comment);
00078
00085 void addField(int field, const TQString &header, const TQString &key);
00086
00098 int addScore(int newScore, const FieldInfo &newInfo, bool askName, bool lessIsMore);
00099 int addScore(int newScore, const FieldInfo &newInfo, bool askName=true);
00100
00104 int highScore();
00105
00106 virtual void show();
00107
00108 private slots:
00109 void slotGotReturn();
00110 void slotGotName();
00111
00112 private:
00113
00114 void loadScores();
00115 void saveScores();
00116
00117 void aboutToShow();
00118 void setupDialog();
00119 void keyPressEvent( TQKeyEvent *ev);
00120
00121 private:
00122 class KScoreDialogPrivate;
00123 KScoreDialogPrivate *d;
00124 };
00125
00126 #endif // !KSCOREDIALOG_H