1/****************************************************************************
2**
3** Copyright (C) 2005-2011 Ralf Habacker. All rights reserved.
4**
5** This file is part of the KDE installer for windows
6**
7** This library is free software; you can redistribute it and/or
8** modify it under the terms of the GNU Library General Public
9** License version 2 as published by the Free Software Foundation.
10**
11** This library is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14** Library General Public License for more details.
15**
16** You should have received a copy of the GNU Library General Public License
17** along with this library; see the file COPYING.LIB. If not, write to
18** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19** Boston, MA 02110-1301, USA.
20**
21****************************************************************************/
22
23#ifndef POSTPROCESSING_H
24#define POSTPROCESSING_H
25
26#include <QObject>
27#include <QStringList>
28
29class InstallerEngine;
30
31/**
32 handle postprocessing
33*/
34class PostProcessing : public QObject
35{
36 Q_OBJECT
37public:
38 PostProcessing(InstallerEngine *engine, QObject *parent = 0);
39 void setSingleApplicationMode(const bool mode) { m_singleAppsInstallMode = mode; }
40 /** for single application mode only */
41 void setPackageName(const QString &name) { m_packageName = name; }
42 /** for single application mode only */
43 void setVersion(const QString &version) { m_packageVersion = version; }
44 bool start();
45 void stop();
46
47signals:
48 void numberOfCommands(int count);
49 void commandStarted(int index);
50 void commandStarted(const QString &text);
51 void commandFinished(bool failed);
52 void finished();
53
54public slots:
55
56
57protected:
58 bool runCommand(int index, const QString &msg, const QString &app, const QStringList &params=QStringList());
59 bool checkKWinStartMenuVersion(const QByteArray &required);
60
61 bool m_shouldQuit;
62 bool m_singleAppsInstallMode;
63 QString m_packageName;
64 QString m_packageVersion;
65 InstallerEngine *m_engine;
66};
67
68#endif // POSTPROCESSING_H
69