kgamedifficulty.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2007, Nicolas Roffet, <nicolas-kde@roffet.com>
00003 Copyright (c) 2007, Pino Toscano, <toscano.pino@tiscali.it>
00004 
00005 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
00006 
00007 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public License for more details.
00008 
00009 You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
00010 */
00011 
00012 #ifndef KGAMEDIFFICULTY_H
00013 #define KGAMEDIFFICULTY_H
00014 
00015 
00016 
00017 class QObject;
00018 
00019 
00020 class KGameDifficultyPrivate;
00021 class KXmlGuiWindow;
00022 #include <libkdegames_export.h>
00023 
00024 
00025 
00074 class KDEGAMES_EXPORT KGameDifficulty
00075 {
00076         public:
00082                 enum onChange {
00083                         RestartOnChange, 
00084                         NoRestartOnChange 
00085                 };
00086 
00092                 enum standardLevel {
00093                         RidiculouslyEasy = 10, 
00094                         VeryEasy = 20, 
00095                         Easy = 30, 
00096                         Medium = 40, 
00097                         Hard = 50, 
00098                         VeryHard = 60, 
00099                         ExtremelyHard = 70, 
00100                         Impossible = 80, 
00101                         Configurable = 90, 
00102                         Custom = 100, 
00103                         NoLevel = 110 
00104                 };
00105 
00106 
00110                 virtual ~KGameDifficulty();
00111 
00122                 static void init(KXmlGuiWindow* window, const QObject *recvr, const char* slotStandard, const char* slotCustom = 0);
00123 
00130                 static void setRestartOnChange(onChange restart);
00131 
00139                 static void addStandardLevel(standardLevel level);
00140 
00146                 static void removeStandardLevel(standardLevel level);
00147 
00156                 static void addCustomLevel(int key, const QString& appellation);
00157 
00163                 static void removeCustomLevel(int key);
00164 
00172                 static void setEnabled(bool enabled);
00173 
00179                 static void setLevel(standardLevel level);
00180 
00186                 static standardLevel level();
00190                 static QString levelString();
00197                 static void setLevelCustom(int key);
00198 
00205                 static int levelCustom();
00206 
00214                 static void setRunning(bool running);
00215 
00216 
00217         private:
00221                 KGameDifficulty();
00228                 static KGameDifficulty* self();
00229 
00230                 static KGameDifficulty* instance;
00231                 friend class KGameDifficultyPrivate;
00232                 KGameDifficultyPrivate* const d;
00233 
00234                 Q_DISABLE_COPY(KGameDifficulty)
00235 };
00236 
00237 #endif //KGAMEDIFFICULTY_H

Generated on Sun Mar 16 08:02:53 2008 for Libkdegames by  doxygen 1.5.3