X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsubwindows%2Fsubwindowbase.hpp;fp=pv%2Fsubwindows%2Fsubwindowbase.hpp;h=47b8ce392c925cbcdda15fa96821eb6828a2d227;hp=0000000000000000000000000000000000000000;hb=97378470ded88af84edaa0f1063d10d834475665;hpb=58cd5b584f5bcb19d7c9bd28391c53dd2488fc59 diff --git a/pv/subwindows/subwindowbase.hpp b/pv/subwindows/subwindowbase.hpp new file mode 100644 index 0000000..47b8ce3 --- /dev/null +++ b/pv/subwindows/subwindowbase.hpp @@ -0,0 +1,91 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2018 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, see . + */ + +#ifndef PULSEVIEW_PV_SUBWINDOWBASE_HPP +#define PULSEVIEW_PV_SUBWINDOWBASE_HPP + +#include +#include +#include + +#include +#include + +#include + +#ifdef ENABLE_DECODE +#include +#endif + +using std::shared_ptr; +using std::unordered_set; + +namespace pv { + +class Session; + +namespace subwindows { + +enum SubWindowType { + SubWindowTypeDecoderSelector, +}; + +class SubWindowBase : public QWidget +{ + Q_OBJECT + +public: + explicit SubWindowBase(Session &session, QWidget *parent = nullptr); + + virtual bool has_toolbar() const; + virtual QToolBar* create_toolbar(QWidget *parent) const; + + Session& session(); + const Session& session() const; + + /** + * Returns the signal bases contained in this view. + */ + unordered_set< shared_ptr > signalbases() const; + + virtual void clear_signalbases(); + + virtual void add_signalbase(const shared_ptr signalbase); + +#ifdef ENABLE_DECODE + virtual void clear_decode_signals(); + + virtual void add_decode_signal(shared_ptr signal); + + virtual void remove_decode_signal(shared_ptr signal); +#endif + +public Q_SLOTS: + virtual void on_signals_changed(); + +protected: + Session &session_; + + unordered_set< shared_ptr > signalbases_; +}; + +} // namespace subwindows +} // namespace pv + +#endif // PULSEVIEW_PV_SUBWINDOWBASE_HPP