]> sigrok.org Git - pulseview.git/blame - pv/views/trace/signal.hpp
Improve hover point signaling
[pulseview.git] / pv / views / trace / signal.hpp
CommitLineData
28a4c9c5 1/*
b3f22de0 2 * This file is part of the PulseView project.
28a4c9c5
JH
3 *
4 * Copyright (C) 2012 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/>.
28a4c9c5
JH
18 */
19
f4e57597
SA
20#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNAL_HPP
21#define PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNAL_HPP
640d091b 22
f9abf97e 23#include <memory>
9a0cd293 24
9e40e83d 25#include <QComboBox>
9e40e83d 26#include <QWidgetAction>
e3f65ace 27
cafe470e 28#include <cstdint>
28a4c9c5 29
2acdb232 30#include "trace.hpp"
4b5782e1 31#include "viewitemowner.hpp"
e0e90d80 32
6f925ba9
UH
33using std::shared_ptr;
34
51e77110
JH
35namespace pv {
36
2b81ae46 37class Session;
b86aa8f4 38
1b1ec774 39namespace data {
bf0edd2b 40class SignalBase;
28a4c9c5 41class SignalData;
1b1ec774 42}
28a4c9c5 43
f4e57597 44namespace views {
1573bf16 45namespace trace {
a2f71ef0 46
4b5782e1 47class Signal : public Trace, public ViewItemOwner
28a4c9c5 48{
2a2512b2
JH
49 Q_OBJECT
50
28a4c9c5 51protected:
6f925ba9 52 Signal(pv::Session &session, shared_ptr<data::SignalBase> channel);
28a4c9c5
JH
53
54public:
49f8ff3f
JH
55 /**
56 * Sets the name of the signal.
57 */
bf0edd2b 58 virtual void set_name(QString name);
49f8ff3f 59
6f925ba9 60 virtual shared_ptr<pv::data::SignalData> data() const = 0;
9a0cd293 61
b3b57abc 62 /**
931f20b0 63 * Returns true if the trace is visible and enabled.
a29bb7fb 64 */
931f20b0 65 bool enabled() const;
a29bb7fb 66
6f925ba9 67 shared_ptr<data::SignalBase> base() const;
632ba77e 68
3a21afa6
SA
69 virtual void save_settings(QSettings &settings) const;
70
71 virtual void restore_settings(QSettings &settings);
72
60938e04 73 void paint_back(QPainter &p, ViewItemPaintParams &pp);
99af6802 74
0c0218fd
JH
75 virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
76
86e823ca
JH
77 QMenu* create_context_menu(QWidget *parent);
78
5ed1adf5
JH
79 void delete_pressed();
80
bf0edd2b
SA
81protected Q_SLOTS:
82 virtual void on_name_changed(const QString &text);
83
86e823ca
JH
84 void on_disable();
85
a45b9b9e
SA
86 void on_enabled_changed(bool enabled);
87
28a4c9c5 88protected:
2b81ae46 89 pv::Session &session_;
cec48d16 90
8dbbc7f0 91 QComboBox *name_widget_;
28a4c9c5 92};
51e77110 93
1573bf16 94} // namespace trace
f4e57597 95} // namespace views
51e77110 96} // namespace pv
640d091b 97
f4e57597 98#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNAL_HPP