~ubuntu-branches/ubuntu/oneiric/psi/oneiric

« back to all changes in this revision

Viewing changes to iris/src/xmpp/xmpp-im/xmpp_tasks.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2009-09-25 17:49:51 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090925174951-lvm7kdap82o8xhn3
Tags: 0.13-1
* Updated to upstream version 0.13
* Set Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * tasks.h - basic tasks
 
3
 * Copyright (C) 2001, 2002  Justin Karneges
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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
 
18
 *
 
19
 */
 
20
 
 
21
#ifndef JABBER_TASKS_H
 
22
#define JABBER_TASKS_H
 
23
 
 
24
#include <qstring.h>
 
25
#include <qdom.h>
 
26
//Added by qt3to4:
 
27
#include <QList>
 
28
 
 
29
#include "im.h"
 
30
#include "xmpp_vcard.h"
 
31
#include "xmpp_discoinfotask.h"
 
32
 
 
33
namespace XMPP
 
34
{
 
35
        class Roster;
 
36
        class Status;
 
37
 
 
38
        class JT_Register : public Task
 
39
        {
 
40
                Q_OBJECT
 
41
        public:
 
42
                JT_Register(Task *parent);
 
43
                ~JT_Register();
 
44
 
 
45
                // OLd style registration
 
46
                void reg(const QString &user, const QString &pass);
 
47
 
 
48
                void changepw(const QString &pass);
 
49
                void unreg(const Jid &j="");
 
50
 
 
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 &);
 
57
 
 
58
                void onGo();
 
59
                bool take(const QDomElement &);
 
60
 
 
61
        private:
 
62
                QDomElement iq;
 
63
                Jid to;
 
64
 
 
65
                class Private;
 
66
                Private *d;
 
67
        };
 
68
 
 
69
        class JT_UnRegister : public Task
 
70
        {
 
71
                Q_OBJECT
 
72
        public:
 
73
                JT_UnRegister(Task *parent);
 
74
                ~JT_UnRegister();
 
75
 
 
76
                void unreg(const Jid &);
 
77
 
 
78
                void onGo();
 
79
 
 
80
        private slots:
 
81
                void getFormFinished();
 
82
                void unregFinished();
 
83
 
 
84
        private:
 
85
                class Private;
 
86
                Private *d;
 
87
        };
 
88
 
 
89
        class JT_Roster : public Task
 
90
        {
 
91
                Q_OBJECT
 
92
        public:
 
93
                JT_Roster(Task *parent);
 
94
                ~JT_Roster();
 
95
 
 
96
                void get();
 
97
                void set(const Jid &, const QString &name, const QStringList &groups);
 
98
                void remove(const Jid &);
 
99
 
 
100
                const Roster & roster() const;
 
101
 
 
102
                QString toString() const;
 
103
                bool fromString(const QString &);
 
104
 
 
105
                void onGo();
 
106
                bool take(const QDomElement &x);
 
107
 
 
108
        private:
 
109
                int type;
 
110
                QDomElement iq;
 
111
                Jid to;
 
112
 
 
113
                class Private;
 
114
                Private *d;
 
115
        };
 
116
 
 
117
        class JT_PushRoster : public Task
 
118
        {
 
119
                Q_OBJECT
 
120
        public:
 
121
                JT_PushRoster(Task *parent);
 
122
                ~JT_PushRoster();
 
123
 
 
124
                bool take(const QDomElement &);
 
125
 
 
126
        signals:
 
127
                void roster(const Roster &);
 
128
 
 
129
        private:
 
130
                class Private;
 
131
                Private *d;
 
132
        };
 
133
 
 
134
        class JT_Presence : public Task
 
135
        {
 
136
                Q_OBJECT
 
137
        public:
 
138
                JT_Presence(Task *parent);
 
139
                ~JT_Presence();
 
140
 
 
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);
 
145
 
 
146
                void onGo();
 
147
 
 
148
        private:
 
149
                QDomElement tag;
 
150
                int type;
 
