]> sigrok.org Git - pulseview.git/blame - pv/binding/decoder.hpp
logicsegment.cpp: Add missing config.h #include.
[pulseview.git] / pv / binding / decoder.hpp
CommitLineData
21ad818f
JH
1/*
2 * This file is part of the PulseView project.
3 *
4 * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
efdec55a 17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
21ad818f
JH
18 */
19
7a01bd36
JH
20#ifndef PULSEVIEW_PV_BINDING_DECODER_HPP
21#define PULSEVIEW_PV_BINDING_DECODER_HPP
21ad818f 22
2acdb232 23#include "binding.hpp"
21ad818f 24
2acdb232 25#include <pv/prop/property.hpp>
182d2f5d 26
6f925ba9
UH
27using std::shared_ptr;
28
182d2f5d
JH
29struct srd_decoder_option;
30
21ad818f 31namespace pv {
4e5a4405
JH
32
33namespace data {
946b52e1 34class DecodeSignal;
7491a29f
JH
35namespace decode {
36class Decoder;
37}
4e5a4405
JH
38}
39
21ad818f
JH
40namespace binding {
41
3cc9ad7b 42class Decoder : public Binding
21ad818f
JH
43{
44public:
946b52e1 45 Decoder(shared_ptr<pv::data::DecodeSignal> decode_signal,
6f925ba9 46 shared_ptr<pv::data::decode::Decoder> decoder);
21ad818f 47
67fe5e9c 48private:
6f925ba9 49 static shared_ptr<prop::Property> bind_enum(const QString &name,
9a267f8d 50 const QString &desc, const srd_decoder_option *option,
61703a01 51 prop::Property::Getter getter, prop::Property::Setter setter);
182d2f5d 52
e8d00928 53 Glib::VariantBase getter(const char *id);
67fe5e9c 54
e8d00928 55 void setter(const char *id, Glib::VariantBase value);
67fe5e9c
JH
56
57private:
946b52e1 58 shared_ptr<pv::data::DecodeSignal> decode_signal_;
6f925ba9 59 shared_ptr<pv::data::decode::Decoder> decoder_;
21ad818f
JH
60};
61
870ea3db
UH
62} // namespace binding
63} // namespace pv
21ad818f 64
7a01bd36 65#endif // PULSEVIEW_PV_BINDING_DECODER_HPP