1
by Vsevolod Velichko
Import upstream version 1.1.0 |
1 |
/****************************************************************************
|
2 |
**
|
|
3 |
** Jreen
|
|
4 |
**
|
|
5 |
** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
|
|
6 |
**
|
|
7 |
*****************************************************************************
|
|
8 |
**
|
|
9 |
** $JREEN_BEGIN_LICENSE$
|
|
10 |
** This program is free software: you can redistribute it and/or modify
|
|
11 |
** it under the terms of the GNU General Public License as published by
|
|
12 |
** the Free Software Foundation, either version 2 of the License, or
|
|
13 |
** (at your option) any later version.
|
|
14 |
**
|
|
15 |
** This program is distributed in the hope that it will be useful,
|
|
16 |
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17 |
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
18 |
** See the GNU General Public License for more details.
|
|
19 |
**
|
|
20 |
** You should have received a copy of the GNU General Public License
|
|
21 |
** along with this program. If not, see http://www.gnu.org/licenses/.
|
|
22 |
** $JREEN_END_LICENSE$
|
|
23 |
**
|
|
24 |
****************************************************************************/
|
|
25 |
||
26 |
#ifndef PRIVACYMANAGER_P_H
|
|
27 |
#define PRIVACYMANAGER_P_H
|
|
28 |
||
29 |
#include "privacymanager.h" |
|
30 |
#include "stanzaextension.h" |
|
31 |
#include <QVariant> |
|
32 |
#include <QSet> |
|
33 |
#include <QStringList> |
|
34 |
||
35 |
namespace Jreen |
|
36 |
{
|
|
37 |
class PrivacyItemPrivate : public QSharedData |
|
38 |
{
|
|
39 |
public: |
|
40 |
PrivacyItemPrivate() : |
|
41 |
type(PrivacyItem::All), types(PrivacyItem::AllStanzas), |
|
42 |
action(PrivacyItem::Deny), order(0) {} |
|
43 |
PrivacyItemPrivate(const PrivacyItemPrivate &o) : |
|
44 |
QSharedData(o), type(o.type), types(o.types), |
|
45 |
action(o.action), data(o.data), order(o.order) {} |
|
46 |
PrivacyItem::Type type; |
|
47 |
PrivacyItem::StanzaTypes types; |
|
48 |
PrivacyItem::Action action; |
|
49 |
QVariant data; |
|
50 |
uint order; |
|
51 |
};
|
|
52 |
||
53 |
class PrivacyManagerPrivate |
|
54 |
{
|
|
55 |
public: |
|
56 |
Client *client; |
|
57 |
QString defaultList; |
|
58 |
QString activeList; |
|
59 |
QStringList lists; |
|
60 |
QHash<QString, QString> activeListSetter; |
|
61 |
QHash<QString, QString> defaultListSetter; |
|
62 |
QSet<QString> listRequests; |
|
63 |
QString lastListName; |
|
64 |
QList<PrivacyItem> lastList; |
|
65 |
bool validServer; |
|
66 |
};
|
|
67 |
||
68 |
class PrivacyQuery : public Payload |
|
69 |
{
|
|
70 |
J_PAYLOAD(Jreen::PrivacyQuery) |
|
71 |
public: |
|
72 |
class List |
|
73 |
{
|
|
74 |
public: |
|
75 |
List(const QString &n, const QList<PrivacyItem> &i = QList<PrivacyItem>()) : name(n), items(i) {} |
|
76 |
QString name; |
|
77 |
QList<PrivacyItem> items; |
|
78 |
};
|
|
79 |
||
80 |
QString defaultList; |
|
81 |
QString activeList; |
|
82 |
QList<List> lists; |
|
83 |
};
|
|
84 |
}
|
|
85 |
||
86 |
#endif // PRIVACYMANAGER_P_H |