kopete/protocols/messenger/libpapillon
Papillon::Client Class Reference
#include <Papillon/Client>

Detailed Description
Client to Windows Live Messenger service.This is the main interface between the client application (ex: Kopete, telepathy-papillon, etc.) and the Windows Live Messenger service.
Setting up Client object
First of all, you must initialize a Connector object. A Connector object is a abstract representation of a socket. For convience, libpapillon include a QtConnector object. After you must listen to connectioStatusChanged() signal to be notified of connection status change, like connected and login. See the following example:Papillon::Client *client = new Client(new QtConnector(qObjectParent), qObjectParent); connect(client, SIGNAL(connectionStatusChanged(Papillon::Client::ConnectionStatus)), this, SLOT(aSlot(Papillon::Client::ConnectionStatus)));
Logging to Windows Live Messenger
After setting up the Client object, you must set some information before attemping to connect like the passport identifier, the password and optionally the initial presence. You can set a different server using setServer(). An example of login:client->userContact()->setLoginInformation( "test@passport.com", "password" ); client->setServer("messenger.hotmail.com", 1863); client->connectToServer( Papillon::Presence::Busy );
Definition at line 63 of file client.h.
Public Types | |
| enum | ConnectionStatus { Disconnected = 0, LoginBadPassword, Connecting, Connected, LoggedIn } |
Public Slots | |
| void | setServer (const QString &server, quint16 port) |
| void | connectToServer (Papillon::Presence::Status initialPresence=Papillon::Presence::Online) |
| void | disconnectFromServer () |
Signals | |
| void | connectionStatusChanged (Papillon::Client::ConnectionStatus status) |
| void | contactPresenceChanged (const QString &contactId, Papillon::Presence::Status presence) |
| void | contactStatusMessageChanged (const QString &contactId, const Papillon::StatusMessage &newStatusMessage) |
Public Member Functions | |
| Client (Connector *connector, QObject *parent=0) | |
| ~Client () | |
| Connection * | createConnection () |
| UserContact * | userContact () |
| ContactList * | contactList () |
| Connection * | notificationConnection () |
| Papillon::Client::ConnectionStatus | connectionStatus () const |
Member Enumeration Documentation
ConnectionStatus is the possible states of Client's connection status.
Constructor & Destructor Documentation
| Papillon::Client::~Client | ( | ) |
Member Function Documentation
| Connection * Papillon::Client::createConnection | ( | ) |
Create and a setup a new connection.
- Returns:
- the new Connection instance.
Definition at line 77 of file client.cpp.
| UserContact * Papillon::Client::userContact | ( | ) |
Get the user contact.
- Returns:
- UserContact instance for this Client.
Definition at line 92 of file client.cpp.
| ContactList * Papillon::Client::contactList | ( | ) |
Get the contact list instance.
Initially, the contact list isn't loaded. Fetching of the contact list will be called when necessary.
- Returns:
- the ContactList instance.
Definition at line 87 of file client.cpp.
| Connection * Papillon::Client::notificationConnection | ( | ) |
Get the current connection to Notification server (NS).
Use its rootTask when creating tasks for the notification server yourself.
- Returns:
- Notification server Connection instance.
Definition at line 97 of file client.cpp.
| Papillon::Client::ConnectionStatus Papillon::Client::connectionStatus | ( | ) | const |
Get the current connection status.
- Returns:
- Current connection status.
Definition at line 102 of file client.cpp.
| void Papillon::Client::connectionStatusChanged | ( | Papillon::Client::ConnectionStatus | status | ) | [signal] |
| void Papillon::Client::contactPresenceChanged | ( | const QString & | contactId, | |
| Papillon::Presence::Status | presence | |||
| ) | [signal] |
Emitted when a contact change his online presence.
- Parameters:
-
contactId Contact ID presence Contact's new online presence
| void Papillon::Client::contactStatusMessageChanged | ( | const QString & | contactId, | |
| const Papillon::StatusMessage & | newStatusMessage | |||
| ) | [signal] |
Emitted when a contact has updated his status message.
- Parameters:
-
contactId Contact ID newStatusMessage Updated status message.
| void Papillon::Client::setServer | ( | const QString & | server, | |
| quint16 | port | |||
| ) | [slot] |
Set an alternative login server.
Use this method if you want to change the default server.
- Parameters:
-
server Alternative server IP address or domain name. port Alternative server TCP port.
Definition at line 130 of file client.cpp.
| void Papillon::Client::connectToServer | ( | Papillon::Presence::Status | initialPresence = Papillon::Presence::Online |
) | [slot] |
Connect to Windows Live Messenger.
You can optionally pass the initial presence of the user contact.
You must set login information before calling this method. See Logging to Windows Live Messenger
- Parameters:
-
initialPresence Initial presence at login
Definition at line 107 of file client.cpp.
| void Papillon::Client::disconnectFromServer | ( | ) | [slot] |
Disconnect from Windows Live Messenger Close the connection and set the status to offline.
Definition at line 123 of file client.cpp.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference