#include <manager.h>
Collaboration diagram for GNUMessenger::ProtocolManager:
Public Member Functions | |
ProtocolManager (XMLManager &auth) | |
Creates a ProtocolManager with a reference to a ContactManager. | |
virtual | ~ProtocolManager () |
The Protocol Manager destructor will delete all of the protocols associated with the manager. | |
bool | removeProtocol (const string &proto) |
May throw InvalidNetwork. | |
bool | loadProtocol (const string &name) |
Loads a protocol from its settings in the XML Manager if they exists. | |
void | shutdown () |
Shutdown and delete all protocols and nets. | |
int | getState (const string &proto) |
May throw InvalidNetwork. | |
string | screenName (const string &proto) |
Returns the login (screen-name) used for a protocol. | |
bool | update (const string &proto) |
Call these in a non-event based system. | |
void | updateAll () |
Calls update() on all protocols. | |
bool | hasProtocol (const string &name) |
Is this protocol configured? | |
bool | changeSettings (const string &proto, XMLNode &conf) |
Send new settings to a specified protocol may throw InvalidNetwork. | |
bool | isGM (const Contact &c) |
returns wether or not the session for that contact is a GM session and would support cryptography | |
void | forceKeyX (const Contact &c) |
if the session is encrypted, will initiate a new Key Exchange, never throws | |
void | changeCipher (const Contact &c, int cipherType, int keysize=-1, int blocksize=-1) |
if the session is encrypted, will change the local cipher type, never throws keysize and blocksize are in bytes | |
Contact | getContact (const string &name) |
returns the contact, best copy for program use because has active sessions will throw if contact is invalid | |
list< Network * > | getNets (const string &proto) |
Returns all Network* associated with a given protocol. | |
list< Network * > | getNetsAll () |
Returns all Network*s currently configured. | |
bool | login (const string &proto) |
Tells a specified protocol to try and connect with the server. | |
bool | logout (const string &proto) |
Tells a specified protocol to logout. | |
bool | setAway (const string &proto, const string &msg) |
Sets the away message for the protocol. | |
void | setAllAway (const string &msg) |
Sets the away message for all active protocols. | |
bool | setInfo (const string &proto, const string &info) |
Set the information/profile for a protocol. | |
void | setAllInfo (const string &info) |
Set the information/profile for all protocols active. | |
void | getInfo (const Contact &contact) |
Get info about a particular user--async call. | |
bool | sendMessage (const string &proto, const Contact &recipient, const string &message) |
Tries to send a message on a given protocol. | |
bool | sendMessage (const string &proto, const Contact &recipient, const VBuffer &data) |
Tries to send a message on a given protocol. | |
bool | sendMessage (const Contact &c, const string &message) |
Tries to send a message via any available route. | |
bool | sendMessage (const Contact &c, const VBuffer &data) |
Tries to send a message via any available route. | |
void | addContact (const Contact &c) |
Add a contact to the protocols contact list or updates the contact if they exists already. | |
bool | delContact (const string &proto, const Contact &c) |
Removes a contact from a protocol's list of contacts. | |
vector< string > | protocols () const |
Returns a vector of configured protocol names. | |
unsigned long | getSentBytes (const string &proto) const |
Return the number of bytes sent, recv-ed, packets, etc. | |
unsigned long | getSentPackets (const string &proto) const |
unsigned long | getRecvBytes (const string &proto) const |
unsigned long | getRecvPackets (const string &proto) const |
vector< string > | getRemoteIPs (const string &proto) const |
Protected Member Functions | |
void | protoLoggedIn (const string &proto) |
Status changes -- I moved these from the callbacks area because the State change function basically calls theses if done right (i think). | |
void | protoLoggedOut (const string &proto) |
Protocol * | protocol (const string &proto) |
Retrieves the Protocol pointer of a given protocol. | |
const Protocol * | protocol (const string &proto) const |
virtual Network * | createNet (Protocol *protocol)=0 |
This should create a new system dependant Network pointer and return it. | |
virtual NetworkServer * | createServer (Protocol *protocol)=0 |
virtual void | removeNet (Network *n) |
Removes a socket from event handling AND deletes it. | |
bool | addProtocol (Protocol *proto) |
Add a new protocol. | |
bool | isOnline (const string &proto) const |
void | sendEncryptedMessage (const string &proto, const Contact &c, const string &mess) |
void | sendEncryptedMessage (const string &proto, const Contact &c, const VBuffer &data) |
void | receiveEncryptedMessage (const string &proto, const Contact &c, const string &mess) |
void | receiveEncryptedMessage (const string &proto, const Contact &c, const VBuffer &data) |
virtual void | c_loggedIn (const string &proto) |
Call-backs (to client). | |
virtual void | c_loggedOut (const string &proto) |
virtual void | c_recvdMessage (const string &proto, const Contact &c, const string &message)=0 |
virtual void | c_recvdMessageAnony (const string &protocol, const Contact &c, const string &message)=0 |
virtual void | c_statusChange (const string &proto, const Contact &c) |
virtual void | c_error (const string &proto, int err_no, const string &error) |
virtual void | c_stateChange (const string &proto, Protocol::State st) |
virtual void | c_gotPubkey (const Contact &c, const string &key) |
virtual void | c_gotBuddy (const string &proto, const Contact &c) |
virtual void | c_gotContacts (const string &proto, const vector< buddy > &c) |
virtual void | c_custom (const string &proto, const XMLNode &n) |
virtual void | c_gotInfo (const Contact &c, const string &info, const string &proto) |
Protected Attributes | |
XMLManager & | m_auth |
It controls all of the Protocols and there associated Network sockets and interfaces with the client via callbacks. It is an abstract base class which requires a client implementation to derive certain functionality.
Jesse Lovelace
Definition at line 49 of file manager.h.
|
The Protocol Manager destructor will delete all of the protocols associated with the manager. The protocol's destructor will use removeNet to try and destroy the Network objects (read Sockets) in a well-defined way. Definition at line 36 of file manager.cpp. References shutdown().
Here is the call graph for this function: |
|
Add a new protocol.
References GNUMessenger::XMLManager::contacts(), GNUMessenger::ContactManager::getContactsOfProtocol(), and GNUMessenger::Protocol::getProtocol(). Referenced by GNUMessenger::Protocol::Protocol().
Here is the call graph for this function: |
|
This should create a new system dependant Network pointer and return it. It's called when a protocol needs a new socket. Also should add the Network to any event monitoring the Socket supports. |
|
Loads a protocol from its settings in the XML Manager if they exists. Returns false if the protocol could not be loaded.
References GNUMessenger::SettingsManager::getNet(), and GNUMessenger::XMLManager::settings().
Here is the call graph for this function: |
|
Tells a specified protocol to try and connect with the server.
|
|
Tells a specified protocol to logout.
Referenced by removeProtocol().
|
|
Retrieves the Protocol pointer of a given protocol.
Referenced by getSentBytes(), and removeProtocol().
|
|
Returns a vector of configured protocol names.
|
|
Returns the login (screen-name) used for a protocol.
|
|
Tries to send a message via any available route.
References GNUMessenger::Contact::getProtocol(), and sendMessage().
Here is the call graph for this function: |
|
Tries to send a message via any available route.
References GNUMessenger::Contact::getProtocol(), and sendMessage().
Here is the call graph for this function: |
|
Tries to send a message on a given protocol.
|
|
Tries to send a message on a given protocol.
Referenced by sendMessage().
|
|
Sets the away message for all active protocols.
|
|
Set the information/profile for all protocols active.
|
|
Sets the away message for the protocol.
|
|
Set the information/profile for a protocol.
|
|
Call these in a non-event based system.
|
|
Calls update() on all protocols. Call in non-event based system. Definition at line 213 of file manager.cpp.
|