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

libkdegames/kgame

kgamedialog.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 __KGAMEDIALOG_H__
00029 #define __KGAMEDIALOG_H__
00030 
00031 #include <kpagedialog.h>
00032 #include <libkdegames_export.h>
00033 #include <QtGui/QVBoxLayout>
00034 #include <QtGui/QGridLayout>
00035 class QGridLayout;
00036 class QVBoxLayout;
00037 class KVBox;
00038 
00039 class KGame;
00040 class KPlayer;
00041 
00042 class KGameDialogConfig;
00043 class KGameDialogGeneralConfig;
00044 class KGameDialogNetworkConfig;
00045 class KGameDialogMsgServerConfig;
00046 class KGameDialogChatConfig;
00047 class KGameDialogConnectionConfig;
00048 
00049 class KGameDialogPrivate;
00077 class KDEGAMES_EXPORT KGameDialog : public KPageDialog
00078 {
00079     Q_OBJECT
00080 public:
00081 
00082     enum ConfigOptions
00083     {
00084         NoConfig = 0,
00085         ChatConfig = 1,
00086         GameConfig = 2,
00087         NetworkConfig = 4,
00088         MsgServerConfig = 8,
00089         BanPlayerConfig = 16,
00090         AllConfig = 0xffff
00091     };
00092 
00103     KGameDialog(KGame* g, KPlayer* owner, const QString& title, 
00104             QWidget* parent, bool modal = false);
00105     
00135     KGameDialog(KGame* g, KPlayer* owner, const QString& title, 
00136             QWidget* parent, long initConfigs = AllConfig, 
00137             int chatMsgId = 15432, bool modal = false);
00138 
00139     virtual ~KGameDialog();
00140 
00141 
00154     void setOwner(KPlayer* owner);
00155 
00163     void setKGame(KGame* g);
00164 
00171     virtual void submitToKGame();
00172 
00181     void addChatWidget(KGameDialogChatConfig* chat, KVBox* parent = 0);
00182 
00195     void addConnectionList(KGameDialogConnectionConfig* c, KVBox* parent = 0);
00196 
00207     KVBox* addConfigPage(KGameDialogConfig* widget, const QString& title);
00208 
00213     KVBox *configPage(ConfigOptions which);
00214 
00219     KGameDialogNetworkConfig* networkConfig() const;
00220 
00225     KGameDialogGeneralConfig* gameConfig() const;
00226 
00233     void addConfigWidget(KGameDialogConfig* widget, QWidget* parent);
00234 
00239     void addNetworkConfig(KGameDialogNetworkConfig* netConf);
00240 
00245     void addGameConfig(KGameDialogGeneralConfig* conf);
00246 
00250     void addMsgServerConfig(KGameDialogMsgServerConfig* conf);
00251 
00252 protected:
00253 
00267     void initDefaultDialog(ConfigOptions initConfigs, int chatMsgId = 15432);
00268 
00276     void configureConfigWidgets();
00277 
00278 protected Q_SLOTS:
00283     virtual void slotOk();
00284 
00288     virtual void slotApply();
00289 
00295     virtual void slotDefault();
00296 
00301     void slotUnsetKGame();
00302 
00308     void setAdmin(bool isAdmin);
00309 
00314     void slotRemoveConfigWidget(QObject* configWidget);
00315 
00316 private:
00317     void init(KGame*, KPlayer*);
00318 
00319 private:
00320     KGameDialogPrivate* const d;
00321 };
00322 
00323 #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