~ubuntu-branches/ubuntu/jaunty/psi/jaunty

« back to all changes in this revision

Viewing changes to src/capsmanager.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * capsmanager.h
3
 
 * Copyright (C) 2006  Remko Troncon
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or
6
 
 * modify it under the terms of the GNU General Public License
7
 
 * as published by the Free Software Foundation; either version 2
8
 
 * of the License, or (at your option) any later version.
9
 
 *
10
 
 * This program 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
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * 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 CAPSMANAGER_H
22
 
#define CAPSMANAGER_H
23
 
 
24
 
#include <QMap>
25
 
#include <QList>
26
 
#include <QString>
27
 
#include <QObject>
28
 
 
29
 
#include "capsspec.h"
30
 
#include "xmpp_features.h"
31
 
 
32
 
namespace XMPP {
33
 
        class Jid;
34
 
        class Client;
35
 
}
36
 
using namespace XMPP;
37
 
 
38
 
class CapsManager : public QObject
39
 
{
40
 
        Q_OBJECT
41
 
 
42
 
public:
43
 
        CapsManager(XMPP::Client*);
44
 
 
45
 
        bool isEnabled();
46
 
        void setEnabled(bool);
47
 
 
48
 
        void updateCaps(const Jid& jid, const QString& node, const QString& ver, const QString& ext);
49
 
        void disableCaps(const Jid& jid);
50
 
        bool capsEnabled(const Jid& jid) const;
51
 
        XMPP::Features features(const Jid& jid) const;
52
 
        QString clientName(const Jid& jid) const;
53
 
        QString clientVersion(const Jid& jid) const;
54
 
        
55
 
signals:
56
 
        /**
57
 
         * This signal is emitted when the feature list of a given JID have changed.
58
 
         */
59
 
        void capsChanged(const Jid& jid);
60
 
 
61
 
protected slots:
62
 
        void discoFinished();
63
 
        void capsRegistered(const CapsSpec&);
64
 
 
65
 
protected:
66
 
        void requestDiscoInfo(const Jid& jid, const QString& node);
67
 
        
68
 
private:
69
 
        XMPP::Client* client_;
70
 
        bool isEnabled_;
71
 
        QMap<QString,CapsSpec> capsSpecs_;
72
 
        QMap<CapsSpec,QList<QString> > capsJids_;
73
 
};
74
 
 
75
 
 
76
 
#endif