]> sigrok.org Git - pulseview.git/blame - pv/views/viewbase.hpp
Move the "new session" button to the main window's tab area
[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
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef PULSEVIEW_PV_VIEWS_VIEWBASE_HPP
23#define PULSEVIEW_PV_VIEWS_VIEWBASE_HPP
24
25#include <stdint.h>
26
27#include <memory>
28#include <set>
29#include <vector>
30
31#include <QWidget>
32
33#include <pv/data/signalbase.hpp>
34#include <pv/util.hpp>
35
36namespace pv {
37
38class Session;
39
40namespace view {
41class DecodeTrace;
42class Signal;
43}
44
45namespace views {
46
47enum ViewType {
48 ViewTypeTrace,
49 ViewTypeTabularDecode
50};
51
52class ViewBase : public QWidget {
53 Q_OBJECT
54
55public:
56 explicit ViewBase(Session &session, QWidget *parent = 0);
57
58 Session& session();
59 const Session& session() const;
60
61 virtual void clear_signals();
62
63#ifdef ENABLE_DECODE
64 virtual void clear_decode_signals();
65
66 virtual void add_decode_signal(std::shared_ptr<data::SignalBase> signalbase);
67
68 virtual void remove_decode_signal(std::shared_ptr<data::SignalBase> signalbase);
69#endif
70
71 virtual void save_settings(QSettings &settings) const;
72
73 virtual void restore_settings(QSettings &settings);
74
75public Q_SLOTS:
76 virtual void trigger_event(util::Timestamp location);
77 virtual void signals_changed();
78 virtual void capture_state_updated(int state);
79 virtual void data_updated();
80
81protected:
82 Session &session_;
83
84 util::TimeUnit time_unit_;
85};
86
87} // namespace views
88} // namespace pv
89
90#endif // PULSEVIEW_PV_VIEWS_VIEWBASE_HPP