~ubuntu-branches/ubuntu/quantal/psi/quantal

« back to all changes in this revision

Viewing changes to src/privacymanager.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-04-14 18:57:30 UTC
  • mfrom: (2.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080414185730-528re3zp0m2hdlhi
Tags: 0.11-8
* added CONFIG -= link_prl to .pro files and removed dependencies
  which are made unnecessary by this change
* Fix segfault when closing last chat tab with qt4.4
  (This is from upstream svn, rev. 1101) (Closes: Bug#476122)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * privacymanager.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 PRIVACYMANAGER_H
 
22
#define PRIVACYMANAGER_H
 
23
 
 
24
#include <QObject>
 
25
#include <QStringList>
 
26
 
 
27
class QString;
 
28
class PrivacyList;
 
29
class PrivacyListListener;
 
30
namespace XMPP {
 
31
        class Task;
 
32
}
 
33
 
 
34
 
 
35
class PrivacyManager : public QObject
 
36
{
 
37
        Q_OBJECT
 
38
 
 
39
public:
 
40
        PrivacyManager(XMPP::Task* rootTask);
 
41
        virtual ~PrivacyManager();
 
42
 
 
43
        void requestListNames();
 
44
 
 
45
        void changeDefaultList(const QString& name);
 
46
        void changeActiveList(const QString& name);
 
47
        void changeList(const PrivacyList& list);
 
48
        void getDefaultList();
 
49
        void requestList(const QString& name);
 
50
 
 
51
        // Convenience
 
52
        void block(const QString&);
 
53
 
 
54
protected:
 
55
        static QStringList blockedContacts(const PrivacyList&, bool* allBlocked);
 
56
 
 
57
// Can these be private ?
 
58
protected slots:
 
59
        void receiveLists();
 
60
        void receiveList();
 
61
        void changeDefaultList_finished();
 
62
        void changeActiveList_finished();
 
63
        void changeList_finished();
 
64
        void getDefault_listsReceived(const QString&, const QString&, const QStringList&);
 
65
        void getDefault_listsError();
 
66
        void getDefault_listReceived(const PrivacyList&);
 
67
        void getDefault_listError();
 
68
        
 
69
        void block_getDefaultList_success(const PrivacyList&);
 
70
        void block_getDefaultList_error();
 
71
 
 
72
signals:
 
73
        void changeDefaultList_success();
 
74
        void changeDefaultList_error();
 
75
        void changeActiveList_success();
 
76
        void changeActiveList_error();
 
77
        void changeList_success();
 
78
        void changeList_error();
 
79
        void defaultListAvailable(const PrivacyList&);
 
80
        void defaultListError();
 
81
        void listChangeSuccess();
 
82
        void listChangeError();
 
83
        void listReceived(const PrivacyList& p);
 
84
        void listError();
 
85
        void listsReceived(const QString& defaultList, const QString& activeList, const QStringList& lists);
 
86
        void listsError();
 
87
 
 
88
private:
 
89
        XMPP::Task* rootTask_;
 
90
        PrivacyListListener* listener_;
 
91
 
 
92
        bool getDefault_waiting_;
 
93
        QString getDefault_default_;
 
94
 
 
95
        QStringList block_targets_;
 
96
        bool block_waiting_;
 
97
};
 
98
 
 
99
#endif