ConnectionProcess Class Reference

It handles the connection process. More...

#include <connectionprocess.h>

List of all members.

Public Types

enum  State {
  Idle, WaitForConnection, SocketConnected, WaitForAuthentification,
  Authentified, WaitForList, Connected, ConnectionFailed
}
 Enumeration of possible state for the connection process. More...

Public Slots

void performConnection ()
 This method performs the connection process.

Public Member Functions

 ConnectionProcess (ConnectionManager &rConnection, const std::string &hostname, const int port, const std::string &username, const std::string &password)
 Constructor.
 ~ConnectionProcess ()
 Destructor.
void setConnectStatus (const bool bStatus)
 Changes the socket connection status.
State getConnectionStatus () const
 Returns the connection status.
void setAuthentificationStatus (const bool bStatus, const Contact &contact)
 Changes the authentification status.
void setContactListStatus (const bool bStatus, const ContactList &list)
 Changes the connection status.
void abortConnection ()
 Aborts the connection.
void close ()
 Close the connection widget.


Detailed Description

It handles the connection process.

Todo:
Timeout implementation.
Author:
Sylvain Archenault <sylvain.archenault@laposte.net>

Yves Houpert <yves.houpert@insa-rouen.fr>


Member Enumeration Documentation

enum ConnectionProcess::State
 

Enumeration of possible state for the connection process.

Enumerator:
WaitForConnection  Connection process not started.
SocketConnected  Waiting for the socket to be connected to the host.
WaitForAuthentification  Socket is connected. We have to authentify.
Authentified  Waiting for authentification.
WaitForList  We are authentified. We have to request the contact list.
Connected  Waiting for the list.
ConnectionFailed  Connection has failed.


Constructor & Destructor Documentation

ConnectionProcess::ConnectionProcess ConnectionManager rConnection,
const std::string &  hostname,
const int  port,
const std::string &  username,
const std::string &  password
 

Constructor.

Parameters:
rConnection Connection Manager that manages the connection.
hostname Host name where the server is hosted.
port Port to use for the connection to the server.
username Username to use for authentification.
password Password to use for authentification.


Member Function Documentation

void ConnectionProcess::abortConnection  ) 
 

Aborts the connection.

It closes the widget and stop the connetion process.

State ConnectionProcess::getConnectionStatus  )  const [inline]
 

Returns the connection status.

Returns:
Connection status.

void ConnectionProcess::performConnection  )  [slot]
 

This method performs the connection process.

It's called by the ConnectionManager each time its timer times out. See ConnectionManager for more details.

void ConnectionProcess::setAuthentificationStatus const bool  bStatus,
const Contact contact
 

Changes the authentification status.

This method is called when the authentification process ended.

Parameters:
bStatus Result of authentification.
contact A valid contact object is the authentification succeed.

void ConnectionProcess::setConnectStatus const bool  bStatus  ) 
 

Changes the socket connection status.

This method is called when the socket send a message about the connection.

Parameters:
bStatus Socket status, true for connected, false for disconnected.

void ConnectionProcess::setContactListStatus const bool  bStatus,
const ContactList list
 

Changes the connection status.

This method is called when the user's contact list is received.

Parameters:
bStatus Result of the contact list request.
list A valid contact list object if the contact list request succeed.


The documentation for this class was generated from the following files:
Generated on Fri May 19 12:15:55 2006 for Bamboo Ch@t by  doxygen 1.4.6