#include <protocol.h>
Inheritance diagram for GNUMessenger::Protocol:


Public Types | |
| enum | Errors { E_invalidLogin, E_userTaken, E_protocol, E_network, E_success } |
| enum | State { S_offline = 0, S_invalid, S_online, S_connecting, S_disconnecting } |
| enum | Status { S_available, S_away, S_na, S_occupied, S_dnd, S_ffc, S_off } |
Public Member Functions | |
| Protocol (const XMLNode &xml, ProtocolManager *manager, const string &name) | |
| Protocol constructor, associates a protocol with a XML configuration, a ProtocolManager, and a name. | |
| virtual | ~Protocol () |
| The Protocol destructor will attempt to destroy all of the associated Network objects in an implementation dependant way by using the function ProtocolManager::removeNet if (for some TERRIBLE reason) the manager pointer is null, the destructor will simply call delete on the pointers. | |
| virtual void | changeSettings (XMLNode &conf) |
| Updates the protocol configuration and calls reset(). | |
| virtual void | reset ()=0 |
| Resets the protocol by disconnecting and reconnecting to the network. | |
| virtual State | getState () const |
| Returns the state of the network connection. | |
| virtual Status | getStatus () const |
| Returns the user-defined statues of the protocol. | |
| virtual const string & | getProtocol () |
| Returns the text string name of the protocol. | |
| virtual const string | getLoginName ()=0 |
| Returns the text string name used to login to the protocol. | |
| virtual void | update () |
| In a non-event based system this call will check the network for incoming data and will call appropriate handlers. | |
| virtual void | login ()=0 |
| Initiates the login sequence for this protocol. | |
| virtual void | logout ()=0 |
| Sends the protocol the log-out request and disconnects the socket (Network). | |
| virtual void | shutdown ()=0 |
| virtual bool | sendMessage (const Contact &recipient, const string &message)=0 |
| Tries to send a message to a Contact via this protocol. | |
| virtual bool | sendMessage (const Contact &recipient, const VBuffer &data) |
| Tries to send a data message to a Contact. | |
| virtual void | addContact (const Contact &contact)=0 |
| virtual void | delContact (const Contact &contact)=0 |
| virtual void | newUser (const string &userName, const VBuffer &password)=0 |
| virtual void | setAway (const string &msg="") |
| virtual void | setInfo (const string &info="") |
| virtual void | handleData (Network *net)=0 |
| virtual void | handleData (Network *net, const string &data)=0 |
| virtual void | handleData (Network *net, const VBuffer &data) |
| virtual void | connectionError (Network *net, int error)=0 |
| virtual void | connectedToServer (Network *net) |
| virtual void | clearBuddies () |
| I don't know what you'd want to do this. | |
| void | setConfig (XMLNode conf) |
| Set the configureation settings from this network, you'll need to reset to make any account/server settings activate. | |
| virtual list< Network * > | getNetworks () |
| Get the list of all sockets used by this protocol. | |
| unsigned long | getSentBytes () const |
| Return the number of bytes sent, recv-ed, packets, etc. | |
| unsigned long | getSentPackets () const |
| unsigned long | getRecvBytes () const |
| unsigned long | getRecvPackets () const |
| vector< string > | getRemoteIPs () const |
| Try to get list of remote IPs/Hosts from the sockets that this protocol uses. | |
| virtual void | setContacts (vector< Contact > &cnts) |
| Used at statup, sets all contacts from a vector of Contact that was, most likely, obtained from the XMLManager. | |
| virtual void | getInfo (const string &contact)=0 |
| Get information about this contact, ie: away message/profile. | |
Protected Types | |
| typedef map< string, Contact > | buddy_t |
Protected Member Functions | |
| virtual string | formatId (const string &id) |
| void | eventLoggedIn () |
| void | eventLoggedOut () |
| void | eventRecvdMessage (const Contact &c, const string &message) |
| void | eventRecvdMessageNotBuddy (const Contact &c, const string &message) |
| void | eventStatusChange (const Contact &c) |
| void | eventError (int err_no, const string &error) |
| void | eventStateChange (State state) |
| void | eventGotPubkey (const Contact &c, const string &key) |
| void | eventGotCustom (const XMLNode &n) |
| void | eventGotContacts (const vector< buddy > &c) |
| void | eventGotInfo (const Contact &c, const string &info) |
| virtual Network * | addNet () |
| virtual void | removeNet (Network *) |
Protected Attributes | |
| Status | m_status |
| XMLNode | m_conf |
| xml config for protocol | |
| map< string, Contact > | m_buddies |
| list< Network * > | m_nets |
Jesse Lovelace
Henrik Abelsson
Definition at line 61 of file protocol.h.
|
||||||||||||||||
|
Protocol constructor, associates a protocol with a XML configuration, a ProtocolManager, and a name.
References GNUMessenger::ProtocolManager::addProtocol().
Here is the call graph for this function: ![]() |
|
|
Updates the protocol configuration and calls reset().
References m_conf, and reset().
Here is the call graph for this function: ![]() |
|
|
Returns the text string name of the protocol. Definition at line 125 of file protocol.h. Referenced by GNUMessenger::TocProtocol::addContact(), GNUMessenger::ProtocolManager::addProtocol(), and setContacts().
|
|
|
Returns the state of the network connection.
Referenced by GNUMessenger::TocProtocol::addContact(), and GNUMessenger::TocProtocol::handleRealData().
|
|
|
Returns the user-defined statues of the protocol.
|
|
|
Initiates the login sequence for this protocol.
Implemented in GNUMessenger::IcqProtocol, GNUMessenger::KitProtocol, GNUMessenger::MsnProtocol, GNUMessenger::TocProtocol, and GNUMessenger::YahooProtocol.
|
|
|
Resets the protocol by disconnecting and reconnecting to the network. All configuration settings are re-read. Implemented in GNUMessenger::IcqProtocol, GNUMessenger::KitProtocol, GNUMessenger::MsnProtocol, GNUMessenger::TocProtocol, and GNUMessenger::YahooProtocol.
Referenced by changeSettings(). |
|
||||||||||||
|
Tries to send a data message to a Contact.
|
|
||||||||||||
|
Tries to send a message to a Contact via this protocol.
Implemented in GNUMessenger::IcqProtocol, GNUMessenger::KitProtocol, GNUMessenger::MsnProtocol, GNUMessenger::TocProtocol, and GNUMessenger::YahooProtocol.
|
|
|
In a non-event based system this call will check the network for incoming data and will call appropriate handlers.
Reimplemented in GNUMessenger::KitProtocol, GNUMessenger::MsnProtocol, GNUMessenger::TocProtocol, and GNUMessenger::YahooProtocol. Definition at line 136 of file protocol.h.
|
1.3.8