File indexing completed on 2022-09-27 16:24:39

0001 /***************************************************************************
0002  *   Copyright (C) 2008-2011 by Daniel Nicoletti                           *
0003  *   dantti12@gmail.com                                                    *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  *                                                                         *
0010  *   This program is distributed in the hope that it will be useful,       *
0011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0013  *   GNU General Public License for more details.                          *
0014  *                                                                         *
0015  *   You should have received a copy of the GNU General Public License     *
0016  *   along with this program; see the file COPYING. If not, write to       *
0017  *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  *
0018  *   Boston, MA 02110-1301, USA.                                           *
0019  ***************************************************************************/
0020 
0021 #ifndef PK_INTERFACE_H
0022 #define PK_INTERFACE_H
0023 
0024 #include <QtDBus/QDBusContext>
0025 
0026 #include "AbstractIsRunning.h"
0027 
0028 class SessionTask;
0029 class PkInterface : public AbstractIsRunning, protected QDBusContext
0030 {
0031     Q_OBJECT
0032     Q_CLASSINFO("D-Bus Interface", "org.freedesktop.PackageKit")
0033 public:
0034     explicit PkInterface(QObject *parent = nullptr);
0035     ~PkInterface() override;
0036 
0037 public Q_SLOTS:
0038     void InstallCatalogs(uint xid, const QStringList &files, const QString &interaction);
0039     void InstallFontconfigResources(uint xid, const QStringList &resources, const QString &interaction);
0040     void InstallGStreamerResources(uint xid, const QStringList &resources, const QString &interaction);
0041     void InstallMimeTypes(uint xid, const QStringList &mime_types, const QString &interaction);
0042     void InstallPackageFiles(uint xid, const QStringList &files, const QString &interaction);
0043     void InstallPackageNames(uint xid, const QStringList &packages, const QString &interaction);
0044     void InstallPrinterDrivers(uint xid, const QStringList &resources, const QString &interaction);
0045     void InstallProvideFiles(uint xid, const QStringList &files, const QString &interaction);
0046     void InstallResources(uint xid, const QString &type, const QStringList &resources, const QString &interaction);
0047     void RemovePackageByFiles(uint xid, const QStringList &files, const QString &interaction);
0048 //Query
0049     bool IsInstalled(const QString &package_name, const QString &interaction);
0050     bool SearchFile(const QString &file_name, const QString &interaction, QString &package_name);
0051 
0052 private:
0053     void show(SessionTask *widget);
0054 //    QVariantHash parseInteraction(const QString &interaction);
0055     void InstallPlasmaResources(uint xid, const QStringList &resources, const QString &interaction);
0056 };
0057 
0058 
0059 #endif