XGP::ConnectDlg Class Reference

Dialog to handle enable either waiting for clients to connect or to connect to a server. More...

Inherits XGP::XDialog.

List of all members.

Public Member Functions

virtual ~ConnectDlg ()

Static Public Member Functions

static void perform (unsigned int cMaxConnections, unsigned int defPort, YGP::ConnectionMgr &connMgr)
static void perform (unsigned int cMaxConnections, const Glib::ustring &defPort, YGP::ConnectionMgr &connMgr)

Protected Types

enum  { WAIT, CONNECT }

Protected Member Functions

void command (int action)
void cancelEvent ()
void okEvent ()
void valueChanged () const
 ConnectDlg (unsigned int cMaxConnections, const Glib::ustring &defPort, YGP::ConnectionMgr &connMgr)
void * waitForConnections (void *socket) throw (YGP::CommError)
virtual YGP::Socket * addClient (int socket)
virtual void connect (const Glib::ustring &target, unsigned int port) throw (YGP::CommError)

Protected Attributes

Gtk::Entry * pTarget
Gtk::Entry * pPort
Gtk::Button * pWait
Gtk::Button * pConnect
Gtk::Table * pClient
YGP::ConnectionMgr & cmgr


Detailed Description

Dialog to handle enable either waiting for clients to connect or to connect to a server.

The result of this actions is returned in the ConnectionMgr object.


Constructor & Destructor Documentation

XGP::ConnectDlg::~ConnectDlg (  )  [virtual]

Destructor.

XGP::ConnectDlg::ConnectDlg ( unsigned int  cMaxConnections,
const Glib::ustring &  defPort,
YGP::ConnectionMgr &  connMgr 
) [protected]

Default constructor.

Parameters:
cMaxConnections Maximal number of connections the dialog (in server mode) will wait for.
defPort Default port to listen at/send to
connMgr Connection manager; holding the connections to use


Member Function Documentation

YGP::Socket * XGP::ConnectDlg::addClient ( int  socket  )  [protected, virtual]

Adds a connected client to the vector holding the connections.

Parameters:
socket Socket over which the client communicates
Returns:
Socket* Pointer to created socket (or NULL)

void XGP::ConnectDlg::cancelEvent (  )  [protected, virtual]

Callback if the CANCEL button has been pressed.

Reimplemented from XGP::XDialog.

void XGP::ConnectDlg::command ( int  action  )  [protected, virtual]

Command handler of the dialog.

Parameters:
action Selected command (button)

Reimplemented from XGP::XDialog.

void XGP::ConnectDlg::connect ( const Glib::ustring &  target,
unsigned int  port 
) throw (YGP::CommError) [protected, virtual]

Connects the client with the passed target.

Parameters:
target Name or IP address of target
port Port the target is listening at
Exceptions:
YGP::CommError In case of an connection error

void XGP::ConnectDlg::okEvent (  )  [protected, virtual]

Callback if the OK button has been pressed.

Reimplemented from XGP::XDialog.

void XGP::ConnectDlg::perform ( unsigned int  cMaxConnections,
const Glib::ustring &  defPort,
YGP::ConnectionMgr &  connMgr 
) [static]

Performs the dialog (modal).

Parameters:
cMaxConnections Maximal number of connections the dialog (in server mode) will wait for.
defPort Default port to listen at/send to
connMgr Connection manager; holding the connections to use
Returns:
ConnectDlg::modeConnect Mode of the connection
Remarks:
This method cares about freeing the dialog afterwards

void XGP::ConnectDlg::perform ( unsigned int  cMaxConnections,
unsigned int  defPort,
YGP::ConnectionMgr &  connMgr 
) [static]

Performs the dialog (modal).

Parameters:
cMaxConnections Maximal number of connections the dialog (in server mode) will wait for.
defPort Default port to listen at/send to
connMgr Connection manager; holding the connections to use
Returns:
ConnectDlg::modeConnect Mode of the connection
Remarks:
This method cares about freeing the dialog afterwards

void XGP::ConnectDlg::valueChanged (  )  const [protected]

Callback if the CANCEL buttons has been pressed.

void * XGP::ConnectDlg::waitForConnections ( void *  pVoid  )  throw (YGP::CommError) [protected]

Waits for connections.

Exceptions:
YGP::CommError In case of an connection error


Member Data Documentation

YGP::ConnectionMgr& XGP::ConnectDlg::cmgr [protected]

Class holding the connections.

Gtk::Table* XGP::ConnectDlg::pClient [protected]

Table holding the controls of the dialog.

Gtk::Button* XGP::ConnectDlg::pConnect [protected]

Button to connect to a server (client mode).

Gtk::Entry* XGP::ConnectDlg::pPort [protected]

Entry field for the port of the connection.

Gtk::Entry* XGP::ConnectDlg::pTarget [protected]

Entry field holding the target computer (IP address or name).

Gtk::Button* XGP::ConnectDlg::pWait [protected]

Button to wait for connections (server mode).


The documentation for this class was generated from the following files:

XGP Version 0.9.31 - Generated on Wed Nov 18 11:25:29 2009 by doxygen 1.5.8