kscoredialog.h
00001 /**************************************************************** 00002 Copyright (c) 1998 Sandro Sigala <ssigala@globalnet.it>. 00003 Copyright (c) 2001 Waldo Bastian <bastian@kde.org> 00004 All rights reserved. 00005 00006 Permission to use, copy, modify, and distribute this software 00007 and its documentation for any purpose and without fee is hereby 00008 granted, provided that the above copyright notice appear in all 00009 copies and that both that the copyright notice and this 00010 permission notice and warranty disclaimer appear in supporting 00011 documentation, and that the name of the author not be used in 00012 advertising or publicity pertaining to distribution of the 00013 software without specific, written prior permission. 00014 00015 The author disclaim all warranties with regard to this 00016 software, including all implied warranties of merchantability 00017 and fitness. In no event shall the author be liable for any 00018 special, indirect or consequential damages or any damages 00019 whatsoever resulting from loss of use, data or profits, whether 00020 in an action of contract, negligence or other tortious action, 00021 arising out of or in connection with the use or performance of 00022 this software. 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 /* read scores */ 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