diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | c90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch) | |
tree | 6d8391395bce9eaea4ad78958617edb20c6a7573 /kwin4/kwin4/kwin4.h | |
download | tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kwin4/kwin4/kwin4.h')
-rw-r--r-- | kwin4/kwin4/kwin4.h | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/kwin4/kwin4/kwin4.h b/kwin4/kwin4/kwin4.h new file mode 100644 index 00000000..572381f1 --- /dev/null +++ b/kwin4/kwin4/kwin4.h @@ -0,0 +1,126 @@ +/*************************************************************************** + Kwin4 - Four in a Row for KDE + ------------------- + begin : March 2000 + copyright : (C) 1995-2001 by Martin Heni + email : martin@heni-online.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KWIN4_H +#define KWIN4_H + +#include <kmainwindow.h> +#include <kdialogbase.h> +#include "kwin4doc.h" +#include <kdemacros.h> +class Kwin4Player; +class KGameChat; +class KChatDialog; +class Kwin4Doc; +class Kwin4View; +class QVButtonGroup; +class KPlayer; + +/** + * Subclass of the chat dialog provided by the KGame lib. + * It supports a user defined chat and the setting of the + * owner player + **/ +class KDE_EXPORT ChatDlg : public KDialogBase +{ + Q_OBJECT +public: + ChatDlg(KGame *game,QWidget* parent=0); + +public slots: + void setPlayer(Kwin4Player *p); + +private: + KGameChat *mChat; + KChatDialog *mChatDlg; +}; + +/** + * The base class for Kwin4 application window. + */ +class Kwin4App : public KMainWindow +{ + +Q_OBJECT + +public: + Kwin4App(QWidget *parent=0, const char *name=0); + +protected: + void EndGame(TABLE mode); + + // Flags which menus should be checked and set by below functions + enum CheckFlags {All=0,CheckFileMenu=1,CheckEditMenu=2}; + + void changeAction(const char *,bool); + // Enabled/Disabled menu/toolbar items + void enableAction(const char *action) {changeAction(action, true); } + void disableAction(const char *action) {changeAction(action, false); } + // Checks all menus..usually done on init programm + void checkMenus(CheckFlags menu=All); + + void initGUI(); + void initStatusBar(); + void initDocument(); + + virtual void saveProperties(KConfig *cfg); + virtual void readProperties(KConfig *cfg); + +public slots: + void slotServerTypeChanged(int t); + + void slotRemoteChanged(int who); + void slotGameOver(int status, KPlayer * p, KGame * me); + void slotMoveDone(int x, int y); + + void slotNetworkBroken(int id, int oldstatus ,KGame *game); + /** Being noticed that a new game started */ + void slotNewGame(); + void slotStatusNames(); + + void slotInitNetwork(); + void slotChat(); + void slotDebugKGame(); + + void newGame(); + void slotOpenGame(); + void slotSaveGame(); + void endGame(); + void showStatistics(); + + void slotUndo(); + void slotRedo(); + + void slotStatusMover(const QString &text); + void slotStatusMsg(const QString &text); + +private: + Kwin4View *view; + Kwin4Doc *doc; + + QVButtonGroup *mColorGroup; + KGameChat *mChat; + ChatDlg *mMyChatDlg; + +protected slots: + void slotClearStatusText(); + + void showSettings(); +}; + +#endif // KWIN4_H + |