]> sigrok.org Git - pulseview.git/blame - pv/views/viewbase.hpp
Don't use redundant void argument.
[pulseview.git] / pv / views / viewbase.hpp
CommitLineData
f4e57597
SA
1/*
2 * This file is part of the PulseView project.
3 *
4 * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
5 * Copyright (C) 2016 Soeren Apel <soeren@apelpie.net>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
efdec55a 18 * along with this program; if not, see <http://www.gnu.org/licenses/>.
f4e57597
SA
19 */
20
21#ifndef PULSEVIEW_PV_VIEWS_VIEWBASE_HPP
22#define PULSEVIEW_PV_VIEWS_VIEWBASE_HPP
23
24#include <stdint.h>
25
26#include <memory>
27#include <set>
28#include <vector>
29
30#include <QWidget>
31
32#include <pv/data/signalbase.hpp>
33#include <pv/util.hpp>
34
35namespace pv {
36
37class Session;
38
39namespace view {
40class DecodeTrace;
41class Signal;
42}
43
44namespace views {
45
46enum ViewType {
47 ViewTypeTrace,
48 ViewTypeTabularDecode
49};
50
51class ViewBase : public QWidget {
52 Q_OBJECT
53
54public:
143d322d 55 explicit ViewBase(Session &session, bool is_main_view=false, QWidget *parent = 0);
f4e57597
SA
56
57 Session& session();
58 const Session& session() const;
59
60 virtual void clear_signals();
61
62#ifdef ENABLE_DECODE
63 virtual void clear_decode_signals();
64
65 virtual void add_decode_signal(std::shared_ptr<data::SignalBase> signalbase);
66
67 virtual void remove_decode_signal(std::shared_ptr<data::SignalBase> signalbase);
68#endif
69
70 virtual void save_settings(QSettings &settings) const;
71
72 virtual void restore_settings(QSettings &settings);
73
74public Q_SLOTS:
75 virtual void trigger_event(util::Timestamp location);
76 virtual void signals_changed();
77 virtual void capture_state_updated(int state);
78 virtual void data_updated();
79
80protected:
81 Session &session_;
82
143d322d
SA
83 const bool is_main_view_;
84
f4e57597
SA
85 util::TimeUnit time_unit_;
86};
87
88} // namespace views
89} // namespace pv
90
91#endif // PULSEVIEW_PV_VIEWS_VIEWBASE_HPP