1/* This file is part of the KDE Project
2 Copyright (c) 2005 Jean-Remy Falleri <jr.falleri@laposte.net>
3 Copyright (c) 2005-2007 Kevin Ottens <ervin@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef SOLIDUISERVER_H
21#define SOLIDUISERVER_H
22
23#include <kdedmodule.h>
24#include <kfileitem.h>
25#include <kio/job.h>
26
27
28#include <QMap>
29
30//solid specific includes
31#include <solid/devicenotifier.h>
32#include <solid/device.h>
33#include <solid/deviceinterface.h>
34#include <solid/predicate.h>
35
36class DeviceActionsDialog;
37class KPasswordDialog;
38
39class SolidUiServer : public KDEDModule
40{
41 Q_OBJECT
42 Q_CLASSINFO("D-Bus Interface", "org.kde.SolidUiServer")
43
44public:
45 SolidUiServer(QObject* parent, const QList<QVariant>&);
46 virtual ~SolidUiServer();
47
48public Q_SLOTS:
49 Q_SCRIPTABLE void showActionsDialog(const QString &udi,
50 const QStringList &desktopFiles);
51
52 Q_SCRIPTABLE void showPassphraseDialog(const QString &udi,
53 const QString &returnService, const QString &returnObject,
54 uint wId, const QString &appId);
55
56
57private Q_SLOTS:
58 void onActionDialogFinished();
59 void onPassphraseDialogCompleted(const QString &pass, bool keep);
60 void onPassphraseDialogRejected();
61
62private:
63 void reparentDialog(QWidget *dialog, WId wId, const QString &appId, bool modal);
64
65 QMap<QString, DeviceActionsDialog*> m_udiToActionsDialog;
66 QMap<QString, KPasswordDialog*> m_idToPassphraseDialog;
67
68#if 0
69private Q_SLOTS:
70 void slotStatResult(KJob *job);
71
72private:
73 bool autostart(const KFileItem &medium);
74
75 bool execAutorun(const KFileItem &medium, const QString &path,
76 const QString &autorunFile);
77 bool execAutoopen(const KFileItem &medium, const QString &path,
78 const QString &autoopenFile);
79
80 QMap<KJob*,bool> m_allowNotificationMap;
81#endif
82};
83#endif
84