KGameDialogConfig Class Reference

Base class for configuration widgets.Base class for configuration widgets. More...

#include <kgamedialogconfig.h>

Inheritance diagram for KGameDialogConfig:

Inheritance graph
[legend]
Collaboration diagram for KGameDialogConfig:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 KGameDialogConfig (QWidget *parent=0)
virtual ~KGameDialogConfig ()
virtual void submitToKGame (KGame *g, KPlayer *p)=0
 Called by KGameDialog to submit all settings to the KGame Object.
virtual void setOwner (KPlayer *p)
 The owner player of the dialog has been changed.
virtual void setKGame (KGame *g)
 The KGame object of the dialog has been changed.
virtual void setAdmin (bool admin)
 The admin status has been changed.
KGamegame () const
 A pointer to the KGame object that has been set by setKGame.
KPlayerowner () const
 A pointer to the KPlayer object that has been set by setOwner.
bool admin () const

Detailed Description

Base class for configuration widgets.Base class for configuration widgets.

You can inherit from this and implement submitToKGame, setOwner and setKGame to create your personal KGame configuration widget :-)

Author:
Andreas Beckermann <b_mann@gmx.de>

Definition at line 51 of file kgamedialogconfig.h.


Constructor & Destructor Documentation

KGameDialogConfig::KGameDialogConfig QWidget *  parent = 0  ) 
 

Definition at line 60 of file kgamedialogconfig.cpp.

KGameDialogConfig::~KGameDialogConfig  )  [virtual]
 

Definition at line 65 of file kgamedialogconfig.cpp.


Member Function Documentation

bool KGameDialogConfig::admin  )  const
 

Returns:
True if the owner is ADMIN otherwise FALSE. See also setAdmin

Definition at line 88 of file kgamedialogconfig.cpp.

References KGameDialogConfigPrivate::mAdmin.

Referenced by KGameDialogConnectionConfig::setAdmin(), KGameDialogMsgServerConfig::setAdmin(), KGameDialogMsgServerConfig::slotChangeAdmin(), and KGameDialogConnectionConfig::slotKickPlayerOut().

KGame * KGameDialogConfig::game  )  const
 

A pointer to the KGame object that has been set by setKGame.

Note that NULL is allowed!

Returns:
The KGame object assigned to this dialog

Definition at line 86 of file kgamedialogconfig.cpp.

References KGameDialogConfigPrivate::mGame.

Referenced by KGameDialogConnectionConfig::setAdmin(), KGameDialogConnectionConfig::setKGame(), KGameDialogChatConfig::setKGame(), KGameDialogMsgServerConfig::setKGame(), KGameDialogNetworkConfig::setKGame(), KGameDialogMsgServerConfig::slotChangeAdmin(), KGameDialogMsgServerConfig::slotChangeMaxClients(), KGameDialogNetworkConfig::slotExitConnection(), KGameDialogNetworkConfig::slotInitConnection(), and KGameDialogConnectionConfig::slotKickPlayerOut().

KPlayer * KGameDialogConfig::owner  )  const
 

A pointer to the KPlayer object that has been set by setOwner.

Note that NULL is allowed!

Returns:
The owner of the dialog

Definition at line 90 of file kgamedialogconfig.cpp.

References KGameDialogConfigPrivate::mOwner.

Referenced by KGameDialogChatConfig::setOwner(), KGameDialogGeneralConfig::setOwner(), KGameDialogConnectionConfig::slotKickPlayerOut(), and KGameDialogGeneralConfig::slotPropertyChanged().

void KGameDialogConfig::setAdmin bool  admin  )  [virtual]
 

The admin status has been changed.

If the KGame object of this config widget is the admin the user is allowed to configure it. Otherwise most widgets will have to be disabled. Note that you don't necessarily need to deactivate all widget - e.g. the player name must be configured by the player. Mainly the KGame configuration can be done by the admin only.

By default this does nothing. Changes the value for admin so don't forget to call the default implementation in derived classes!

Parameters:
admin Whether the KGame object of this dialog can be configured

Reimplemented in KGameDialogGeneralConfig, KGameDialogMsgServerConfig, and KGameDialogConnectionConfig.

Definition at line 81 of file kgamedialogconfig.cpp.

References KGameDialogConfigPrivate::mAdmin.

Referenced by KGameDialog::addConfigWidget(), KGameDialogConnectionConfig::setAdmin(), KGameDialogMsgServerConfig::setAdmin(), and KGameDialogGeneralConfig::setAdmin().

void KGameDialogConfig::setKGame KGame g  )  [virtual]
 

The KGame object of the dialog has been changed.

The default implementation changes the pointer for game so don't forget to call the default implementation if you overwrite this!

You can use this e.g. to re-read the min/max player settings.

Parameters:
g The KGame object

Reimplemented in KGameDialogGeneralConfig, KGameDialogNetworkConfig, KGameDialogMsgServerConfig, KGameDialogChatConfig, and KGameDialogConnectionConfig.

Definition at line 71 of file kgamedialogconfig.cpp.

References KGameDialogConfigPrivate::mGame.

Referenced by KGameDialog::addConfigWidget(), KGameDialogConnectionConfig::setKGame(), KGameDialogChatConfig::setKGame(), KGameDialogMsgServerConfig::setKGame(), KGameDialogGeneralConfig::setKGame(), and KGameDialogNetworkConfig::setKGame().

void KGameDialogConfig::setOwner KPlayer p  )  [virtual]
 

The owner player of the dialog has been changed.

The default changes the pointer for owner so don't forget to call the default implementation if you overwrite this!

You can use this e.g. to change a line edit widget containing the player name.

Note: even NULL players are allowed!

Parameters:
p The new owner player of the dialog

Reimplemented in KGameDialogGeneralConfig, KGameDialogChatConfig, and KGameDialogConnectionConfig.

Definition at line 76 of file kgamedialogconfig.cpp.

References KGameDialogConfigPrivate::mOwner.

Referenced by KGameDialog::addConfigWidget(), KGameDialogConnectionConfig::setOwner(), KGameDialogChatConfig::setOwner(), and KGameDialogGeneralConfig::setOwner().

virtual void KGameDialogConfig::submitToKGame KGame g,
KPlayer p
[pure virtual]
 

Called by KGameDialog to submit all settings to the KGame Object.

You have to replace this if you add your own widgets!

Parameters:
g A pointer to your KGame.
p A pointer to the player owning this dialog

Implemented in KGameDialogGeneralConfig, KGameDialogNetworkConfig, KGameDialogMsgServerConfig, KGameDialogChatConfig, and KGameDialogConnectionConfig.


The documentation for this class was generated from the following files:
Generated on Wed Aug 23 18:05:14 2006 for libkdegames by  doxygen 1.4.6