Source Code (Use browser search to find items of interest.)

Class Index

ksirtet'LocalBoard (./kdegames/ksirtet/lib/multi.h:15)

class LocalBoard : public QWidget
{
 Q_OBJECT
		
 public:
    LocalBoard(QWidget *parent, const char *name=0)
	: QWidget(parent, name) {}
	virtual ~LocalBoard() {}

	/**
	 * This method is called once at the board creation.
	 * @param AI is TRUE if the player is not human.
	 * @param multiplayers is TRUE if the game is not a single player game.
	 */
	virtual void init(bool AI, bool multiplayers, bool server) = 0;
	
	/**
	 * Put data on the stream.
	 *
	 * This method is the communication way out. The data given here will
	 * be the only information that will go to the server.
	 */
	virtual void dataOut(QDataStream &) = 0;
	
	/**
	 * Get data from the stream.
	 *
	 * This method is the communication way in. The data given here will be
	 * the only information that you will receive from the server.
	 */
	virtual void dataIn(QDataStream &) = 0;

 signals:
	/**
	 * Call this signal to enable/disable the keys associated with a board.
	 */
	void activateKeys(bool);
};

/**
 * The OptionWidget is a base widget for the option widget in the
 * "netmeeting" dialog. This option widget is optional (!).
 *
 * For example you will have :	
 * <PRE>
 *  class MyOptionWidget : public OptionWidget { ... };
 *  class MyMultiPlayerInterface : public MultiPlayerInterface { ... };
 *
 *  OptionWidget *MyMultiPlayerInterface::newOptionWidget(bool server) const
 *  { return new MyOptionWidget(server); };
 * </PRE>
 *
 * The option widget must have two different behaviours for server and
 * clients. The server is able to change the options but the clients are only
 * able to see them. The library will catch the @ref #changed signal from
 * the option widget and will send the changes to the clients. It uses the
 * @ref #dataOut to obtain the data from the
 * server option dialog and then on the client side, it sets the new data with
 * the method @ref #dataIn.
 * You must implement this three methods to have useful option widgets and be
 * careful to emit the signal @ref #changed whenever the server widget is
 * changed. In addition you'll need to implement the method @ref #saveData
 * to save the configuration in the config file ; so that it will be available
 * for the initialisation of @ref LocalBoard.
 * It seems a good idea that the widget have the same layout
 * on both (server and client) sides but with the inner widgets all disabled
 * on the client side.
 */