libkdegames
kscoredialog.h
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
00043 public:
00044 enum Fields { Name = 1 << 0,
00045 Level = 1 << 1,
00046
00047 Custom1 = 1 << 10,
00048 Custom2 = 1 << 11,
00049 Custom3 = 1 << 12,
00050
00051 Date = 1 << 27,
00052 Time = 1 << 28,
00053 Score = 1 << 29 };
00054
00055 typedef TQMap<int, TQString> FieldInfo;
00056
00062 KScoreDialog(int fields, TQWidget *parent=0, const char *name=0);
00063
00064 ~KScoreDialog();
00065
00070 void setConfigGroup(const TQString &group);
00071
00076 void setComment(const TQString &comment);
00077
00084 void addField(int field, const TQString &header, const TQString &key);
00085
00097 int addScore(int newScore, const FieldInfo &newInfo, bool askName, bool lessIsMore);
00098 int addScore(int newScore, const FieldInfo &newInfo, bool askName=true);
00099
00103 int highScore();
00104
00105 virtual void show();
00106
00107 private slots:
00108 void slotGotReturn();
00109 void slotGotName();
00110
00111 private:
00112
00113 void loadScores();
00114 void saveScores();
00115
00116 void aboutToShow();
00117 void setupDialog();
00118 void keyPressEvent( TQKeyEvent *ev);
00119
00120 private:
00121 class KScoreDialogPrivate;
00122 KScoreDialogPrivate *d;
00123 };
00124
00125 #endif // !KSCOREDIALOG_H