2
* Copyright (C) 2003 Justin Karneges
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
#include <QStringList>
27
#include "xmpp_status.h"
28
#include "xmpp_discoitem.h"
36
class FileTransferManager;
53
class Client : public QObject
58
Client(QObject *parent=0);
61
bool isActive() const;
62
void connectToServer(ClientStream *s, const Jid &j, bool auth=true);
63
void start(const QString &host, const QString &user, const QString &pass, const QString &resource);
64
void close(bool fast=false);
67
QString streamBaseNS() const;
68
const LiveRoster & roster() const;
69
const ResourceList & resourceList() const;
71
void send(const QDomElement &);
72
void send(const QString &);
77
QString resource() const;
81
void sendMessage(const Message &);
82
void sendSubscription(const Jid &, const QString &, const QString& nick = QString());
83
void setPresence(const Status &);
85
void debug(const QString &);
86
QString genUniqueId();
88
QDomDocument *doc() const;
90
QString OSName() const;
91
QString timeZone() const;
92
int timeZoneOffset() const;
93
QString clientName() const;
94
QString clientVersion() const;
95
QString capsNode() const;
96
QString capsVersion() const;
97
QString capsExt() const;
99
void setOSName(const QString &);
100
void setTimeZone(const QString &, int);
101
void setClientName(const QString &);
102
void setClientVersion(const QString &);
103
void setCapsNode(const QString &);
104
void setCapsVersion(const QString &);
106
void setIdentity(DiscoItem::Identity);
107
DiscoItem::Identity identity();
109
void setFeatures(const Features& f);
110
const Features& features() const;
112
void addExtension(const QString& ext, const Features& f);
113
void removeExtension(const QString& ext);
114
const Features& extension(const QString& ext) const;
115
QStringList extensions() const;
117
S5BManager *s5bManager() const;
118
IBBManager *ibbManager() const;
119
JidLinkManager *jidLinkManager() const;
121
void setFileTransferEnabled(bool b);
122
FileTransferManager *fileTransferManager() const;
124
QString groupChatPassword(const QString& host, const QString& room) const;
125
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());
126
void groupChatSetStatus(const QString &host, const QString &room, const Status &);
127
void groupChatChangeNick(const QString &host, const QString &room, const QString &nick, const Status &);
128
void groupChatLeave(const QString &host, const QString &room);
133
//void authFinished(bool, int, const QString &);
134
void rosterRequestFinished(bool, int, const QString &);
135
void rosterItemAdded(const RosterItem &);
136
void rosterItemUpdated(const RosterItem &);
137
void rosterItemRemoved(const RosterItem &);
138
void resourceAvailable(const Jid &, const Resource &);
139
void resourceUnavailable(const Jid &, const Resource &);
140
void presenceError(const Jid &, int, const QString &);
141
void subscription(const Jid &, const QString &, const QString &);
142
void messageReceived(const Message &);
143
void debugText(const QString &);
144
void xmlIncoming(const QString &);
145
void xmlOutgoing(const QString &);
146
void groupChatJoined(const Jid &);
147
void groupChatLeft(const Jid &);
148
void groupChatPresence(const Jid &, const Status &);
149
void groupChatError(const Jid &, int, const QString &);
151
void incomingJidLink();
154
//void streamConnected();
155
//void streamHandshaken();
156
//void streamError(const StreamError &);
157
//void streamSSLCertificateReady(const QSSLCert &);
158
//void streamCloseFinished();
159
void streamError(int);
160
void streamReadyRead();
161
void streamIncomingXml(const QString &);
162
void streamOutgoingXml(const QString &);
164
void slotRosterRequestFinished();
167
void ppSubscription(const Jid &, const QString &, const QString&);
168
void ppPresence(const Jid &, const Status &);
169
void pmMessage(const Message &);
170
void prRoster(const Roster &);
172
void s5b_incomingReady();
173
void ibb_incomingReady();
179
void distribute(const QDomElement &);
180
void importRoster(const Roster &);
181
void importRosterItem(const RosterItem &);
182
void updateSelfPresence(const Jid &, const Status &);
183
void updatePresence(LiveRosterItem *, const Jid &, const Status &);