151
 
 
152
                class Private;
 
153
                Private *d;
 
154
        };
 
155
 
 
156
        class JT_PushPresence : public Task
 
157
        {
 
158
                Q_OBJECT
 
159
        public:
 
160
                JT_PushPresence(Task *parent);
 
161
                ~JT_PushPresence();
 
162
 
 
163
                bool take(const QDomElement &);
 
164
 
 
165
        signals:
 
166
                void presence(const Jid &, const Status &);
 
167
                void subscription(const Jid &, const QString &, const QString&);
 
168
 
 
169
        private:
 
170
                class Private;
 
171
                Private *d;
 
172
        };
 
173
        
 
174
        class JT_Session : public Task
 
175
        {
 
176
        public:
 
177
                JT_Session(Task *parent);
 
178
                void onGo();
 
179
                bool take(const QDomElement&);
 
180
        };
 
181
 
 
182
        class JT_Message : public Task
 
183
        {
 
184
                Q_OBJECT
 
185
        public:
 
186
                JT_Message(Task *parent, const Message &);
 
187
                ~JT_Message();
 
188
 
 
189
                void onGo();
 
190
 
 
191
        private:
 
192
                Message m;
 
193
 
 
194
                class Private;
 
195
                Private *d;
 
196
        };
 
197
 
 
198
        class JT_PushMessage : public Task
 
199
        {
 
200
                Q_OBJECT
 
201
        public:
 
202
                JT_PushMessage(Task *parent);
 
203
                ~JT_PushMessage();
 
204
 
 
205
                bool take(const QDomElement &);
 
206
 
 
207
        signals:
 
208
                void message(const Message &);
 
209
 
 
210
        private:
 
211
                class Private;
 
212
                Private *d;
 
213
        };
 
214
 
 
215
        class JT_GetServices : public Task
 
216
        {
 
217
                Q_OBJECT
 
218
        public:
 
219
                JT_GetServices(Task *);
 
220
 
 
221
                void get(const Jid &);
 
222
 
 
223
                const AgentList & agents() const;
 
224
 
 
225
                void onGo();
 
226
                bool take(const QDomElement &x);
 
227
 
 
228
        private:
 
229
                class Private;
 
230
                Private *d;
 
231
 
 
232
                QDomElement iq;
 
233
                Jid jid;
 
234
                AgentList agentList;
 
235
        };
 
236
 
 
237
        class JT_VCard : public Task
 
238
        {
 
239
                Q_OBJECT
 
240
        public:
 
241
                JT_VCard(Task *parent);
 
242
                ~JT_VCard();
 
243
 
 
244
                void get(const Jid &);
 
245
                void set(const VCard &);
 
246
                void set(const Jid &, const VCard &);
 
247
 
 
248
                const Jid & jid() const;
 
249
                const VCard  & vcard() const;
 
250
                
 
251
                void onGo();
 
252
                bool take(const QDomElement &x);
 
253
 
 
254
        private:
 
255
                int type;
 
256
 
 
257
                class Private;
 
258
                Private *d;
 
259
        };
 
260
 
 
261
        class JT_Search : public Task
 
262
        {
 
263
                Q_OBJECT
 
264
        public:
 
265
                JT_Search(Task *parent);
 
266
                ~JT_Search();
 
267
 
 
268
                const Form & form() const;
 
269
                const QList<SearchResult> & results() const;
 
270
 
 
271
                bool hasXData() const;
 
272
                const XData & xdata() const;
 
273
 
 
274
                void get(const Jid &);
 
275
                void set(const Form &);
 
276
                void set(const Jid &, const XData &);
 
277
 
 
278
                void onGo();
 
279
                bool take(const QDomElement &x);
 
280
 
 
281
        private:
 
282
                QDomElement iq;
 
283
                int type;
 
284
 
 
285
                class Private;
 
286
                Private *d;
 
287
        };
 
288
 
 
289
        class JT_ClientVersion : public Task
 
