~ubuntu-branches/ubuntu/vivid/psi/vivid

« back to all changes in this revision

Viewing changes to src/privacy/psiprivacymanager.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
 * 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 PSIPRIVACYMANAGER_H
 
22
#define PSIPRIVACYMANAGER_H
 
23
 
 
24
#include <QObject>
 
25
#include <QStringList>
 
26
 
 
27
#include "privacymanager.h"
 
28
 
 
29
class QString;
 
30
class PrivacyList;
 
31
class PrivacyListListener;
 
32
namespace XMPP {
 
33
        class Task;
 
34
}
 
35
 
 
36
 
 
37
class PsiPrivacyManager : public PrivacyManager
 
38
{
 
39
        Q_OBJECT
 
40
 
 
41
public:
 
42
        PsiPrivacyManager(XMPP::Task* rootTask);
 
43
        virtual ~PsiPrivacyManager();
 
44
 
 
45
        void requestListNames();
 
46
 
 
47
        void changeDefaultList(const QString& name);
 
48
        void changeActiveList(const QString& name);
 
49
        void changeList(const PrivacyList& list);
 
50
        void getDefaultList();
 
51
        void requestList(const QString& name);
 
52
 
 
53
        // Convenience
 
54
        void block(const QString&);
 
55
 
 
56
protected:
 
57
        static QStringList blockedContacts(const PrivacyList&, bool* allBlocked);
 
58
 
 
59
// Can these be private ?
 
60
protected slots:
 
61
        void receiveLists();
 
62
        void receiveList();
 
63
        void changeDefaultList_finished();
 
64
        void changeActiveList_finished();
 
65
        void changeList_finished();
 
66
        void getDefault_listsReceived(const QString&, const QString&, const QStringList&);
 
67
        void getDefault_listsError();
 
68
        void getDefault_listReceived(const PrivacyList&);
 
69
        void getDefault_listError();
 
70
        
 
71
        void block_getDefaultList_success(const PrivacyList&);
 
72
        void block_getDefaultList_error();
 
73
 
 
74
private:
 
75
        XMPP::Task* rootTask_;
 
76
        PrivacyListListener* listener_;
 
77
 
 
78
        bool getDefault_waiting_;
 
79
        QString getDefault_default_;
 
80
 
 
81
        QStringList block_targets_;
 
82
        bool block_waiting_;
 
83
};
 
84
 
 
85
#endif