2
* tasks.h - basic tasks
3
* Copyright (C) 2001, 2002 Justin Karneges
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
#ifndef JABBER_TASKS_H
22
#define JABBER_TASKS_H
30
#include "xmpp_vcard.h"
31
#include "xmpp_discoinfotask.h"
38
class JT_Register : public Task
42
JT_Register(Task *parent);
45
// OLd style registration
46
void reg(const QString &user, const QString &pass);
48
void changepw(const QString &pass);
49
void unreg(const Jid &j="");
51
const Form & form() const;
52
bool hasXData() const;
53
const XData& xdata() const;
54
void getForm(const Jid &);
55
void setForm(const Form &);
56
void setForm(const Jid&, const XData &);
59
bool take(const QDomElement &);
69
class JT_UnRegister : public Task
73
JT_UnRegister(Task *parent);
76
void unreg(const Jid &);
81
void getFormFinished();
89
class JT_Roster : public Task
93
JT_Roster(Task *parent);
97
void set(const Jid &, const QString &name, const QStringList &groups);
98
void remove(const Jid &);
100
const Roster & roster() const;
102
QString toString() const;
103
bool fromString(const QString &);
106
bool take(const QDomElement &x);
117
class JT_PushRoster : public Task
121
JT_PushRoster(Task *parent);
124
bool take(const QDomElement &);
127
void roster(const Roster &);
134
class JT_Presence : public Task
138
JT_Presence(Task *parent);
141
void pres(const Status &);
142
void pres(const Jid &, const Status &);
143
void sub(const Jid &, const QString &subType, const QString& nick = QString());
144
void probe(const Jid &to);
156
class JT_PushPresence : public Task
160
JT_PushPresence(Task *parent);
163
bool take(const QDomElement &);
166
void presence(const Jid &, const Status &);
167
void subscription(const Jid &, const QString &, const QString&);
174
class JT_Session : public Task
177
JT_Session(Task *parent);
179
bool take(const QDomElement&);
182
class JT_Message : public Task
186
JT_Message(Task *parent, const Message &);
198
class JT_PushMessage : public Task
202
JT_PushMessage(Task *parent);
205
bool take(const QDomElement &);
208
void message(const Message &);
215
class JT_GetServices : public Task
219
JT_GetServices(Task *);
221
void get(const Jid &);
223
const AgentList & agents() const;
226
bool take(const QDomElement &x);
237
class JT_VCard : public Task
241
JT_VCard(Task *parent);
244
void get(const Jid &);
245
void set(const VCard &);
246
void set(const Jid &, const VCard &);
248
const Jid & jid() const;
249
const VCard & vcard() const;
252
bool take(const QDomElement &x);
261
class JT_Search : public Task
265
JT_Search(Task *parent);
268
const Form & form() const;
269
const QList<SearchResult> & results() const;
271
bool hasXData() const;
272
const XData & xdata() const;
274
void get(const Jid &);
275
void set(const Form &);
276
void set(const Jid &, const XData &);
279
bool take(const QDomElement &x);
289
class JT_ClientVersion : public Task
293
JT_ClientVersion(Task *);
295
void get(const Jid &);
297
bool take(const QDomElement &);
299
const Jid & jid() const;
300
const QString & name() const;
301
const QString & version() const;
302
const QString & os() const;
308
QString v_name, v_ver, v_os;
311
class JT_ClientTime : public Task
315
JT_ClientTime(Task *, const Jid &);
318
bool take(const QDomElement &);
322
QString timezone, display;
328
class JT_ServInfo : public Task
335
bool take(const QDomElement &);
338
class JT_Gateway : public Task
344
void get(const Jid &);
345
void set(const Jid &, const QString &prompt);
347
bool take(const QDomElement &);
351
QString desc() const;
352
QString prompt() const;
353
Jid translatedJid() const;
361
QString v_prompt, v_desc;
364
class JT_Browse : public Task
371
void get(const Jid &);
373
const AgentList & agents() const;
374
const AgentItem & root() const;
377
bool take(const QDomElement &);
383
AgentItem browseHelper (const QDomElement &i);
386
class JT_DiscoItems : public Task
390
JT_DiscoItems(Task *);
393
void get(const Jid &, const QString &node = QString::null);
394
void get(const DiscoItem &);
396
const DiscoList &items() const;
399
bool take(const QDomElement &);
406
class JT_DiscoPublish : public Task
410
JT_DiscoPublish(Task *);
413
void set(const Jid &, const DiscoList &);
416
bool take(const QDomElement &);