queryoperation.h 1.79 KB
Newer Older
Lukas Appelhans's avatar
Lukas Appelhans committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/* 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 QUERYOPERATION_H
#define QUERYOPERATION_H

#include <QObject>
#include <QUuid>

17
#include <apm.h>
Lukas Appelhans's avatar
Lukas Appelhans committed
18
#include <akabeipackage.h>
19
#include <akabeigroup.h>
Lukas Appelhans's avatar
Lukas Appelhans committed
20 21 22

class QueryOperation : public QObject
{
Lisa's avatar
Lisa committed
23
Q_OBJECT
Lukas Appelhans's avatar
Lukas Appelhans committed
24
public:
25
    explicit QueryOperation(QList<APM::OperationName> operations, QHash<APM::OptionName, QStringList> options, QStringList args, QObject * parent = 0);
Lukas Appelhans's avatar
Lukas Appelhans committed
26
    virtual ~QueryOperation();
27

Lisa's avatar
Lisa committed
28
    void start();
29

Lisa's avatar
Lisa committed
30 31
private:
    QList<APM::OperationName> m_operations;
32
    QHash<APM::OptionName, QStringList> m_options;
Lisa's avatar
Lisa committed
33
    QStringList m_args;
Lisa's avatar
Lisa committed
34 35
    
    QUuid queryId;
36

Lisa's avatar
Lisa committed
37
    void nextOperation();
38

39 40 41 42
    /*
     * Checks if the given package has been marked to be ignored using the Ignore or IgnoreGroup options
     */
    bool isIgnored(Akabei::Package *);
43

44
private:
45
    void showInformation(Akabei::Package::List packages);
46
    void showGroup(const QString& groupName, Akabei::Group::List groups);
47
    void showChangelog(Akabei::Package::List packages);
Lukas Appelhans's avatar
Lukas Appelhans committed
48
    void showLog(Akabei::Package::List packages);
49
    void showInstalledAs(Akabei::Package::List);
50
    void checkFiles(Akabei::Package::List);
51
    void showOwner(const QStringList &queries);
52
    void showLocalQuery(Akabei::Package::List);
Lukas Appelhans's avatar
Lukas Appelhans committed
53
    void showUpgradeable();
54
    void printFiles(Akabei::Package::List packages);
Lisa's avatar
Lisa committed
55
    
Luca Giambonini's avatar
Luca Giambonini committed
56
private Q_SLOTS:
Lisa's avatar
Lisa committed
57
    void showNotRequired(QUuid, QList<Akabei::Package*>);
58
    void listGroups(QUuid, QList<Akabei::Group*>);
59

Luca Giambonini's avatar
Luca Giambonini committed
60
Q_SIGNALS:
61
    void queryFinished();
Lukas Appelhans's avatar
Lukas Appelhans committed
62 63 64
};

#endif // QUERYOPERATION_H