• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames/kgame

kgamedialogconfig.h

Go to the documentation of this file.
00001 /*
00002     This file is part of the KDE games library
00003     Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de)
00004     Copyright (C) 2001 Martin Heni (kde at heni-online.de)
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License version 2 as published by the Free Software Foundation.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, USA.
00019 */
00020 
00021 // NAMING
00022 // please follow these naming rules if you add/change classes:
00023 // the main dialog is named KGameDialog and the base config widget
00024 // KGameDialogConfig. All config widgets are named KGameDialogXYZConfig (where
00025 // XYZ = the name of the config widget, like "general" or "network") and are
00026 // inherited from KGameDialogConfig.
00027 
00028 #ifndef __KGAMEDIALOGCONFIG_H__
00029 #define __KGAMEDIALOGCONFIG_H__
00030 
00031 #include <QtGui/QWidget>
00032 #include <libkdegames_export.h>
00033 
00034 class QListWidgetItem;
00035 
00036 class KGame;
00037 class KPlayer;
00038 class KGamePropertyBase;
00039 
00040 class KGameDialogConfigPrivate;
00051 class KDEGAMES_EXPORT KGameDialogConfig : public QWidget
00052 {
00053     Q_OBJECT
00054 public:
00055     KGameDialogConfig(QWidget* parent = 0);
00056     virtual ~KGameDialogConfig();
00057 
00065     virtual void submitToKGame(KGame* g, KPlayer* p) = 0;
00066 
00078     virtual void setOwner(KPlayer* p);
00079 
00088     virtual void setKGame(KGame* g);
00089 
00104     virtual void setAdmin(bool admin);
00105 
00112     KGame* game() const;
00113 
00121     KPlayer* owner() const;
00122 
00127     bool admin() const;
00128 
00129 protected:
00130 
00131 private:
00132     KGameDialogConfigPrivate* const d;
00133 };
00134 
00135 class KGameDialogGeneralConfigPrivate;
00146 class KGameDialogGeneralConfig : public KGameDialogConfig
00147 {
00148     Q_OBJECT
00149 public:
00165         explicit KGameDialogGeneralConfig(QWidget* parent = 0, bool initializeGUI = true);
00166     virtual ~KGameDialogGeneralConfig();
00167 
00175     virtual void submitToKGame(KGame* g, KPlayer* p);
00176 
00183     virtual void setOwner(KPlayer* p);
00184 
00191     virtual void setKGame(KGame* g);
00192 
00198     virtual void setAdmin(bool admin);
00199 
00200 protected Q_SLOTS:
00201     void slotPropertyChanged(KGamePropertyBase*, KPlayer*);
00202 
00203 protected:
00204     void setPlayerName(const QString& name);
00205 
00206     QString playerName() const;
00207 
00208 private:
00209     KGameDialogGeneralConfigPrivate* d;
00210 };
00211 
00212 class KGameDialogNetworkConfigPrivate;
00216 class KDEGAMES_EXPORT KGameDialogNetworkConfig : public KGameDialogConfig
00217 {
00218     Q_OBJECT
00219 public:
00220     KGameDialogNetworkConfig(QWidget* parent = 0);
00221     virtual ~KGameDialogNetworkConfig();
00222 
00223 
00224     void disableInitConnection();
00225 
00233     virtual void submitToKGame(KGame* g, KPlayer* p);
00234 
00235     virtual void setKGame(KGame* g);
00236 
00247     void setDefaultNetworkInfo(const QString& host, unsigned short int port,bool server=true);
00248     
00256     void setDiscoveryInfo(const QString& type, const QString& name=QString());
00257     
00258 Q_SIGNALS:
00265   void signalServerTypeChanged(int t);
00266 
00267 
00268 protected:
00269     void setConnected(bool connected, bool master = false);
00270 
00271 protected Q_SLOTS:
00272     void slotInitConnection();
00273     void slotExitConnection();
00274     void slotConnectionBroken();
00275 
00276 
00277 private:
00278     KGameDialogNetworkConfigPrivate* d;
00279 };
00280 
00281 class KGameDialogMsgServerConfigPrivate;
00285 class KGameDialogMsgServerConfig : public KGameDialogConfig
00286 {
00287     Q_OBJECT
00288 public:
00289     KGameDialogMsgServerConfig(QWidget* parent = 0);
00290     virtual ~KGameDialogMsgServerConfig();
00291 
00292     virtual void submitToKGame(KGame* g, KPlayer* p) { Q_UNUSED(g); Q_UNUSED(p); }
00293 
00294     void setHasMsgServer(bool);
00295 
00296     virtual void setKGame(KGame* g);
00297     virtual void setAdmin(bool admin);
00298 
00299 protected Q_SLOTS:
00300     void slotChangeMaxClients();
00301     void slotChangeAdmin();
00302     void slotRemoveClient();
00303 
00304 protected:
00305     void removeClient(quint32 id);
00306 
00307 private:
00308     KGameDialogMsgServerConfigPrivate* d;
00309 };
00310 
00311 class KGameDialogChatConfigPrivate;
00320 class KGameDialogChatConfig : public KGameDialogConfig
00321 {
00322     Q_OBJECT
00323 public:
00324     explicit KGameDialogChatConfig(int chatMsgId, QWidget* parent = 0);
00325     virtual ~KGameDialogChatConfig();
00326 
00327     virtual void setKGame(KGame* g);
00328     virtual void setOwner(KPlayer* p);
00329 
00330     virtual void submitToKGame(KGame* g, KPlayer* p) { Q_UNUSED(g); Q_UNUSED(p); }
00331 
00332 private:
00333     KGameDialogChatConfigPrivate* d;
00334 };
00335 
00336 class KGameDialogConnectionConfigPrivate;
00343 class KGameDialogConnectionConfig : public KGameDialogConfig
00344 {
00345     Q_OBJECT
00346 public:
00347     KGameDialogConnectionConfig(QWidget* parent = 0);
00348     virtual ~KGameDialogConnectionConfig();
00349 
00350     virtual void setKGame(KGame* g);
00351     virtual void setOwner(KPlayer* p);
00352     virtual void setAdmin(bool admin);
00353 
00354     virtual void submitToKGame(KGame* g, KPlayer* p) { Q_UNUSED(g); Q_UNUSED(p); }
00355 
00356 protected:
00361     QListWidgetItem* item(KPlayer* p) const;
00362 
00363 protected Q_SLOTS:
00364     void slotKickPlayerOut(QListWidgetItem* item);
00365     void slotPropertyChanged(KGamePropertyBase* prop, KPlayer* p);
00366     void slotPlayerLeftGame(KPlayer* p);
00367     void slotPlayerJoinedGame(KPlayer* p);
00368     void slotClearPlayers();
00369 
00370 private:
00371     KGameDialogConnectionConfigPrivate* d;
00372         
00373 };
00374 #endif

libkdegames/kgame

Skip menu "libkdegames/kgame"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • 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