2013-05-08 01:36:34 +00:00
|
|
|
#ifndef ABSTRACTPAGE_HPP
|
|
|
|
#define ABSTRACTPAGE_HPP
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QList>
|
|
|
|
#include <QLayout>
|
|
|
|
|
|
|
|
#include "abstractblock.hpp"
|
|
|
|
|
|
|
|
class SettingMap;
|
|
|
|
class SettingList;
|
|
|
|
|
2013-05-11 10:55:46 +00:00
|
|
|
namespace CSVSettings {
|
2013-05-08 01:36:34 +00:00
|
|
|
|
|
|
|
typedef QList<AbstractBlock *> AbstractBlockList;
|
|
|
|
|
|
|
|
class AbstractPage: public QWidget
|
|
|
|
{
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
AbstractBlockList mAbstractBlocks;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
AbstractPage(QWidget *parent = 0);
|
|
|
|
AbstractPage (const QString &pageName, QWidget* parent = 0);
|
|
|
|
|
|
|
|
~AbstractPage();
|
|
|
|
|
|
|
|
virtual void setupUi()=0;
|
|
|
|
|
2013-05-11 10:55:46 +00:00
|
|
|
virtual void initializeWidgets (const CSMSettings::SettingMap &settings) = 0;
|
2013-05-08 01:36:34 +00:00
|
|
|
|
2013-05-11 10:55:46 +00:00
|
|
|
CSMSettings::SettingList *getSettings();
|
2013-05-08 01:36:34 +00:00
|
|
|
|
|
|
|
void setObjectName();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
template <typename S, typename T>
|
|
|
|
AbstractBlock *buildBlock (T &def)
|
|
|
|
{
|
|
|
|
S *block = new S (this);
|
|
|
|
int ret = block->build (def);
|
|
|
|
|
|
|
|
if (ret < 0)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
QWidget::layout()->addWidget (block->getGroupBox());
|
|
|
|
|
|
|
|
return block;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // ABSTRACTPAGE_HPP
|