apm.h 1.48 KB
Newer Older
Lukas Appelhans's avatar
Lukas Appelhans committed
1 2 3 4 5 6 7 8 9 10 11 12
/* This file is part of the Chakra project

   Copyright (C) 2011 Lukas Appelhans <l.appelhans@gmx.de>

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
*/
#ifndef APM_H
#define APM_H

13 14
#include <akabeibackend.h>

Lukas Appelhans's avatar
Lukas Appelhans committed
15
#include <QtCore/QObject>
16
#include <QStringList>
Lukas Appelhans's avatar
Lukas Appelhans committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

class APM : public QObject
{
Q_OBJECT
public:
    enum OperationType {
        NoType = 0,
        DatabaseOperation = 1,
        QueryOperation = 2,
        RemoveOperation = 3,
        SyncOperation = 4,
        UpgradeOperation = 5
    };
    enum Operation {
        NoOperation = 0,
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
        ///Query operations
        ShowChangelog,
        ShowInstalledAsDeps,
        ShowInstalledExplicitely,
        ShowPackagesOfGroup,
        ShowInformation,
        CheckFiles,
        ShowLocal,
        ShowOwner,
        QueryPackageFile,
        SearchLocal,
        ShowNotRequired,
        ShowUpgradeable,
        ShowLess,
        ///Sync operations
        UpdateDatabases,
        UpdateSystem
Lukas Appelhans's avatar
Lukas Appelhans committed
49
    };
50
    explicit APM(OperationType type, QList<Operation> operations, QStringList args, QObject* parent = 0);
Lukas Appelhans's avatar
Lukas Appelhans committed
51 52
    virtual ~APM();
    
53 54 55 56
private slots:
    void statusChanged(Akabei::Backend::Status);
    void start();
    
57 58 59 60
private:
    OperationType m_operationType;
    QList<Operation> m_operations;
    QStringList m_args;
Lukas Appelhans's avatar
Lukas Appelhans committed
61 62 63
};

#endif //APM:H