signon  8.42
signonui_interface.cpp
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: Alberto Mardegan <alberto.mardegan@canonical.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * version 2.1 as published by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA
21  */
22 
23 #include "signonui_interface.h"
24 #include "signond-common.h"
25 
26 #include "SignOn/uisessiondata_priv.h"
27 
28 /*
29  * Implementation of interface class SignonUiAdaptor
30  */
31 SignonUiAdaptor::SignonUiAdaptor(const QString &service,
32  const QString &path,
33  const QDBusConnection &connection,
34  QObject *parent):
35  QDBusAbstractInterface(service, path, staticInterfaceName(),
36  connection, parent)
37 {
38 }
39 
41 {
42 }
43 
44 /*
45  * Open a new dialog
46  * */
47 
48 QDBusPendingCall SignonUiAdaptor::queryDialog(const QVariantMap &parameters)
49 {
50  QList<QVariant> argumentList;
51  argumentList << parameters;
52  return callWithArgumentListAndBigTimeout(QLatin1String("queryDialog"),
53  argumentList);
54 }
55 
56 
57 /*
58  * update the existing dialog
59  * */
60 QDBusPendingCall SignonUiAdaptor::refreshDialog(const QVariantMap &parameters)
61 {
62  QList<QVariant> argumentList;
63  argumentList << parameters;
64  return callWithArgumentListAndBigTimeout(QLatin1String("refreshDialog"),
65  argumentList);
66 }
67 
68 
69 /*
70  * cancel dialog request
71  * */
72 void SignonUiAdaptor::cancelUiRequest(const QString &requestId)
73 {
74  QList<QVariant> argumentList;
75  argumentList << requestId;
76  callWithArgumentList(QDBus::NoBlock, QLatin1String("cancelUiRequest"),
77  argumentList);
78 }
79 
80 QDBusPendingCall
82  const QList<QVariant> &args)
83 {
84  QDBusMessage msg = QDBusMessage::createMethodCall(service(),
85  path(),
86  interface(),
87  method);
88  if (!args.isEmpty())
89  msg.setArguments(args);
90  return connection().asyncCall(msg, SIGNOND_MAX_TIMEOUT);
91 }