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"
39 class JT_Register
: public Task
43 JT_Register(Task
*parent
);
46 // OLd style registration
47 void reg(const QString
&user
, const QString
&pass
);
49 void changepw(const QString
&pass
);
50 void unreg(const Jid
&j
="");
52 const Form
& form() const;
53 bool hasXData() const;
54 const XData
& xdata() const;
55 void getForm(const Jid
&);
56 void setForm(const Form
&);
57 void setForm(const Jid
&, const XData
&);
60 bool take(const QDomElement
&);
70 class JT_UnRegister
: public Task
74 JT_UnRegister(Task
*parent
);
77 void unreg(const Jid
&);
82 void getFormFinished();
90 class JT_Roster
: public Task
94 JT_Roster(Task
*parent
);
98 void set(const Jid
&, const QString
&name
, const QStringList
&groups
);
99 void remove(const Jid
&);
101 const Roster
& roster() const;
103 QString
toString() const;
104 bool fromString(const QString
&);
107 bool take(const QDomElement
&x
);
118 class JT_PushRoster
: public Task
122 JT_PushRoster(Task
*parent
);
125 bool take(const QDomElement
&);
128 void roster(const Roster
&);
135 class JT_Presence
: public Task
139 JT_Presence(Task
*parent
);
142 void pres(const Status
&);
143 void pres(const Jid
&, const Status
&);
144 void sub(const Jid
&, const QString
&subType
, const QString
& nick
= QString());
145 void probe(const Jid
&to
);
157 class JT_PushPresence
: public Task
161 JT_PushPresence(Task
*parent
);
164 bool take(const QDomElement
&);
167 void presence(const Jid
&, const Status
&);
168 void subscription(const Jid
&, const QString
&, const QString
&);
175 class JT_Session
: public Task
178 JT_Session(Task
*parent
);
180 bool take(const QDomElement
&);
183 class JT_Message
: public Task
187 JT_Message(Task
*parent
, const Message
&);
199 class JT_PushMessage
: public Task
203 JT_PushMessage(Task
*parent
);
206 bool take(const QDomElement
&);
209 void message(const Message
&);
216 class JT_GetServices
: public Task
220 JT_GetServices(Task
*);
222 void get(const Jid
&);
224 const AgentList
& agents() const;
227 bool take(const QDomElement
&x
);
238 class JT_VCard
: public Task
242 JT_VCard(Task
*parent
);
245 void get(const Jid
&);
246 void set(const VCard
&);
247 void set(const Jid
&, const VCard
&);
249 const Jid
& jid() const;
250 const VCard
& vcard() const;
253 bool take(const QDomElement
&x
);
262 class JT_Search
: public Task
266 JT_Search(Task
*parent
);
269 const Form
& form() const;
270 const QList
<SearchResult
> & results() const;
272 bool hasXData() const;
273 const XData
& xdata() const;
275 void get(const Jid
&);
276 void set(const Form
&);
277 void set(const Jid
&, const XData
&);
280 bool take(const QDomElement
&x
);
290 class JT_ClientVersion
: public Task
294 JT_ClientVersion(Task
*);
296 void get(const Jid
&);
298 bool take(const QDomElement
&);
300 const Jid
& jid() const;
301 const QString
& name() const;
302 const QString
& version() const;
303 const QString
& os() const;
309 QString v_name
, v_ver
, v_os
;
312 class JT_ClientTime : public Task
316 JT_ClientTime(Task *, const Jid &);
319 bool take(const QDomElement &);
323 QString timezone, display;
329 class JT_ServInfo
: public Task
336 bool take(const QDomElement
&);
339 class JT_Gateway
: public Task
345 void get(const Jid
&);
346 void set(const Jid
&, const QString
&prompt
);
348 bool take(const QDomElement
&);
352 QString
desc() const;
353 QString
prompt() const;
354 Jid
translatedJid() const;
362 QString v_prompt
, v_desc
;
365 class JT_Browse
: public Task
372 void get(const Jid
&);
374 const AgentList
& agents() const;
375 const AgentItem
& root() const;
378 bool take(const QDomElement
&);
384 AgentItem
browseHelper (const QDomElement
&i
);
387 class JT_DiscoItems
: public Task
391 JT_DiscoItems(Task
*);
394 void get(const Jid
&, const QString
&node
= QString::null
);
395 void get(const DiscoItem
&);
397 const DiscoList
&items() const;
400 bool take(const QDomElement
&);
407 class JT_DiscoPublish
: public Task
411 JT_DiscoPublish(Task
*);
414 void set(const Jid
&, const DiscoList
&);
417 bool take(const QDomElement
&);
424 class JT_BoBServer
: public Task
429 JT_BoBServer(Task
*parent
);
430 bool take(const QDomElement
&);
433 class JT_BitsOfBinary
: public Task
437 JT_BitsOfBinary(Task
*);
440 void get(const Jid
&, const QString
&);
443 bool take(const QDomElement
&);