2013-05-08 01:36:34 +00:00
|
|
|
#ifndef ITEMBLOCK_HPP
|
|
|
|
#define ITEMBLOCK_HPP
|
|
|
|
|
|
|
|
#include "abstractblock.hpp"
|
|
|
|
|
2013-05-11 10:55:46 +00:00
|
|
|
namespace CSVSettings
|
2013-05-08 01:36:34 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
class ItemBlock : public AbstractBlock
|
|
|
|
{
|
2013-05-11 10:55:46 +00:00
|
|
|
CSMSettings::SettingsItem *mSetting;
|
2013-05-08 01:36:34 +00:00
|
|
|
WidgetList mWidgetList;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
ItemBlock (QWidget* parent = 0);
|
|
|
|
|
2013-07-18 01:19:01 +00:00
|
|
|
/// pure virtual function not implemented
|
2013-05-11 10:55:46 +00:00
|
|
|
bool updateSettings (const CSMSettings::SettingMap &settings) { return false; }
|
2013-05-08 01:36:34 +00:00
|
|
|
|
2013-05-11 10:55:46 +00:00
|
|
|
CSMSettings::SettingList *getSettings ();
|
2013-06-20 23:06:25 +00:00
|
|
|
|
2013-05-08 01:36:34 +00:00
|
|
|
QString getValue () const;
|
|
|
|
|
2013-06-20 23:06:25 +00:00
|
|
|
/// item blocks encapsulate only one setting
|
2013-05-08 01:36:34 +00:00
|
|
|
int getSettingCount();
|
2013-06-20 23:06:25 +00:00
|
|
|
|
|
|
|
/// update setting value and corresponding widget
|
2013-05-08 01:36:34 +00:00
|
|
|
bool update (const QString &value);
|
|
|
|
|
2013-06-20 23:06:25 +00:00
|
|
|
/// virtual construction function
|
2013-05-08 01:36:34 +00:00
|
|
|
int build(SettingsItemDef &iDef);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2013-06-20 23:06:25 +00:00
|
|
|
/// custom construction function
|
2013-05-08 01:36:34 +00:00
|
|
|
void buildItemBlock (SettingsItemDef& iDef);
|
|
|
|
void buildItemBlockWidgets (SettingsItemDef& iDef);
|
2013-06-20 23:06:25 +00:00
|
|
|
|
|
|
|
/// update the setting value
|
2013-05-08 01:36:34 +00:00
|
|
|
bool updateItem (const QString &);
|
|
|
|
|
2013-06-20 23:06:25 +00:00
|
|
|
/// callback function triggered when update to application level is signalled
|
2013-05-08 01:36:34 +00:00
|
|
|
bool updateBySignal (const QString &name, const QString &value, bool &doEmit);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // ITEMBLOCK_HPP
|