Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MSN::SwitchboardServerConnection Class Reference

#include <switchboardserver.h>

Inheritance diagram for MSN::SwitchboardServerConnection:

MSN::Connection List of all members.

Detailed Description

Represents a connection to a MSN switchboard.


Public Types

enum  SwitchboardServerState {
  SB_DISCONNECTED, SB_CONNECTING, SB_CONNECTED, SB_WAITING_FOR_USERS,
  SB_READY
}

Public Member Functions

 SwitchboardServerConnection (AuthData &auth_, NotificationServerConnection &)
virtual ~SwitchboardServerConnection ()
virtual void dispatchCommand (std::vector< std::string > &args)
 Dispatch a command to its appropriate handler routines based on args.
ConnectionconnectionWithSocket (int fd)
 Return a connection that is associated with fd.
std::list< FileTransferConnection * > & fileTransferConnections () const
 Return a list of all FileTransferConnection's associated with this connection.
void addFileTransferConnection (FileTransferConnection *)
 Add a FileTransferConnection to the list of associated connections.
void removeFileTransferConnection (FileTransferConnection *)
 Remove a FileTransferConnection from the list of associated connections.
void removeFileTransferConnection (FileTransferInvitation *inv)
 Remove the FileTransferConnection that is associated with FileTransferInvitation inv from the list of associated connections.
void sendTypingNotification ()
 Send a typing notification to the switchboard server.
void inviteUser (Passport userName)
 Invite userName into this conversation.
virtual void connect (const std::string &hostname, unsigned int port)
 Connect ourself to hostname on port.
virtual void disconnect ()
virtual void sendMessage (const Message *msg)
virtual void sendMessage (const std::string &s)
FileTransferInvitationsendFile (const std::string path)
virtual void addCallback (SwitchboardServerCallback, int trid, void *data)
 Add cb as a callback that will be called when a response is received a transaction ID of trid.
virtual void removeCallback (int trid)
 Remove callbacks for transaction ID trid.
InvitationinvitationWithCookie (const std::string &cookie)
virtual void socketConnectionCompleted ()
 The connection has been established.
SwitchboardServerState connectionState () const
virtual NotificationServerConnectionmyNotificationServer ()

Public Attributes

SwitchboardServerConnection::AuthData auth
std::list< Passportusers
 A list of the users in this switchboard session.
std::list< Invitation * > invitationsSent
 Invitations extended but not responded to.
std::list< Invitation * > invitationsReceived
 Invitations received but not responded to.

Protected Member Functions

virtual void handleIncomingData ()
void setConnectionState (SwitchboardServerState s)
void assertConnectionStateIs (SwitchboardServerState s)
void assertConnectionStateIsNot (SwitchboardServerState s)
void assertConnectionStateIsAtLeast (SwitchboardServerState s)

Protected Attributes

SwitchboardServerState _connectionState

Friends

class FileTransferConnection
class FileTransferInvitation
class Connection

Classes

class  AuthData


Member Enumeration Documentation

enum MSN::SwitchboardServerConnection::SwitchboardServerState
 

Enumeration values:
SB_DISCONNECTED 
SB_CONNECTING 
SB_CONNECTED 
SB_WAITING_FOR_USERS 
SB_READY 


Constructor & Destructor Documentation

MSN::SwitchboardServerConnection::SwitchboardServerConnection AuthData auth_,
NotificationServerConnection
 

MSN::SwitchboardServerConnection::~SwitchboardServerConnection  )  [virtual]
 


Member Function Documentation

void MSN::SwitchboardServerConnection::addCallback SwitchboardServerCallback  ,
int  trid,
void *  data
[virtual]
 

Add cb as a callback that will be called when a response is received a transaction ID of trid.

void MSN::SwitchboardServerConnection::addFileTransferConnection FileTransferConnection  ) 
 

Add a FileTransferConnection to the list of associated connections.

void MSN::SwitchboardServerConnection::assertConnectionStateIs SwitchboardServerState  s  )  [inline, protected]
 

