kgamedialog.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __KGAMEDIALOG_H__
00029 #define __KGAMEDIALOG_H__
00030
00031 #include <kdialogbase.h>
00032 #include <kdemacros.h>
00033 class QGridLayout;
00034 class QVBoxLayout;
00035 class QListBoxItem;
00036
00037 class KGame;
00038 class KPlayer;
00039 class KGamePropertyBase;
00040
00041 class KGameDialogConfig;
00042 class KGameDialogGeneralConfig;
00043 class KGameDialogNetworkConfig;
00044 class KGameDialogMsgServerConfig;
00045 class KGameDialogChatConfig;
00046 class KGameDialogConnectionConfig;
00047
00048 class KGameDialogPrivate;
00074 class KDE_EXPORT KGameDialog : public KDialogBase
00075 {
00076 Q_OBJECT
00077 public:
00078
00079 enum ConfigOptions
00080 {
00081 NoConfig = 0,
00082 ChatConfig = 1,
00083 GameConfig = 2,
00084 NetworkConfig = 4,
00085 MsgServerConfig = 8,
00086 BanPlayerConfig = 16,
00087 AllConfig = 0xffff
00088 };
00089
00100 KGameDialog(KGame* g, KPlayer* owner, const QString& title,
00101 QWidget* parent, bool modal = false);
00102
00132 KGameDialog(KGame* g, KPlayer* owner, const QString& title,
00133 QWidget* parent, long initConfigs = AllConfig,
00134 int chatMsgId = 15432, bool modal = false);
00135
00136 virtual ~KGameDialog();
00137
00138
00151 void setOwner(KPlayer* owner);
00152
00160 void setKGame(KGame* g);
00161
00168 virtual void submitToKGame();
00169
00178 void addChatWidget(KGameDialogChatConfig* chat, QVBox* parent = 0);
00179
00192 void addConnectionList(KGameDialogConnectionConfig* c, QVBox* parent = 0);
00193
00204 QVBox* addConfigPage(KGameDialogConfig* widget, const QString& title);
00205
00210 QVBox *configPage(ConfigOptions which);
00211
00216 KGameDialogNetworkConfig* networkConfig() const;
00217
00222 KGameDialogGeneralConfig* gameConfig() const;
00223
00230 void addConfigWidget(KGameDialogConfig* widget, QWidget* parent);
00231
00236 void addNetworkConfig(KGameDialogNetworkConfig* netConf);
00237
00242 void addGameConfig(KGameDialogGeneralConfig* conf);
00243
00247 void addMsgServerConfig(KGameDialogMsgServerConfig* conf);
00248
00249 protected:
00250
00264 void initDefaultDialog(ConfigOptions initConfigs, int chatMsgId = 15432);
00265
00273 void configureConfigWidgets();
00274
00275 protected slots:
00280 virtual void slotOk();
00281
00285 virtual void slotApply();
00286
00292 virtual void slotDefault();
00293
00298 void slotUnsetKGame();
00299
00305 void setAdmin(bool isAdmin);
00306
00311 void slotRemoveConfigWidget(QObject* configWidget);
00312
00313 private:
00314 void init(KGame*, KPlayer*);
00315
00316 private:
00317 KGameDialogPrivate* d;
00318 };
00319
00320 #endif
|