2014-06-11 13:37:10 +02:00
|
|
|
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
|
|
|
*
|
|
|
|
* Copyright 2014, Teo Mrnjavac <teo@kde.org>
|
|
|
|
*
|
|
|
|
* Calamares 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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Calamares is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VIEWMANAGER_H
|
|
|
|
#define VIEWMANAGER_H
|
|
|
|
|
2014-06-26 14:41:34 +02:00
|
|
|
#include "UiDllMacro.h"
|
2014-06-11 13:37:10 +02:00
|
|
|
|
2014-07-01 11:49:09 +02:00
|
|
|
#include <QList>
|
2014-06-11 13:37:10 +02:00
|
|
|
#include <QPushButton>
|
|
|
|
#include <QStackedWidget>
|
|
|
|
|
2014-06-27 13:58:53 +02:00
|
|
|
|
2014-06-11 13:37:10 +02:00
|
|
|
namespace Calamares
|
|
|
|
{
|
|
|
|
|
2014-07-01 11:49:09 +02:00
|
|
|
class ViewStep;
|
|
|
|
|
2014-06-11 13:37:10 +02:00
|
|
|
class UIDLLEXPORT ViewManager : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static ViewManager* instance();
|
|
|
|
|
2014-06-27 15:21:16 +02:00
|
|
|
explicit ViewManager( QObject* parent = nullptr );
|
2014-06-11 13:37:10 +02:00
|
|
|
virtual ~ViewManager();
|
|
|
|
|
2014-06-27 18:00:27 +02:00
|
|
|
QWidget* centralWidget();
|
2014-06-11 13:37:10 +02:00
|
|
|
|
2014-06-27 18:00:27 +02:00
|
|
|
void addViewStep( ViewStep* step );
|
2014-06-11 13:37:10 +02:00
|
|
|
|
2014-07-01 17:45:28 +02:00
|
|
|
QList< ViewStep* > steps() const;
|
|
|
|
ViewStep* currentStep() const;
|
|
|
|
int currentStepIndex() const;
|
2014-06-11 13:37:10 +02:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void next();
|
|
|
|
void back();
|
|
|
|
|
2014-07-01 17:45:28 +02:00
|
|
|
signals:
|
|
|
|
void currentStepChanged();
|
|
|
|
|
2014-06-11 13:37:10 +02:00
|
|
|
private:
|
|
|
|
static ViewManager* s_instance;
|
|
|
|
|
2014-07-01 11:49:09 +02:00
|
|
|
QList< ViewStep* > m_steps;
|
2014-06-27 18:00:27 +02:00
|
|
|
int m_currentStep;
|
2014-06-27 13:58:53 +02:00
|
|
|
|
2014-06-11 13:37:10 +02:00
|
|
|
QWidget* m_widget;
|
|
|
|
QStackedWidget* m_stack;
|
|
|
|
QPushButton* m_back;
|
|
|
|
QPushButton* m_next;
|
2014-06-24 15:31:11 +02:00
|
|
|
QPushButton* m_quit;
|
2014-06-11 13:37:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // VIEWMANAGER_H
|