void MSN::SwitchboardServerConnection::assertConnectionStateIsAtLeast SwitchboardServerState  s  )  [inline, protected]
 

void MSN::SwitchboardServerConnection::assertConnectionStateIsNot SwitchboardServerState  s  )  [inline, protected]
 

void MSN::SwitchboardServerConnection::connect const std::string &  hostname,
unsigned int  port
[virtual]
 

Connect ourself to hostname on port.

Implements MSN::Connection.

SwitchboardServerState MSN::SwitchboardServerConnection::connectionState  )  const [inline]
 

Connection * MSN::SwitchboardServerConnection::connectionWithSocket int  fd  ) 
 

Return a connection that is associated with fd.

If fd is equal to sock, this is returned. Otherwise connectionWithSocket is sent to each FileTransferConnection until a match is found.

Returns:
The matching connection, if found. Otherwise, NULL.

void MSN::SwitchboardServerConnection::disconnect  )  [virtual]
 

Implements MSN::Connection.

void MSN::SwitchboardServerConnection::dispatchCommand std::vector< std::string > &  args  )  [virtual]
 

Dispatch a command to its appropriate handler routines based on args.

Parameters:
args A vector of strings containing arguments, returned from readLine.

Implements MSN::Connection.

std::list<FileTransferConnection *>& MSN::SwitchboardServerConnection::fileTransferConnections  )  const
 

Return a list of all FileTransferConnection's associated with this connection.

void MSN::SwitchboardServerConnection::handleIncomingData  )  [protected, virtual]
 

Implements MSN::Connection.

Invitation * MSN::SwitchboardServerConnection::invitationWithCookie const std::string &  cookie  ) 
 

void MSN::SwitchboardServerConnection::inviteUser Passport  userName  ) 
 

Invite userName into this conversation.

virtual NotificationServerConnection* MSN::SwitchboardServerConnection::myNotificationServer  )  [inline, virtual]
 

Implements MSN::Connection.

void MSN::SwitchboardServerConnection::removeCallback int  trid  )  [virtual]
 

Remove callbacks for transaction ID trid.

void MSN::SwitchboardServerConnection::removeFileTransferConnection FileTransferInvitation inv  ) 
 

Remove the FileTransferConnection that is associated with FileTransferInvitation inv from the list of associated connections.

void MSN::SwitchboardServerConnection::removeFileTransferConnection FileTransferConnection  ) 
 

Remove a FileTransferConnection from the list of associated connections.

FileTransferInvitation * MSN::SwitchboardServerConnection::sendFile const std::string  path  ) 
 

void MSN::SwitchboardServerConnection::sendMessage const std::string &  s  )  [virtual]
 

void MSN::SwitchboardServerConnection::sendMessage const Message msg  )  [virtual]
 

void MSN::SwitchboardServerConnection::sendTypingNotification  ) 
 

Send a typing notification to the switchboard server.

void MSN::SwitchboardServerConnection::setConnectionState SwitchboardServerState  s  )  [inline, protected]
 

void MSN::SwitchboardServerConnection::socketConnectionCompleted  )  [virtual]
 

The connection has been established.

Reimplemented from MSN::Connection.


Friends And Related Function Documentation

friend class Connection [friend]
 

friend class FileTransferConnection [friend]
 

friend class FileTransferInvitation [friend]
 


Member Data Documentation

SwitchboardServerState MSN::SwitchboardServerConnection::_connectionState [protected]
 

SwitchboardServerConnection::AuthData MSN::SwitchboardServerConnection::auth
 

std::list<Invitation *> MSN::SwitchboardServerConnection::invitationsReceived
 

Invitations received but not responded to.

std::list<Invitation *> MSN::SwitchboardServerConnection::invitationsSent
 

Invitations extended but not responded to.

std::list<Passport> MSN::SwitchboardServerConnection::users
 

A list of the users in this switchboard session.


The documentation for this class was generated from the following files:
Generated on Sun Feb 6 19:59:41 2005 for libmsn by  doxygen 1.4.1