• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdegames
 

libtdegames

  • libtdegames
  • kgame
  • dialogs
kgamedialogconfig.h
1 /*
2  This file is part of the TDE games library
3  Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de)
4  Copyright (C) 2001 Martin Heni (martin@heni-online.de)
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 // NAMING
22 // please follow these naming rules if you add/change classes:
23 // the main dialog is named KGameDialog and the base config widget
24 // KGameDialogConfig. All config widgets are named KGameDialogXYZConfig (where
25 // XYZ = the name of the config widget, like "general" or "network") and are
26 // inherited from KGameDialogConfig.
27 
28 #ifndef __KGAMEDIALOGCONFIG_H__
29 #define __KGAMEDIALOGCONFIG_H__
30 
31 #include <tqwidget.h>
32 #include <tdemacros.h>
33 
34 class TQGridLayout;
35 class TQVBoxLayout;
36 class TQListBoxItem;
37 
38 class KGame;
39 class KPlayer;
40 class KGamePropertyBase;
41 
42 class KGameDialogConfigPrivate;
51 class TDE_EXPORT KGameDialogConfig : public TQWidget
52 {
53  TQ_OBJECT
54 
55 public:
56  KGameDialogConfig(TQWidget* parent = 0);
57  virtual ~KGameDialogConfig();
58 
66  virtual void submitToKGame(KGame* g, KPlayer* p) = 0;
67 
79  virtual void setOwner(KPlayer* p);
80 
89  virtual void setKGame(KGame* g);
90 
105  virtual void setAdmin(bool admin);
106 
113  KGame* game() const;
114 
122  KPlayer* owner() const;
123 
128  bool admin() const;
129 
130 protected:
131 
132 private:
133  KGameDialogConfigPrivate* d;
134 };
135 
144 class KGameDialogGeneralConfigPrivate;
145 class KGameDialogGeneralConfig : public KGameDialogConfig
146 {
147  TQ_OBJECT
148 
149 public:
165  KGameDialogGeneralConfig(TQWidget* parent = 0, bool initializeGUI = true);
166  virtual ~KGameDialogGeneralConfig();
167 
175  virtual void submitToKGame(KGame* g, KPlayer* p);
176 
183  virtual void setOwner(KPlayer* p);
184 
191  virtual void setKGame(KGame* g);
192 
198  virtual void setAdmin(bool admin);
199 
200 protected slots:
201  void slotPropertyChanged(KGamePropertyBase*, KPlayer*);
202 
203 protected:
204  void setPlayerName(const TQString& name);
205 
206  TQString playerName() const;
207 
208 private:
209  KGameDialogGeneralConfigPrivate* d;
210 };
211 
212 class KGameDialogNetworkConfigPrivate;
213 class TDE_EXPORT KGameDialogNetworkConfig : public KGameDialogConfig
214 {
215  TQ_OBJECT
216 
217 public:
218  KGameDialogNetworkConfig(TQWidget* parent = 0);
219  virtual ~KGameDialogNetworkConfig();
220 
221 
222  void disableInitConnection();
223 
231  virtual void submitToKGame(KGame* g, KPlayer* p);
232 
233  virtual void setKGame(KGame* g);
234 
244  void setDefaultNetworkInfo(const TQString& host, unsigned short int port,bool server=true);
245 
254  void setDiscoveryInfo(const TQString& type, const TQString& name=TQString());
255 
256 signals:
263  void signalServerTypeChanged(int);
264 
265 
266 protected:
267  void setConnected(bool connected, bool master = false);
268 
269 protected slots:
270  void slotInitConnection();
271  void slotExitConnection();
272  void slotConnectionBroken();
273 
274 
275 private:
276  KGameDialogNetworkConfigPrivate* d;
277 };
278 
279 class KGameDialogMsgServerConfigPrivate;
280 class KGameDialogMsgServerConfig : public KGameDialogConfig
281 {
282  TQ_OBJECT
283 
284 public:
285  KGameDialogMsgServerConfig(TQWidget* parent = 0);
286  virtual ~KGameDialogMsgServerConfig();
287 
288  virtual void submitToKGame(KGame*, KPlayer*) {}
289 
290  void setHasMsgServer(bool);
291 
292  virtual void setKGame(KGame* g);
293  virtual void setAdmin(bool);
294 
295 protected slots:
296  void slotChangeMaxClients();
297  void slotChangeAdmin();
298  void slotRemoveClient();
299 
300 protected:
301  void removeClient(TQ_UINT32 id);
302 
303 private:
304  KGameDialogMsgServerConfigPrivate* d;
305 };
306 
307 class KGameDialogChatConfigPrivate;
314 class KGameDialogChatConfig : public KGameDialogConfig
315 {
316  TQ_OBJECT
317 
318 public:
319  KGameDialogChatConfig(int chatMsgId, TQWidget* parent = 0);
320  virtual ~KGameDialogChatConfig();
321 
322  virtual void setKGame(KGame* g);
323  virtual void setOwner(KPlayer* p);
324 
325  virtual void submitToKGame(KGame* g, KPlayer* p) { Q_UNUSED(g); Q_UNUSED(p); }
326 
327 private:
328  KGameDialogChatConfigPrivate* d;
329 };
330 
335 class KGameDialogConnectionConfigPrivate;
336 class KGameDialogConnectionConfig : public KGameDialogConfig
337 {
338  TQ_OBJECT
339 
340 public:
341  KGameDialogConnectionConfig(TQWidget* parent = 0);
342  virtual ~KGameDialogConnectionConfig();
343 
344  virtual void setKGame(KGame* g);
345  virtual void setOwner(KPlayer* p);
346  virtual void setAdmin(bool admin);
347 
348  virtual void submitToKGame(KGame* g, KPlayer* p) { Q_UNUSED(g); Q_UNUSED(p); }
349 
350 protected:
355  TQListBoxItem* item(KPlayer* p) const;
356 
357 protected slots:
358  void slotKickPlayerOut(TQListBoxItem* item);
359  void slotPropertyChanged(KGamePropertyBase* prop, KPlayer* p);
360  void slotPlayerLeftGame(KPlayer* p);
361  void slotPlayerJoinedGame(KPlayer* p);
362  void slotClearPlayers();
363 
364 private:
365  KGameDialogConnectionConfigPrivate* d;
366 
367 };
368 #endif
KGameDialogChatConfig
This is not really a configuration widget but rather a simple chat widget.
Definition: kgamedialogconfig.h:315
KGameDialogChatConfig::setKGame
virtual void setKGame(KGame *g)
The KGame object of the dialog has been changed.
Definition: kgamedialogconfig.cpp:566
KGameDialogChatConfig::submitToKGame
virtual void submitToKGame(KGame *g, KPlayer *p)
Called by KGameDialog to submit all settings to the KGame Object.
Definition: kgamedialogconfig.h:325
KGameDialogChatConfig::setOwner
virtual void setOwner(KPlayer *p)
The owner player of the dialog has been changed.
Definition: kgamedialogconfig.cpp:577
KGameDialogConfig
Base class for configuration widgets.
Definition: kgamedialogconfig.h:52
KGameDialogConfig::setAdmin
virtual void setAdmin(bool admin)
The admin status has been changed.
Definition: kgamedialogconfig.cpp:81
KGameDialogConfig::setOwner
virtual void setOwner(KPlayer *p)
The owner player of the dialog has been changed.
Definition: kgamedialogconfig.cpp:76
KGameDialogConfig::setKGame
virtual void setKGame(KGame *g)
The KGame object of the dialog has been changed.
Definition: kgamedialogconfig.cpp:71
KGameDialogConfig::submitToKGame
virtual void submitToKGame(KGame *g, KPlayer *p)=0
Called by KGameDialog to submit all settings to the KGame Object.
KGamePropertyBase
Base class of KGameProperty.
Definition: kgameproperty.h:43
KGame
The main KDE game object.
Definition: kgame.h:63
KPlayer
Base class for a game player.
Definition: kplayer.h:70

libtdegames

Skip menu "libtdegames"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdegames

Skip menu "libtdegames"
  • libtdegames
Generated for libtdegames by doxygen 1.9.1
This website is maintained by Timothy Pearson.