Skip to content
Snippets Groups Projects
package.h 1.19 KiB
Newer Older
  • Learn to ignore specific revisions
  • akiraohgaki's avatar
    akiraohgaki committed
    /**
     * A library for Qt app
     *
     * LICENSE: The GNU Lesser General Public License, version 3.0
     *
     * @author      Akira Ohgaki <akiraohgaki@gmail.com>
     * @copyright   Akira Ohgaki
     * @license     https://opensource.org/licenses/LGPL-3.0  The GNU Lesser General Public License, version 3.0
     * @link        https://github.com/akiraohgaki/qtlibs
     */
    
    #pragma once
    
    #include <QObject>
    
    namespace qtlibs {
    
    class Package : public QObject
    {
        Q_OBJECT
    
    public:
    
    akiraohgaki's avatar
    akiraohgaki committed
        explicit Package(const QString &path = "", QObject *parent = 0);
    
    akiraohgaki's avatar
    akiraohgaki committed
    
    
    akiraohgaki's avatar
    akiraohgaki committed
        Package(const Package &other, QObject *parent = 0);
    
    akiraohgaki's avatar
    akiraohgaki committed
        Package &operator =(const Package &other);
    
    akiraohgaki's avatar
    akiraohgaki committed
    
        QString path() const;
        void setPath(const QString &path);
    
    #ifdef QTLIBS_UNIX
        bool installAsProgram(const QString &newPath);
        bool installAsFile(const QString &newPath);
        bool installAsArchive(const QString &destinationDirPath);
        bool installAsPlasmapkg(const QString &type = "plasmoid");
        bool uninstallAsPlasmapkg(const QString &type = "plasmoid");
    #endif
    
    #ifdef Q_OS_ANDROID
        bool installAsApk();
    #endif
    
    private:
    #ifdef QTLIBS_UNIX
        bool execute(const QString &program, const QStringList &arguments);
    #endif
    
        QString path_;
    };
    
    } // namespace qtlibs