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

libtdegames

  • libtdegames
  • kgame
  • dialogs
kgamedialog.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 __KGAMEDIALOG_H__
29 #define __KGAMEDIALOG_H__
30 
31 #include <kdialogbase.h>
32 #include <tdemacros.h>
33 class TQGridLayout;
34 class TQVBoxLayout;
35 class TQListBoxItem;
36 
37 class KGame;
38 class KPlayer;
39 class KGamePropertyBase;
40 
41 class KGameDialogConfig;
42 class KGameDialogGeneralConfig;
43 class KGameDialogNetworkConfig;
44 class KGameDialogMsgServerConfig;
45 class KGameDialogChatConfig;
46 class KGameDialogConnectionConfig;
47 
48 class KGameDialogPrivate;
74 class TDE_EXPORT KGameDialog : public KDialogBase
75 {
76  TQ_OBJECT
77 
78 public:
79 
80  enum ConfigOptions
81  {
82  NoConfig = 0,
83  ChatConfig = 1,
84  GameConfig = 2,
85  NetworkConfig = 4,
86  MsgServerConfig = 8,
87  BanPlayerConfig = 16,
88  AllConfig = 0xffff
89  };
90 
101  KGameDialog(KGame* g, KPlayer* owner, const TQString& title,
102  TQWidget* parent, bool modal = false);
103 
133  KGameDialog(KGame* g, KPlayer* owner, const TQString& title,
134  TQWidget* parent, long initConfigs = AllConfig,
135  int chatMsgId = 15432, bool modal = false);
136 
137  virtual ~KGameDialog();
138 
139 
152  void setOwner(KPlayer* owner);
153 
161  void setKGame(KGame* g);
162 
169  virtual void submitToKGame();
170 
179  void addChatWidget(KGameDialogChatConfig* chat, TQVBox* parent = 0);
180 
193  void addConnectionList(KGameDialogConnectionConfig* c, TQVBox* parent = 0);
194 
205  TQVBox* addConfigPage(KGameDialogConfig* widget, const TQString& title);
206 
211  TQVBox *configPage(ConfigOptions which);
212 
217  KGameDialogNetworkConfig* networkConfig() const;
218 
223  KGameDialogGeneralConfig* gameConfig() const;
224 
231  void addConfigWidget(KGameDialogConfig* widget, TQWidget* parent);
232 
237  void addNetworkConfig(KGameDialogNetworkConfig* netConf);
238 
243  void addGameConfig(KGameDialogGeneralConfig* conf);
244 
248  void addMsgServerConfig(KGameDialogMsgServerConfig* conf);
249 
250 protected:
251 
265  void initDefaultDialog(ConfigOptions initConfigs, int chatMsgId = 15432);
266 
274  void configureConfigWidgets();
275 
276 protected slots:
281  virtual void slotOk();
282 
286  virtual void slotApply();
287 
293  virtual void slotDefault();
294 
299  void slotUnsetKGame();
300 
306  void setAdmin(bool isAdmin);
307 
312  void slotRemoveConfigWidget(TQObject* configWidget);
313 
314 private:
315  void init(KGame*, KPlayer*);
316 
317 private:
318  KGameDialogPrivate* d;
319 };
320 
321 #endif
KGameDialogConfig
Base class for configuration widgets.
Definition: kgamedialogconfig.h:51
KPlayer
Base class for a game player.
Definition: kplayer.h:69
KGameDialog
TODO: rewrite entire documentation.
Definition: kgamedialog.h:74
KGamePropertyBase
Base class of KGameProperty.
Definition: kgameproperty.h:42
KGameDialogChatConfig
This is not really a configuration widget but rather a simple chat widget.
Definition: kgamedialogconfig.h:314
KGame
The main KDE game object.
Definition: kgame.h:62

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.8.13
This website is maintained by Timothy Pearson.