kwin4.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           Kwin4  -  Four in a Row for KDE
00003                              -------------------
00004     begin                : March 2000 
00005     copyright            : (C) 1995-2007 by Martin Heni
00006     email                : kde@heni-online.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef KWIN4_H
00019 #define KWIN4_H
00020 
00021 // Qt includes
00022 #include <QGraphicsScene>
00023  
00024 // KDE includes
00025 #include <kmainwindow.h>
00026 #include <kdemacros.h>
00027 
00028 // local includes
00029 #include "kwin4global.h"
00030 #include "thememanager.h"
00031 
00032 
00033 class Kwin4Player;
00034 class KWin4Doc;
00035 class KWin4View;
00036 class KButtonGroup;
00037 class KPlayer;
00038 class KGameChat;
00039 class ChatDlg;
00040 class KGame;
00041 
00045 class KWin4App : public KMainWindow
00046 {
00047 
00048   Q_OBJECT
00049 
00050   public:
00054     KWin4App(QWidget *parent=0);
00055     
00058     ~KWin4App();
00059 
00060   protected:
00065     void EndGame(TABLE mode);
00066 
00069     enum CheckFlags {All=0,CheckFileMenu=1,CheckEditMenu=2};
00070   
00075     void changeAction(const char* action,bool enable);
00076     
00080     void enableAction(const char *action) {changeAction(action, true); } ;
00081     
00085     void disableAction(const char *action) {changeAction(action, false); } ;
00086     
00091     void checkMenus(CheckFlags menu=All);
00092   
00095     void initGUI();
00096     
00099     void initStatusBar();
00100     
00103     void initDocument();
00104   
00108     virtual void saveProperties(KConfigGroup& cfg);
00109     
00113     virtual void readProperties(const KConfigGroup& cfg);
00114     
00115   public slots:
00119     void serverTypeChanged(int t);
00120   
00124     void remoteChanged(int who);
00125     
00131     void slotGameOver(int status, KPlayer* p, KGame* me);
00132     
00136     void moveDone(int playerNumber);
00137 
00143     void networkBroken(int id, int oldstatus ,KGame* game);
00144     
00147     void gameRun();
00148     
00151     void updateStatusNames();
00152 
00155     void configureNetwork();
00156     
00159     void configureChat();
00160     
00163     void debugKGame();
00164 
00167     void menuNewGame();
00168     
00171     void menuOpenGame();
00172     
00175     void menuSaveGame();
00176     
00179     void endGame();
00180     
00183     void showStatistics();
00184     
00188     void askForHint();
00189     
00193     void changeTheme(const QString& name);
00194 
00197     void undoMove();
00198     
00201     void redoMove();
00202 
00206     void displayStatusbarMover(const QString& text);
00207     
00211     void displayStatusMessage(const QString& text);
00212 
00215     void configureSettings();
00216 
00217   private:
00218     // The theme manager used
00219     ThemeManager* mTheme;
00220     
00221     // The game view
00222     KWin4View *mView;
00223     
00224     // The game document/engine
00225     KWin4Doc *mDoc;
00226     
00227     // The graphics scene to use
00228     QGraphicsScene* mScene;
00229     
00230     // The directory for the theme files
00231     QString mThemeDirName;
00232 
00233     // Buttons of the network dialog
00234     KButtonGroup *mColorGroup;
00235     
00236     // The chat dialog
00237     ChatDlg *mMyChatDlg;  
00238 
00239 };
00240  
00241 #endif // KWIN4_H
00242 

Generated on Sun Mar 4 10:56:43 2007 for KWin4 by  doxygen 1.4.6