• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames/highscore

kscoredialog.h

Go to the documentation of this file.
00001 /****************************************************************
00002 Copyright (c) 1998 Sandro Sigala <ssigala@globalnet.it>
00003 Copyright (c) 2001 Waldo Bastian <bastian@kde.org>
00004 Copyright (c) 2007 Matt Williams <matt@milliams.com>
00005 All rights reserved.
00006 
00007 Permission to use, copy, modify, and distribute this software
00008 and its documentation for any purpose and without fee is hereby
00009 granted, provided that the above copyright notice appear in all
00010 copies and that both that the copyright notice and this
00011 permission notice and warranty disclaimer appear in supporting
00012 documentation, and that the name of the author not be used in
00013 advertising or publicity pertaining to distribution of the
00014 software without specific, written prior permission.
00015 
00016 The author disclaim all warranties with regard to this
00017 software, including all implied warranties of merchantability
00018 and fitness.  In no event shall the author be liable for any
00019 special, indirect or consequential damages or any damages
00020 whatsoever resulting from loss of use, data or profits, whether
00021 in an action of contract, negligence or other tortious action,
00022 arising out of or in connection with the use or performance of
00023 this software.
00024 ****************************************************************/
00025 
00026 #ifndef KSCOREDIALOG_H
00027 #define KSCOREDIALOG_H
00028 
00029 #include <libkdegames_export.h>
00030 
00031 #include <QtCore/QMap>
00032 #include <QtCore/QFlags>
00033 
00034 #include <kdialog.h>
00035 
00091 class KDEGAMES_EXPORT KScoreDialog : public KDialog 
00092 {
00093     Q_OBJECT
00094 
00095     public:
00097         enum Fields {
00098             Name = 1 << 0,
00099             Level = 1 << 1,
00100             Date = 1 << 2,
00101             Time = 1 << 3,
00102             Score = 1 << 4,
00103             
00104             Custom1 = 1 << 10, 
00105             Custom2 = 1 << 11,
00106             Custom3 = 1 << 12,
00107             Custom4 = 1 << 13,
00108             Custom5 = 1 << 14,
00109             
00110             Max = 1 << 30 
00111         };
00112 
00114         enum AddScoreFlag
00115         {
00116             AskName = 0x1, 
00117             LessIsMore = 0x2 
00118         };
00119         Q_DECLARE_FLAGS(AddScoreFlags, AddScoreFlag)
00120 
00121         typedef QMap<int, QString> FieldInfo;
00122 
00127         explicit KScoreDialog(int fields=Name, QWidget *parent=0);
00128 
00129         ~KScoreDialog();
00130 
00136         void setConfigGroup(const QString& group = QString());
00137         //void setConfigGroup(const QString& group, const QString& i18nName);
00138 
00143         void setComment(const QString& comment);
00144 
00151         void addField(int field, const QString& header, const QString& key);
00152         
00157         void hideField(int field);
00158 
00168         int addScore(const FieldInfo& newInfo = FieldInfo(), const AddScoreFlags& flags=0);
00169         
00179         int addScore(int newScore, const AddScoreFlags& flags=0);
00180         
00184         int highScore();
00185 
00187         virtual void show();
00189         virtual void exec();
00190 
00191         private Q_SLOTS:
00192             void slotGotReturn();
00193             void slotGotName();
00194 
00195         private:
00196             void keyPressEvent(QKeyEvent *ev);
00197 
00198         private:
00199             class KScoreDialogPrivate;
00200             KScoreDialogPrivate* const d;
00201 };
00202 Q_DECLARE_OPERATORS_FOR_FLAGS(KScoreDialog::AddScoreFlags)
00203 
00204 #endif //KSCOREDIALOG_H

libkdegames/highscore

Skip menu "libkdegames/highscore"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal