]> sigrok.org Git - pulseview.git/blobdiff - pv/prop/binding/decoderoptions.h
Make member variable underscores a suffix instead of a prefix
[pulseview.git] / pv / prop / binding / decoderoptions.h
index 8217b4791e19c6f9a3b98b4f71df8f5118634f5a..7f14d0fd4448b3a328c93964fc668564aec100e5 100644 (file)
 #ifndef PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H
 #define PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H
 
-#include <libsigrokdecode/libsigrokdecode.h>
-
 #include "binding.h"
 
+#include <pv/prop/property.h>
+
+struct srd_decoder_option;
+
 namespace pv {
+
+namespace data {
+class DecoderStack;
+namespace decode {
+class Decoder;
+}
+}
+
 namespace prop {
 namespace binding {
 
 class DecoderOptions : public Binding
 {
 public:
-       DecoderOptions(const srd_decoder *decoder, GHashTable *options);
+       DecoderOptions(std::shared_ptr<pv::data::DecoderStack> decoder_stack,
+               std::shared_ptr<pv::data::decode::Decoder> decoder);
 
 private:
-       GVariant* getter(const char *id);
+       static std::shared_ptr<Property> bind_enum(const QString &name,
+               const srd_decoder_option *option,
+               Property::Getter getter, Property::Setter setter);
+
+       Glib::VariantBase getter(const char *id);
 
-       void setter(const char *id, GVariant *value);
+       void setter(const char *id, Glib::VariantBase value);
 
 private:
-       const srd_decoder *const _decoder;
-       GHashTable *const _options;
+       std::shared_ptr<pv::data::DecoderStack> decoder_stack_;
+       std::shared_ptr<pv::data::decode::Decoder> decoder_;
 };
 
 } // binding