#ifndef PULSEVIEW_PV_PROP_PROPERTY_H
#define PULSEVIEW_PV_PROP_PROPERTY_H
+#include <glib.h>
+
+#include <boost/function.hpp>
+
#include <QString>
#include <QWidget>
namespace pv {
namespace prop {
-class Property
+class Property : public QObject
{
+ Q_OBJECT;
+
+public:
+ typedef boost::function<GVariant* ()> Getter;
+ typedef boost::function<void (GVariant*)> Setter;
+
protected:
- Property(QString name);
+ Property(QString name, Getter getter, Setter setter);
public:
const QString& name() const;
- virtual QWidget* get_widget(QWidget *parent) = 0;
+ virtual QWidget* get_widget(QWidget *parent,
+ bool auto_commit = false) = 0;
+ virtual bool labeled_widget() const;
+
+ virtual void commit() = 0;
+
+protected:
+ const Getter _getter;
+ const Setter _setter;
private:
QString _name;