• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kopete/protocols/messenger/libpapillon

Papillon::Client

Papillon::Client Class Reference

#include <Papillon/Client>

Inheritance diagram for Papillon::Client:

Inheritance graph
[legend]

List of all members.


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 );

Author:
Michaƫl Larouche <larouche@kde.org>

Definition at line 63 of file client.h.


Public Types

enum  ConnectionStatus {
  Disconnected = 0, LoginBadPassword, Connecting, Connected,
  LoggedIn
}

Public Slots

void connectToServer (Papillon::Presence::Status initialPresence=Papillon::Presence::Online)
void disconnectFromServer ()
void setServer (const QString &server, quint16 port)

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)
Papillon::Client::ConnectionStatus connectionStatus () const
ContactList * contactList ()
Connection * createConnection ()
Connection * notificationConnection ()
UserContact * userContact ()
 ~Client ()

Member Enumeration Documentation

enum Papillon::Client::ConnectionStatus

ConnectionStatus is the possible states of Client's connection status.

Enumerator:
Disconnected  Client is current disconnected.
LoginBadPassword  Client got a bad password.
Connecting  Client is currently connecting to Windows Live Messenger.
Connected  Client is connected and now will proceed to login.
LoggedIn  Client is now logged in.

Definition at line 70 of file client.h.


Constructor & Destructor Documentation

Papillon::Client::Client ( Connector *  connector,
QObject *  parent = 0 
) [explicit]

Create a new Client.

Parameters:
connector Connector to use.
parent QObject parent.

Definition at line 64 of file client.cpp.

Papillon::Client::~Client (  ) 

d-tor.

Definition at line 72 of file client.cpp.


Member Function Documentation

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]

Emitted when Client's connection status has changed.

See also:
ConnectionStatus

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.

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.

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.

Connection * Papillon::Client::createConnection (  ) 

Create and a setup a new connection.

Returns:
the new Connection instance.

Definition at line 77 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.

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.

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.

UserContact * Papillon::Client::userContact (  ) 

Get the user contact.

Returns:
UserContact instance for this Client.

Definition at line 92 of file client.cpp.


The documentation for this class was generated from the following files:
  • client.h
  • client.cpp

kopete/protocols/messenger/libpapillon

Skip menu "kopete/protocols/messenger/libpapillon"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal