File indexing completed on 2022-09-20 16:18:05

0001 /***************************************************************************
0002  *   Copyright (C) 2008-2011 Daniel Nicoletti <dantti12@gmail.com>         *
0003  *                                                                         *
0004  *   This program is free software; you can redistribute it and/or modify  *
0005  *   it under the terms of the GNU General Public License as published by  *
0006  *   the Free Software Foundation; either version 2 of the License, or     *
0007  *   (at your option) any later version.                                   *
0008  *                                                                         *
0009  *   This program is distributed in the hope that it will be useful,       *
0010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0012  *   GNU General Public License for more details.                          *
0013  *                                                                         *
0014  *   You should have received a copy of the GNU General Public License     *
0015  *   along with this program; if not, write to the                         *
0016  *   Free Software Foundation, Inc.,                                       *
0017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
0018  ***************************************************************************/
0019 
0020 #ifndef DBUS_INTERFACE_H
0021 #define DBUS_INTERFACE_H
0022 
0023 #include <QtDBus/QDBusContext>
0024 #include <QDBusObjectPath>
0025 
0026 #include <config.h>
0027 
0028 #ifdef HAVE_DEBCONFKDE
0029 #include <DebconfGui.h>
0030 using namespace DebconfKde;
0031 #endif //HAVE_DEBCONFKDE
0032 
0033 class DBusInterface : public QObject, protected QDBusContext
0034 {
0035     Q_OBJECT
0036     Q_CLASSINFO("D-Bus Interface", "org.kde.apperd")
0037 public:
0038     explicit DBusInterface(QObject *parent = nullptr);
0039     ~DBusInterface() override;
0040 
0041     void RefreshCache();
0042     void SetupDebconfDialog(const QString &tid, const QString &socketPath, uint xidParent);
0043     void WatchTransaction(const QDBusObjectPath &tid);
0044 
0045 Q_SIGNALS:
0046     void refreshCache();
0047     void watchTransaction(const QDBusObjectPath &tid);
0048 
0049 private Q_SLOTS:
0050     void debconfActivate();
0051     void transactionFinished();
0052 
0053 #ifdef HAVE_DEBCONFKDE
0054 private:
0055     QHash<QString, DebconfGui*> m_debconfGuis;
0056 #endif
0057 };
0058 
0059 
0060 #endif