signon 8.54

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

signonidentityinfo.h
Go to the documentation of this file.
1 /*
2 * This file is part of signon
3 *
4 * Copyright (C) 2009-2010 Nokia Corporation.
5 *
6 * Contact: Aurel Popirtac <ext-aurel.popirtac@nokia.com>
7 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * version 2.1 as published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 */
23 #ifndef SIGNONIDENTITYINFO_H
24 #define SIGNONIDENTITYINFO_H
25
26 #include <QMap>
27 #include <QStringList>
28 #include <QVariant>
29
30 #include "signond/signoncommon.h"
31
32 namespace SignonDaemonNS {
33
34 typedef QString MethodName;
35 typedef QStringList MechanismsList;
36 typedef QMap<MethodName, MechanismsList> MethodMap;
37
43 struct SignonIdentityInfo
44 {
45 SignonIdentityInfo();
46 SignonIdentityInfo(const QVariantMap &info);
47 SignonIdentityInfo(const quint32 id,
48 const QString &userName,
49 const QString &password,
50 const bool storePassword,
51 const QString &caption,
52 const MethodMap &methods,
53 const QStringList &realms = QStringList(),
54 const QStringList &accessControlList = QStringList(),
55 const QStringList &ownerList = QStringList(),
56 int type = 0,
57 int refCount = 0,
58 bool validated = false);
59
60 const QVariantMap toMap() const;
61
62 bool operator== (const SignonIdentityInfo &other) const;
63 SignonIdentityInfo &operator=(const SignonIdentityInfo &other);
64
65 void setNew() { m_id = SIGNOND_NEW_IDENTITY; }
66 bool isNew() const { return m_id == SIGNOND_NEW_IDENTITY; }
67 void setId(quint32 id) { m_id = id; }
68 quint32 id() const { return m_id; }
69
70 void setUserName(const QString &userName) { m_userName = userName; }
71 QString userName() const { return m_userName; }
72 void setUserNameSecret(bool secret) { m_isUserNameSecret = secret; }
73 bool isUserNameSecret() const { return m_isUserNameSecret; }
74
75 void setPassword(const QString &password) { m_password = password; }
76 QString password() const { return m_password; }
77 void setStorePassword(bool storePassword) {
78 m_storePassword = storePassword;
79 }
80 bool storePassword() const { return m_storePassword; }
81
82 void setCaption(const QString &caption) { m_caption = caption; }
83 QString caption() const { return m_caption; }
84
85 void setRealms(const QStringList &realms) { m_realms = realms; }
86 QStringList realms() const { return m_realms; }
87
88 void setMethods(const MethodMap &methods)
89 { m_methods = methods; }
90 MethodMap methods() const { return m_methods; }
91
92 void setAccessControlList(const QStringList &acl)
93 { m_accessControlList = acl; }
94 QStringList accessControlList() const { return m_accessControlList; }
95
96 void setValidated(bool validated) { m_validated = validated; }
97 bool validated() const { return m_validated; }
98
99 void setType(const int type) { m_type = type; }
100 int type() const { return m_type; }
101
102 void setOwnerList(const QStringList &owner) { m_ownerList = owner; }
103 QStringList ownerList() const { return m_ownerList; }
104
105 bool checkMethodAndMechanism(const QString &method,
106 const QString &mechanism,
107 QString &allowedMechanism);
108
109 private:
110 quint32 m_id;
111 QString m_userName;
112 QString m_password;
113 bool m_storePassword;
114 QString m_caption;
115 MethodMap m_methods;
116 QStringList m_realms;
117 QStringList m_accessControlList;
118 QStringList m_ownerList;
119 int m_type;
120 int m_refCount;
121 bool m_validated;
122 bool m_isUserNameSecret;
123 }; //struct SignonIdentityInfo
124
125 } //namespace SignonDaemonNS
126
127 Q_DECLARE_METATYPE(SignonDaemonNS::MethodMap)
128
129 #endif // SIGNONIDENTITYINFO_H
SignonDaemonNS::SignonIdentityInfo::isUserNameSecret
bool isUserNameSecret() const
Definition: signonidentityinfo.h:73
SignonDaemonNS::MechanismsList
QStringList MechanismsList
Definition: signonidentityinfo.h:35
SignonDaemonNS::SignonIdentityInfo::setRealms
void setRealms(const QStringList &realms)
Definition: signonidentityinfo.h:85
SignonDaemonNS::SignonIdentityInfo::setNew
void setNew()
Definition: signonidentityinfo.h:65
SignonDaemonNS::SignonIdentityInfo::accessControlList
QStringList accessControlList() const
Definition: signonidentityinfo.h:94
SignonDaemonNS::SignonIdentityInfo::setId
void setId(quint32 id)
Definition: signonidentityinfo.h:67
SignonDaemonNS::SignonIdentityInfo::storePassword
bool storePassword() const
Definition: signonidentityinfo.h:80
SignonDaemonNS::SignonIdentityInfo::caption
QString caption() const
Definition: signonidentityinfo.h:83
SignonDaemonNS::SignonIdentityInfo::setStorePassword
void setStorePassword(bool storePassword)
Definition: signonidentityinfo.h:77
SignonDaemonNS::SignonIdentityInfo::setMethods
void setMethods(const MethodMap &methods)
Definition: signonidentityinfo.h:88
SignonDaemonNS::SignonIdentityInfo::password
QString password() const
Definition: signonidentityinfo.h:76
SignonDaemonNS::SignonIdentityInfo::id
quint32 id() const
Definition: signonidentityinfo.h:68
SignonDaemonNS::SignonIdentityInfo::setType
void setType(const int type)
Definition: signonidentityinfo.h:99
SignonDaemonNS::SignonIdentityInfo::realms
QStringList realms() const
Definition: signonidentityinfo.h:86
SignonDaemonNS::SignonIdentityInfo::type
int type() const
Definition: signonidentityinfo.h:100
SignonDaemonNS::SignonIdentityInfo::setCaption
void setCaption(const QString &caption)
Definition: signonidentityinfo.h:82
SignonDaemonNS::SignonIdentityInfo::setOwnerList
void setOwnerList(const QStringList &owner)
Definition: signonidentityinfo.h:102
SignonDaemonNS::SignonIdentityInfo::checkMethodAndMechanism
bool checkMethodAndMechanism(const QString &method, const QString &mechanism, QString &allowedMechanism)
Definition: signonidentityinfo.cpp:156
SignonDaemonNS::SignonIdentityInfo::ownerList
QStringList ownerList() const
Definition: signonidentityinfo.h:103
SignonDaemonNS::SignonIdentityInfo::userName
QString userName() const
Definition: signonidentityinfo.h:71
SignonDaemonNS::SignonIdentityInfo::SignonIdentityInfo
SignonIdentityInfo()
Definition: signonidentityinfo.cpp:31
SignonDaemonNS::SignonIdentityInfo::setPassword
void setPassword(const QString &password)
Definition: signonidentityinfo.h:75
SignonDaemonNS::SignonIdentityInfo::setAccessControlList
void setAccessControlList(const QStringList &acl)
Definition: signonidentityinfo.h:92
SignonDaemonNS::MethodName
QString MethodName
Definition: signonidentityinfo.h:34
SignonDaemonNS::SignonIdentityInfo::methods
MethodMap methods() const
Definition: signonidentityinfo.h:90
SignonDaemonNS::MethodMap
QMap< MethodName, MechanismsList > MethodMap
Definition: signonidentityinfo.h:36
SignonDaemonNS::SignonIdentityInfo::isNew
bool isNew() const
Definition: signonidentityinfo.h:66
SignonDaemonNS::SignonIdentityInfo
Daemon side representation of identity information.
Definition: signonidentityinfo.h:43
SignonDaemonNS::SignonIdentityInfo::operator=
SignonIdentityInfo & operator=(const SignonIdentityInfo &other)
Definition: signonidentityinfo.cpp:203
SignonDaemonNS::SignonIdentityInfo::validated
bool validated() const
Definition: signonidentityinfo.h:97
SignonDaemonNS::SignonIdentityInfo::setUserName
void setUserName(const QString &userName)
Definition: signonidentityinfo.h:70
SignonDaemonNS::SignonIdentityInfo::operator==
bool operator==(const SignonIdentityInfo &other) const
Definition: signonidentityinfo.cpp:127
SignonDaemonNS::SignonIdentityInfo::toMap
const QVariantMap toMap() const
Definition: signonidentityinfo.cpp:107
QMap< MethodName, MechanismsList >
SignonDaemonNS::SignonIdentityInfo::setUserNameSecret
void setUserNameSecret(bool secret)
Definition: signonidentityinfo.h:72
SignonDaemonNS::SignonIdentityInfo::setValidated
void setValidated(bool validated)
Definition: signonidentityinfo.h:96