]> sigrok.org Git - pulseview.git/blame - pv/prop/int.hpp
Modified header guards to match file names
[pulseview.git] / pv / prop / int.hpp
CommitLineData
a2b92157
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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
7a01bd36
JH
21#ifndef PULSEVIEW_PV_PROP_INT_HPP
22#define PULSEVIEW_PV_PROP_INT_HPP
a2b92157
JH
23
24#include <utility>
25
26#include <boost/optional.hpp>
27
2acdb232 28#include "property.hpp"
a2b92157
JH
29
30class QSpinBox;
31
32namespace pv {
33namespace prop {
34
35class Int : public Property
36{
b1fe148e
JH
37 Q_OBJECT;
38
a2b92157
JH
39public:
40 Int(QString name, QString suffix,
41 boost::optional< std::pair<int64_t, int64_t> > range,
42 Getter getter, Setter setter);
43
f459c540
JH
44 virtual ~Int();
45
b1fe148e 46 QWidget* get_widget(QWidget *parent, bool auto_commit);
a2b92157
JH
47
48 void commit();
49
e9213170 50private Q_SLOTS:
b1fe148e
JH
51 void on_value_changed(int);
52
a2b92157 53private:
8dbbc7f0
JH
54 const QString suffix_;
55 const boost::optional< std::pair<int64_t, int64_t> > range_;
a2b92157 56
8dbbc7f0
JH
57 Glib::VariantBase value_;
58 QSpinBox *spin_box_;
a2b92157
JH
59};
60
61} // prop
62} // pv
63
7a01bd36 64#endif // PULSEVIEW_PV_PROP_INT_HPP