kmahjongg
kmahjongg.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _KMAHJONGG_H
00024 #define _KMAHJONGG_H
00025
00026 #include <kxmlguiwindow.h>
00027
00028 #include "KmTypes.h"
00029 #include "kmahjonggtileset.h"
00030 #include "kmahjonggbackground.h"
00031 #include "BoardLayout.h"
00032 #include "boardwidget.h"
00033
00034 class QAction;
00035 class KToggleAction;
00036 class QLabel;
00037 class KGameClock;
00038
00044 class KMahjongg : public KXmlGuiWindow
00045 {
00046 Q_OBJECT
00047
00048 public:
00051 explicit KMahjongg( QWidget* parent = 0 );
00054 ~KMahjongg();
00055
00056 public slots:
00059 void startNewGame( int num = -1 );
00065 void showStatusText ( const QString &msg, long board);
00072 void showTileNumber( int iMaximum, int iCurrent, int iLeft );
00075 void demoModeChanged( bool bActive );
00081 void gameOver( unsigned short removed, unsigned short cheats);
00084
00087 void setDisplayedWidth();
00090 void newGame();
00093 void timerReset();
00094
00095 private slots:
00096 void showSettings();
00097
00098 void startNewNumeric();
00099 void saveGame();
00100 void loadGame();
00101 void restartGame();
00102 void undo();
00103 void redo();
00104 void pause();
00105 void demoMode();
00106 void displayTime(const QString& timestring);
00107 void showHighscores();
00108
00109
00110 protected:
00113 void setupKAction();
00116 void setupStatusBar();
00117
00118 private:
00119
00120 unsigned long gameElapsedTime;
00121 BoardWidget* bw;
00122
00123 QLabel *gameNumLabel;
00124 QLabel *tilesLeftLabel;
00125 QLabel *statusLabel;
00126 QLabel *gameTimerLabel;
00127
00128 KGameClock *gameTimer;
00129
00130 bool bDemoModeActive;
00131
00132 KToggleAction *pauseAction, *demoAction;
00133 QAction *undoAction, *redoAction;
00134
00135 };
00136
00137 #endif
00138