X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Fviewbase.hpp;fp=pv%2Fviews%2Fviewbase.hpp;h=1ac847562cd4462ebe0872d46732106f1b3dd49c;hp=0000000000000000000000000000000000000000;hb=f4e57597347e47a4ea58fbdc7b0a22e07f1c0ede;hpb=90d77e35b43fb7fdffc800945761bf95ba9faf02 diff --git a/pv/views/viewbase.hpp b/pv/views/viewbase.hpp new file mode 100644 index 0000000..1ac8475 --- /dev/null +++ b/pv/views/viewbase.hpp @@ -0,0 +1,90 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2012 Joel Holdsworth + * Copyright (C) 2016 Soeren Apel + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PULSEVIEW_PV_VIEWS_VIEWBASE_HPP +#define PULSEVIEW_PV_VIEWS_VIEWBASE_HPP + +#include + +#include +#include +#include + +#include + +#include +#include + +namespace pv { + +class Session; + +namespace view { +class DecodeTrace; +class Signal; +} + +namespace views { + +enum ViewType { + ViewTypeTrace, + ViewTypeTabularDecode +}; + +class ViewBase : public QWidget { + Q_OBJECT + +public: + explicit ViewBase(Session &session, QWidget *parent = 0); + + Session& session(); + const Session& session() const; + + virtual void clear_signals(); + +#ifdef ENABLE_DECODE + virtual void clear_decode_signals(); + + virtual void add_decode_signal(std::shared_ptr signalbase); + + virtual void remove_decode_signal(std::shared_ptr signalbase); +#endif + + virtual void save_settings(QSettings &settings) const; + + virtual void restore_settings(QSettings &settings); + +public Q_SLOTS: + virtual void trigger_event(util::Timestamp location); + virtual void signals_changed(); + virtual void capture_state_updated(int state); + virtual void data_updated(); + +protected: + Session &session_; + + util::TimeUnit time_unit_; +}; + +} // namespace views +} // namespace pv + +#endif // PULSEVIEW_PV_VIEWS_VIEWBASE_HPP