Logo Search packages:      
Sourcecode: kadu version File versions

Classes | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes

XMPP::Client Class Reference

Communicates with the Jabber network. Start here. More...

Collaboration diagram for XMPP::Client:
Collaboration graph
[legend]

List of all members.

Classes

class  ClientPrivate
class  GroupChat

Signals

void activated ()
void beginImportRoster ()
void debugText (const QString &)
void disconnected ()
void endImportRoster ()
void groupChatError (const Jid &, int, const QString &)
void groupChatJoined (const Jid &)
void groupChatLeft (const Jid &)
void groupChatPresence (const Jid &, const Status &)
void incomingJidLink ()
void messageReceived (const Message &)
void presenceError (const Jid &, int, const QString &)
void resourceAvailable (const Jid &, const Resource &)
void resourceUnavailable (const Jid &, const Resource &)
void rosterItemAdded (const RosterItem &)
void rosterItemRemoved (const RosterItem &)
void rosterItemUpdated (const RosterItem &)
void rosterRequestFinished (bool, int, const QString &)
void subscription (const Jid &, const QString &, const QString &)
void xmlIncoming (const QString &)
void xmlOutgoing (const QString &)

Public Member Functions

void addExtension (const QString &ext, const Features &f)
BoBManagerbobManager () const
QString capsExt () const
QString capsNode () const
QString capsVersion () const
 Client (QObject *parent=0)
QString clientName () const
QString clientVersion () const
void close (bool fast=false)
void connectToServer (ClientStream *s, const Jid &j, bool auth=true)
void debug (const QString &)
QDomDocument * doc () const
const Featuresextension (const QString &ext) const
QStringList extensions () const
const Featuresfeatures () const
FileTransferManagerfileTransferManager () const
QString genUniqueId ()
void groupChatChangeNick (const QString &host, const QString &room, const QString &nick, const Status &)
bool groupChatJoin (const QString &host, const QString &room, const QString &nick, const QString &password=QString(), int maxchars=-1, int maxstanzas=-1, int seconds=-1, const Status &=Status())
void groupChatLeave (const QString &host, const QString &room)
QString groupChatNick (const QString &host, const QString &room) const
QString groupChatPassword (const QString &host, const QString &room) const
void groupChatSetStatus (const QString &host, const QString &room, const Status &)
QString host () const
IBBManageribbManager () const
DiscoItem::Identity identity ()
bool isActive () const
Jid jid () const
JidLinkManager * jidLinkManager () const
bool manualTimeZoneOffset () const
 Returns true if Client is using old, manual time zone conversions.
QString OSName () const
QString pass () const
void removeExtension (const QString &ext)
QString resource () const
const ResourceListresourceList () const
TaskrootTask ()
const LiveRosterroster () const
void rosterRequest ()
S5BManagers5bManager () const
void send (const QDomElement &)
void send (const QString &)
void sendMessage (const Message &)
void sendSubscription (const Jid &, const QString &, const QString &nick=QString())
void setCapsNode (const QString &)
void setCapsVersion (const QString &)
void setClientName (const QString &)
void setClientVersion (const QString &)
void setFeatures (const Features &f)
void setFileTransferEnabled (bool b)
void setIdentity (DiscoItem::Identity)
void setOSName (const QString &)
void setPresence (const Status &)
void setTimeZone (const QString &, int)
void start (const QString &host, const QString &user, const QString &pass, const QString &resource)
Streamstream ()
QString streamBaseNS () const
QString timeZone () const
int timeZoneOffset () const
QString user () const

Private Slots

void ibb_incomingReady ()
void pmMessage (const Message &)
void ppPresence (const Jid &, const Status &)
void ppSubscription (const Jid &, const QString &, const QString &)
void prRoster (const Roster &)
void s5b_incomingReady ()
void slotRosterRequestFinished ()
void streamError (int)
void streamIncomingXml (const QString &)
void streamOutgoingXml (const QString &)
void streamReadyRead ()

Private Member Functions

void cleanup ()
void distribute (const QDomElement &)
void handleIncoming (BSConnection *)
void importRoster (const Roster &)
void importRosterItem (const RosterItem &)
void updatePresence (LiveRosterItem *, const Jid &, const Status &)
void updateSelfPresence (const Jid &, const Status &)

Private Attributes

ClientPrivated

Detailed Description

Communicates with the Jabber network. Start here.

Client controls an active Jabber connection. It allows you to connect, authenticate, manipulate the roster, and send / receive messages and presence. It is the centerpiece of this library, and all Tasks must pass through it.

For convenience, many Tasks are handled internally to Client (such as JT_Auth). However, for accessing features beyond the basics provided by Client, you will need to manually invoke Tasks. Fortunately, the process is very simple.

The entire Task system is heavily founded on Qt. All Tasks have a parent, except for the root Task, and are considered QObjects. By using Qt's RTTI facilities (QObject::sender(), QObject::isA(), etc), you can use a "fire and forget" approach with Tasks.

  #include "client.h"
  using namespace Jabber;

  ...

  Client *client;

  Session::Session()
  {
    client = new Client;
    connect(client, SIGNAL(handshaken()), SLOT(clientHandshaken()));
    connect(client, SIGNAL(authFinished(bool, int, const QString &)), SLOT(authFinished(bool, int, const QString &)));
    client->connectToHost("jabber.org");
  }

  void Session::clientHandshaken()
  {
    client->authDigest("jabtest", "12345", "Psi");
  }

  void Session::authFinished(bool success, int, const QString &err)
  {
    if(success)
      printf("Login success!");
    else
      printf("Login failed.  Here's why: %s\n", err.toLatin1());
  }

Definition at line 55 of file xmpp_client.h.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index