X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fstandardbar.hpp;fp=pv%2Fviews%2Ftrace%2Fstandardbar.hpp;h=e41beebc79448d41ccfed7927b33ee5c2e5214fc;hb=e0ba4f6fb263b4cc1dae96df2a0ff1e1ef8984ce;hp=0000000000000000000000000000000000000000;hpb=fd22c71c1a9cc470b53c71c0ee131a4b2d645f80;p=pulseview.git diff --git a/pv/views/trace/standardbar.hpp b/pv/views/trace/standardbar.hpp new file mode 100644 index 0000000..e41beeb --- /dev/null +++ b/pv/views/trace/standardbar.hpp @@ -0,0 +1,92 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2016 Soeren Apel + * Copyright (C) 2012 Joel Holdsworth + * + * 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_TRACE_STANDARDBAR_HPP +#define PULSEVIEW_PV_VIEWS_TRACE_STANDARDBAR_HPP + +#include + +#include +#include +#include + +#include + +namespace pv { + +class MainWindow; +class Session; + +namespace views { + +namespace TraceView { +class View; +} + +namespace trace { + +class StandardBar : public QToolBar +{ + Q_OBJECT + +public: + StandardBar(Session &session, QWidget *parent, + TraceView::View *view, bool add_default_widgets=true); + + Session &session(void) const; + + QAction* action_view_zoom_in() const; + QAction* action_view_zoom_out() const; + QAction* action_view_zoom_fit() const; + QAction* action_view_zoom_one_to_one() const; + QAction* action_view_show_cursors() const; + +protected: + virtual void add_toolbar_widgets(); + + Session &session_; + TraceView::View *view_; + + QAction *const action_view_zoom_in_; + QAction *const action_view_zoom_out_; + QAction *const action_view_zoom_fit_; + QAction *const action_view_zoom_one_to_one_; + QAction *const action_view_show_cursors_; + +protected Q_SLOTS: + void on_actionViewZoomIn_triggered(); + + void on_actionViewZoomOut_triggered(); + + void on_actionViewZoomFit_triggered(); + + void on_actionViewZoomOneToOne_triggered(); + + void on_actionViewShowCursors_triggered(); + + void on_always_zoom_to_fit_changed(bool state); +}; + +} // namespace trace +} // namespace views +} // namespace pv + +#endif // PULSEVIEW_PV_VIEWS_TRACE_STANDARDBAR_HPP