290
        {
 
291
                Q_OBJECT
 
292
        public:
 
293
                JT_ClientVersion(Task *);
 
294
 
 
295
                void get(const Jid &);
 
296
                void onGo();
 
297
                bool take(const QDomElement &);
 
298
 
 
299
                const Jid & jid() const;
 
300
                const QString & name() const;
 
301
                const QString & version() const;
 
302
                const QString & os() const;
 
303
 
 
304
        private:
 
305
                QDomElement iq;
 
306
 
 
307
                Jid j;
 
308
                QString v_name, v_ver, v_os;
 
309
        };
 
310
/*
 
311
        class JT_ClientTime : public Task
 
312
        {
 
313
                Q_OBJECT
 
314
        public:
 
315
                JT_ClientTime(Task *, const Jid &);
 
316
 
 
317
                void go();
 
318
                bool take(const QDomElement &);
 
319
 
 
320
                Jid j;
 
321
                QDateTime utc;
 
322
                QString timezone, display;
 
323
 
 
324
        private:
 
325
                QDomElement iq;
 
326
        };
 
327
*/
 
328
        class JT_ServInfo : public Task
 
329
        {
 
330
                Q_OBJECT
 
331
        public:
 
332
                JT_ServInfo(Task *);
 
333
                ~JT_ServInfo();
 
334
 
 
335
                bool take(const QDomElement &);
 
336
        };
 
337
 
 
338
        class JT_Gateway : public Task
 
339
        {
 
340
                Q_OBJECT
 
341
        public:
 
342
                JT_Gateway(Task *);
 
343
 
 
344
                void get(const Jid &);
 
345
                void set(const Jid &, const QString &prompt);
 
346
                void onGo();
 
347
                bool take(const QDomElement &);
 
348
 
 
349
                Jid jid() const;
 
350
 
 
351
                QString desc() const;
 
352
                QString prompt() const;
 
353
                Jid translatedJid() const;
 
354
 
 
355
        private:
 
356
                QDomElement iq;
 
357
 
 
358
                int type;
 
359
                Jid v_jid;
 
360
                Jid v_translatedJid;
 
361
                QString v_prompt, v_desc;
 
362
        };
 
363
 
 
364
        class JT_Browse : public Task
 
365
        {
 
366
                Q_OBJECT
 
367
        public:
 
368
                JT_Browse(Task *);
 
369
                ~JT_Browse();
 
370
 
 
371
                void get(const Jid &);
 
372
 
 
373
                const AgentList & agents() const;
 
374
                const AgentItem & root() const;
 
375
 
 
376
                void onGo();
 
377
                bool take(const QDomElement &);
 
378
 
 
379
        private:
 
380
                class Private;
 
381
                Private *d;
 
382
 
 
383
                AgentItem browseHelper (const QDomElement &i);
 
384
        };
 
385
 
 
386
        class JT_DiscoItems : public Task
 
387
        {
 
388
                Q_OBJECT
 
389
        public:
 
390
                JT_DiscoItems(Task *);
 
391
                ~JT_DiscoItems();
 
392
        
 
393
                void get(const Jid &, const QString &node = QString::null);
 
394
                void get(const DiscoItem &);
 
395
        
 
396
                const DiscoList &items() const;
 
397
        
 
398
                void onGo();
 
399
                bool take(const QDomElement &);
 
400
        
 
401
        private:
 
402
                class Private;
 
403
                Private *d;
 
404
        };
 
405
 
 
406
        class JT_DiscoPublish : public Task
 
407
        {
 
408
                Q_OBJECT
 
409
        public:
 
410
                JT_DiscoPublish(Task *);
 
411
                ~JT_DiscoPublish();
 
412
        
 
413
                void set(const Jid &, const DiscoList &);
 
414
        
 
415
                void onGo();
 
416
                bool take(const QDomElement &);
 
417
        
 
418
        private:
 
419
                class Private;
 
420
                Private *d;
 
421
        };
 
422
}
 
423
 
 
424
#endif