libmsn: MSN::SwitchboardServerConnection Class Reference

# MSN::SwitchboardServerConnection Class Reference

`#include <switchboardserver.h>`

Inheritance diagram for MSN::SwitchboardServerConnection:
[legend]
Collaboration diagram for MSN::SwitchboardServerConnection:
[legend]

List of all members.

## Public Member Functions
virtual void | dispatchCommand (std::vector< std::string > &args)
Connection * | connectionWithSocket (void *sock)
void | addFileTransferConnectionP2P (FileTransferConnectionP2P *)
void | removeFileTransferConnectionP2P (FileTransferConnectionP2P *)
void | sendTypingNotification ()
void | sendAction (std::string action)
void | sendVoiceClip (std::string msnobject)
void | sendWink (std::string msnobject)
void | sendInk (std::string image)
void | sendEmoticon (std::string alias, std::string file)
void | sendNudge ()
void | sendKeepAlive ()
void | sendFile (MSN::fileTransferInvite ft)
void | inviteUser (Passport userName)
void | fileTransferResponse (unsigned int sessionID, std::string filename, bool response)
void | cancelFileTransfer (unsigned int sessionID)
virtual void | connect (const std::string &hostname, unsigned int port)
virtual int | sendMessage (const Message *msg)
virtual int | sendMessage (const std::string &s)
virtual void | addCallback (SwitchboardServerCallback, int trid, void *data)
virtual void | removeCallback (int trid)
virtual void | socketConnectionCompleted ()
void | requestEmoticon (unsigned int id, std::string filename, std::string msnobject, std::string alias)
void | requestVoiceClip (unsigned int id, std::string filename, std::string msnobject)
void | requestWink (unsigned int id, std::string filename, std::string msnobject)
void | requestDisplayPicture (unsigned int id, std::string filename, std::string msnobject)
## Public Attributes
std::list< Passport > | users

## Detailed Description

Represents a connection to a MSN switchboard.

## Member Function Documentation

void MSN::SwitchboardServerConnection::addCallback | ( | SwitchboardServerCallback | callback,
|  | 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::addFileTransferConnectionP2P | ( | FileTransferConnectionP2P * | c | ) |

Add a FileTransferConnection to the list of associated connections.

void MSN::SwitchboardServerConnection::cancelFileTransfer | ( | unsigned int | sessionID | ) |

Cancel a file transfer in progress

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

Connect ourself to hostname on port.

Implements MSN::Connection.

Connection * MSN::SwitchboardServerConnection::connectionWithSocket | ( | void * | sock | ) |

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::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.

void MSN::SwitchboardServerConnection::fileTransferResponse | ( | unsigned int | sessionID,
|  | std::string | filename,
|  | bool | response |
| ) |  |  |

Response to a file transfer invitation

void MSN::SwitchboardServerConnection::inviteUser | ( | Passport | userName | ) |

Invite userName into this conversation.

void MSN::SwitchboardServerConnection::removeCallback | ( | int | trid | ) | `[virtual]`

Remove callbacks for transaction ID trid.

void MSN::SwitchboardServerConnection::removeFileTransferConnectionP2P | ( | FileTransferConnectionP2P * | c | ) |

Remove a FileTransferConnection from the list of associated connections.

void MSN::SwitchboardServerConnection::requestDisplayPicture | ( | unsigned int | id,
|  | std::string | filename,
|  | std::string | msnobject |
| ) |  |  |

Request a display picture

void MSN::SwitchboardServerConnection::requestEmoticon | ( | unsigned int | id,
|  | std::string | filename,
|  | std::string | msnobject,
|  | std::string | alias |
| ) |  |  |

Request an emoticon

void MSN::SwitchboardServerConnection::requestVoiceClip | ( | unsigned int | id,
|  | std::string | filename,
|  | std::string | msnobject |
| ) |  |  |

Request a voice clip

void MSN::SwitchboardServerConnection::requestWink | ( | unsigned int | id,
|  | std::string | filename,
|  | std::string | msnobject |
| ) |  |  |

Request a wink

void MSN::SwitchboardServerConnection::sendAction | ( | std::string | action | ) |

Send a text action

void MSN::SwitchboardServerConnection::sendEmoticon | ( | std::string | alias,
|  | std::string | file |
| ) |  |  |

Send an emoticon

void MSN::SwitchboardServerConnection::sendFile | ( | MSN::fileTransferInvite | ft | ) |

Send a file

void MSN::SwitchboardServerConnection::sendInk | ( | std::string | image | ) |

Send Ink

void MSN::SwitchboardServerConnection::sendKeepAlive | ( |  | ) |

Send a keep alive message

int MSN::SwitchboardServerConnection::sendMessage | ( | const std::string & | s | ) | `[virtual]`

Send plain text message, returns the trID

int MSN::SwitchboardServerConnection::sendMessage | ( | const Message * | msg | ) | `[virtual]`

Send formatted message, returns the trID

void MSN::SwitchboardServerConnection::sendNudge | ( |  | ) |

Send a nudge

void MSN::SwitchboardServerConnection::sendTypingNotification | ( |  | ) |

Send a typing notification to the switchboard server.

void MSN::SwitchboardServerConnection::sendVoiceClip | ( | std::string | msnobject | ) |

Send a Voice Clip

void MSN::SwitchboardServerConnection::sendWink | ( | std::string | msnobject | ) |

Send a Wink

void MSN::SwitchboardServerConnection::socketConnectionCompleted | ( |  | ) | `[virtual]`

The connection has been established.

Reimplemented from MSN::Connection.

## Member Data Documentation

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

A list of the users in this switchboard session.