• Main Page
  • Related Pages
  • Classes
  • Files
  • File List

identityinfo.h

00001 /*
00002  * This file is part of signon
00003  *
00004  * Copyright (C) 2009-2010 Nokia Corporation.
00005  *
00006  * Contact: Aurel Popirtac <ext-aurel.popirtac@nokia.com>
00007  * Contact: Alberto Mardegan <alberto.mardegan@nokia.com>
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public License
00011  * version 2.1 as published by the Free Software Foundation.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00021  * 02110-1301 USA
00022  */
00028 #ifndef IDENTITY_INFO_H
00029 #define IDENTITY_INFO_H
00030 
00031 #include <QStringList>
00032 #include <QMetaType>
00033 
00034 #include "libsignoncommon.h"
00035 
00036 namespace SignOn {
00037 
00042     typedef QString MethodName;
00043 
00048     typedef QStringList MechanismsList;
00049 
00057     class SIGNON_EXPORT IdentityInfo
00058     {
00059         friend class AuthServiceImpl;
00060         friend class IdentityImpl;
00061 
00062     public:
00069         enum CredentialsType {
00070             Other = 0,
00071             Application = 1 << 0,
00072             Web = 1 << 1,
00073             Network = 1 << 2
00074         };
00075 
00076     public:
00080         IdentityInfo();
00081 
00085         IdentityInfo(const IdentityInfo &other);
00086 
00090         IdentityInfo &operator=(const IdentityInfo &other);
00091 
00098         IdentityInfo(const QString &caption, const QString &userName,
00099                      const QMap<MethodName,MechanismsList> &methods);
00100 
00104         ~IdentityInfo();
00105 
00110         quint32 id() const;
00111 
00126         void setSecret(const QString &secret, const bool storeSecret = true);
00127 
00132         bool isStoringSecret() const;
00133 
00138         void setStoreSecret(const bool storeSecret);
00139 
00146         void setUserName(const QString &userName);
00147 
00152         const QString userName() const;
00153 
00158         void setCaption(const QString &caption);
00159 
00164         const QString caption() const;
00165 
00172         void setRealms(const QStringList &realms);
00173 
00180         QStringList realms() const;
00181 
00188         void setOwner(const QString &ownerToken);
00189 
00199         QString owner() const;
00200 
00208         void setAccessControlList(const QStringList &accessControlList);
00209 
00219         QStringList accessControlList() const;
00220 
00229         void setMethod(const MethodName &method, const MechanismsList &mechanismsList);
00230 
00235         void removeMethod(const MethodName &method);
00236 
00246         void setType(CredentialsType type);
00247 
00252         CredentialsType type() const;
00253 
00258         QList<MethodName> methods() const;
00259 
00265         MechanismsList mechanisms(const MethodName &method) const;
00266 
00275         void setRefCount(qint32 refCount);
00276 
00281         qint32 refCount() const;
00282 
00283     private:
00284         void setId(const quint32 id);
00285         const QString secret() const;
00286 
00287     private:
00288         class IdentityInfoImpl *impl;
00289     };
00290 
00291 }  // namespace SignOn
00292 
00293 Q_DECLARE_METATYPE(SignOn::IdentityInfo)
00294 
00295 #endif /* IDENTITY_INFO_H */

Generated on Wed Jul 13 2011 22:08:28 by  doxygen 1.7.1