apm.h 1.19 KB
Newer Older
Lukas Appelhans's avatar
Lukas Appelhans committed
1 2 3 4 5 6 7 8 9
/* 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.
*/
10

Lukas Appelhans's avatar
Lukas Appelhans committed
11 12 13
#ifndef APM_H
#define APM_H

14
#include <akabeibackend.h>
15
#include <akabeienums.h>
16

Lukas Appelhans's avatar
Lukas Appelhans committed
17
#include <QtCore/QObject>
18
#include <QStringList>
Lukas Appelhans's avatar
Lukas Appelhans committed
19

20
class OperationManager : public QObject
Lukas Appelhans's avatar
Lukas Appelhans committed
21
{
Lisa's avatar
Lisa committed
22
Q_OBJECT
Lukas Appelhans's avatar
Lukas Appelhans committed
23
public:
24
    explicit OperationManager(APM::OperationType type, QList< APM::OperationName > operations, QHash<APM::OptionName, QStringList> options, QStringList args, QObject* parent = 0);
25
    virtual ~OperationManager();
26 27 28
    
    /* This is just the static version of the quit() slot below, to be passed as a signal handler to sigaction(3) */
    static void staticQuit(int);
29

Luca Giambonini's avatar
Luca Giambonini committed
30
private Q_SLOTS:
31 32
    void statusChanged(Akabei::Backend::Status);
    void start();
Lisa's avatar
Lisa committed
33
    void showErrors();
34
    void quit();
35

36
private:
37
    APM::OperationType m_type;
38 39 40
    QList<APM::OperationName> m_operations;
    QHash<APM::OptionName, QStringList> m_options;
    QStringList m_args;
Lukas Appelhans's avatar
Lukas Appelhans committed
41 42 43
};

#endif //APM:H