signon  8.58
signonidentityadaptor.h
Go to the documentation of this file.
00001 /*
00002  * This file is part of signon
00003  *
00004  * Copyright (C) 2009-2010 Nokia Corporation.
00005  * Copyright (C) 2012 Canonical Ltd.
00006  *
00007  * Contact: Aurel Popirtac <ext-aurel.popirtac@nokia.com>
00008  * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public License
00012  * version 2.1 as published by the Free Software Foundation.
00013  *
00014  * This library is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00022  * 02110-1301 USA
00023  */
00024 
00025 #ifndef SIGNONIDENTITYADAPTOR_H
00026 #define SIGNONIDENTITYADAPTOR_H
00027 
00028 #include <QDBusAbstractAdaptor>
00029 #include <QDBusContext>
00030 
00031 #include "signond-common.h"
00032 #include "signonidentity.h"
00033 
00034 namespace SignonDaemonNS {
00035 
00036 class SignonIdentityAdaptor : public QDBusAbstractAdaptor
00037 {
00038     Q_OBJECT
00039     Q_CLASSINFO("D-Bus Interface",
00040                 "com.google.code.AccountsSSO.SingleSignOn.Identity")
00041 
00042 public:
00043     SignonIdentityAdaptor(SignonIdentity *parent);
00044     virtual ~SignonIdentityAdaptor();
00045 
00046     inline const QDBusContext &parentDBusContext() const
00047         { return *static_cast<QDBusContext *>(m_parent); }
00048 
00049 public Q_SLOTS:
00050     quint32 requestCredentialsUpdate(const QString &message);
00051     QVariantMap getInfo();
00052     void addReference(const QString &reference);
00053     void removeReference(const QString &reference);
00054 
00055     bool verifyUser(const QVariantMap &params);
00056     bool verifySecret(const QString &secret);
00057     void remove();
00058     bool signOut();
00059     quint32 store(const QVariantMap &info);
00060 
00061 Q_SIGNALS:
00062     void unregistered();
00063     void infoUpdated(int);
00064 
00065 private:
00066     void securityErrorReply(const char *failedMethodName);
00067     void errorReply(const QString &name, const QString &message);
00068 
00069 private:
00070     SignonIdentity *m_parent;
00071 };
00072 
00073 } //namespace SignonDaemonNS
00074 
00075 #endif // SIGNONIDENTITYADAPTOR_H