2013-05-08 01:36:34 +00:00
|
|
|
#ifndef GROUPBLOCK_HPP
|
|
|
|
#define GROUPBLOCK_HPP
|
|
|
|
|
|
|
|
#include <QList>
|
|
|
|
#include "abstractblock.hpp"
|
|
|
|
|
2013-05-11 10:55:46 +00:00
|
|
|
namespace CSVSettings
|
2013-05-08 01:36:34 +00:00
|
|
|
{
|
|
|
|
class ItemBlock;
|
|
|
|
|
2013-06-20 23:06:25 +00:00
|
|
|
/// Base class for group blocks.
|
|
|
|
/// Derived block classes should use CustomBlock
|
2013-05-08 01:36:34 +00:00
|
|
|
class GroupBlock : public AbstractBlock
|
|
|
|
{
|
|
|
|
ItemBlockList mItemBlockList;
|
|
|
|
|
|
|
|
public:
|
|
|
|
GroupBlock (QWidget* parent = 0);
|
|
|
|
GroupBlock (bool isVisible, QWidget *parent = 0);
|
|
|
|
|
2013-06-20 23:06:25 +00:00
|
|
|
/// build the gorup block based on passed definition
|
2013-06-15 11:40:18 +00:00
|
|
|
int build (GroupBlockDef *def);
|
2013-05-08 01:36:34 +00:00
|
|
|
|
2013-06-20 23:06:25 +00:00
|
|
|
/// update settings local to the group block
|
2013-05-11 10:55:46 +00:00
|
|
|
bool updateSettings (const CSMSettings::SettingMap &settings);
|
2013-05-08 01:36:34 +00:00
|
|
|
|
2013-06-20 23:06:25 +00:00
|
|
|
/// retrieve setting list local to the group block
|
2013-05-11 10:55:46 +00:00
|
|
|
CSMSettings::SettingList *getSettings();
|
2013-06-20 23:06:25 +00:00
|
|
|
|
|
|
|
/// retrieve item block by name from the passed list or local list
|
2013-05-08 01:36:34 +00:00
|
|
|
ItemBlock *getItemBlock (const QString &name, ItemBlockList *blockList = 0);
|
2013-06-20 23:06:25 +00:00
|
|
|
|
|
|
|
/// retrieve the item block by index from the local list
|
2013-05-08 01:36:34 +00:00
|
|
|
ItemBlock *getItemBlock (int index);
|
|
|
|
|
|
|
|
protected:
|
2013-06-20 23:06:25 +00:00
|
|
|
|
|
|
|
/// create block layout based on passed definition
|
2013-05-08 01:36:34 +00:00
|
|
|
int buildLayout (GroupBlockDef &def);
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif // GROUPBLOCK_HPP
|