• Skip to content
  • Skip to link menu
KDE 4.2 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 
00036 class KLocalizedString;
00037 
00095 class KDEGAMES_EXPORT KScoreDialog : public KDialog 
00096 {
00097     Q_OBJECT
00098 
00099     public:
00101         enum Fields {
00102             Name = 1 << 0,
00103             Level = 1 << 1,
00104             Date = 1 << 2,
00105             Time = 1 << 3,
00106             Score = 1 << 4,
00107             
00108             Custom1 = 1 << 10, 
00109             Custom2 = 1 << 11,
00110             Custom3 = 1 << 12,
00111             Custom4 = 1 << 13,
00112             Custom5 = 1 << 14,
00113             
00114             Max = 1 << 30 
00115         };
00116 
00118         enum AddScoreFlag
00119         {
00120             AskName = 0x1, 
00121             LessIsMore = 0x2 
00122         };
00123         Q_DECLARE_FLAGS(AddScoreFlags, AddScoreFlag)
00124 
00125         typedef QMap<int, QString> FieldInfo;
00126 
00131         explicit KScoreDialog(int fields=Name, QWidget *parent=0);
00132 
00133         ~KScoreDialog();
00134 
00145         void KDE_DEPRECATED setConfigGroup(const QString& group = QString());
00146         //void setConfigGroup(const QString& group, const QString& i18nName);
00147 
00157         void setConfigGroup(const QPair<QByteArray, QString>& group);
00158         
00167         void addLocalizedConfigGroupName(const QPair<QByteArray, QString>& group);
00168         
00179         void addLocalizedConfigGroupNames(const QMap<QByteArray, QString>& groups);
00180 
00185         void setComment(const QString& comment);
00186 
00193         void addField(int field, const QString& header, const QString& key);
00194         
00199         void hideField(int field);
00200 
00210         int addScore(const FieldInfo& newInfo = FieldInfo(), const AddScoreFlags& flags=0);
00211         
00221         int addScore(int newScore, const AddScoreFlags& flags=0);
00222         
00226         int highScore();
00227 
00229         virtual void show();
00231         virtual void exec();
00232 
00233         private Q_SLOTS:
00234             void slotGotReturn();
00235             void slotGotName();
00236 
00237         private:
00238             void keyPressEvent(QKeyEvent *ev);
00239 
00240         private:
00241             class KScoreDialogPrivate;
00242             KScoreDialogPrivate* const d;
00243 };
00244 Q_DECLARE_OPERATORS_FOR_FLAGS(KScoreDialog::AddScoreFlags)
00245 
00246 #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