~ubuntu-branches/ubuntu/utopic/psi/utopic

« back to all changes in this revision

Viewing changes to iris/include/xmpp_task.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
 
 * xmpp_task.h
3
 
 * Copyright (C) 2003  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 XMPP_TASK_H
22
 
#define XMPP_TASK_H
23
 
 
24
 
#include <QObject>
25
 
#include <QString>
26
 
 
27
 
class QDomDocument;
28
 
class QDomElement;
29
 
 
30
 
namespace XMPP {
31
 
        class Client;
32
 
        class Jid;
33
 
 
34
 
        class Task : public QObject
35
 
        {
36
 
                Q_OBJECT
37
 
        public:
38
 
                enum { ErrDisc };
39
 
                Task(Task *parent);
40
 
                Task(Client *, bool isRoot);
41
 
                virtual ~Task();
42
 
 
43
 
                Task *parent() const;
44
 
                Client *client() const;
45
 
                QDomDocument *doc() const;
46
 
                QString id() const;
47
 
 
48
 
                bool success() const;
49
 
                int statusCode() const;
50
 
                const QString & statusString() const;
51
 
 
52
 
                void go(bool autoDelete=false);
53
 
                virtual bool take(const QDomElement &);
54
 
                void safeDelete();
55
 
 
56
 
        signals:
57
 
                void finished();
58
 
 
59
 
        protected:
60
 
                virtual void onGo();
61
 
                virtual void onDisconnect();
62
 
                void send(const QDomElement &);
63
 
                void setSuccess(int code=0, const QString &str="");
64
 
                void setError(const QDomElement &);
65
 
                void setError(int code=0, const QString &str="");
66
 
                void debug(const char *, ...);
67
 
                void debug(const QString &);
68
 
                bool iqVerify(const QDomElement &x, const Jid &to, const QString &id, const QString &xmlns="");
69
 
 
70
 
        private slots:
71
 
                void clientDisconnected();
72
 
                void done();
73
 
 
74
 
        private:
75
 
                void init();
76
 
 
77
 
                class TaskPrivate;
78
 
                TaskPrivate *d;
79
 
        };
80
 
}
81
 
 
82
 
#endif