signon  8.42
signondaemonadaptor.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  * Copyright (C) 2012 Canonical Ltd.
6  *
7  * Contact: Aurel Popirtac <ext-aurel.popirtac@nokia.com>
8  * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public License
12  * version 2.1 as published by the Free Software Foundation.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22  * 02110-1301 USA
23  */
24 
25 #ifndef SIGNONDAEMONADAPTER_H_
26 #define SIGNONDAEMONADAPTER_H_
27 
28 #include <QtCore>
29 #include <QtDBus>
30 
31 #include "signond-common.h"
32 #include "signondaemon.h"
33 
34 
35 namespace SignonDaemonNS {
36 
37 typedef QList<QVariantMap> MapList;
38 
39 class SignonDaemonAdaptor: public QDBusAbstractAdaptor
40 {
41  Q_OBJECT
42  Q_CLASSINFO("D-Bus Interface",
43  "com.google.code.AccountsSSO.SingleSignOn.AuthService")
44 
45 public:
47  virtual ~SignonDaemonAdaptor();
48 
49  inline const QDBusContext &parentDBusContext() const
50  { return *static_cast<QDBusContext *>(m_parent); }
51 
52 public Q_SLOTS:
53  void registerNewIdentity(QDBusObjectPath &objectPath);
54  void getIdentity(const quint32 id, QDBusObjectPath &objectPath,
55  QVariantMap &identityData);
56  QString getAuthSessionObjectPath(const quint32 id, const QString &type);
57 
58  QStringList queryMethods();
59  QStringList queryMechanisms(const QString &method);
60  void queryIdentities(const QVariantMap &filter);
61  bool clear();
62 
63 private:
64  void securityErrorReply(const char *failedMethodName);
65 
66 private:
67  SignonDaemon *m_parent;
68 }; //class SignonDaemonAdaptor
69 
70 } //namespace SignonDaemonNS
71 
72 Q_DECLARE_METATYPE(SignonDaemonNS::MapList)
73 
74 #endif /* SIGNONDAEMONADAPTER_H_ */