X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fsubwindows%2Fsubwindowbase.hpp;fp=pv%2Fsubwindows%2Fsubwindowbase.hpp;h=ab3a08b412af72790fde7eed678030a8bdc4b91e;hb=10f5e6f54e0c36582e846a769b67b1e7e5a371f8;hp=0000000000000000000000000000000000000000;hpb=05a4de8abd5810cf8219077259ffa44adb08043e;p=pulseview.git diff --git a/pv/subwindows/subwindowbase.hpp b/pv/subwindows/subwindowbase.hpp new file mode 100644 index 00000000..ab3a08b4 --- /dev/null +++ b/pv/subwindows/subwindowbase.hpp @@ -0,0 +1,93 @@ +/* + * 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 + + virtual int minimum_width() const; + +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