2 * This file is part of the PulseView project.
4 * Copyright (C) 2016 Soeren Apel <soeren@apelpie.net>
5 * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <http://www.gnu.org/licenses/>.
21 #ifndef PULSEVIEW_PV_VIEWS_TRACE_STANDARDBAR_HPP
22 #define PULSEVIEW_PV_VIEWS_TRACE_STANDARDBAR_HPP
29 #include <QToolButton>
32 #include <pv/session.hpp>
49 class StandardBar : public QToolBar
54 StandardBar(Session &session, QWidget *parent,
55 trace::View *view, bool add_default_widgets = true);
57 Session &session() const;
59 QAction* action_view_zoom_in() const;
60 QAction* action_view_zoom_out() const;
61 QAction* action_view_zoom_fit() const;
62 QAction* action_view_zoom_one_to_one() const;
63 QAction* action_view_show_cursors() const;
66 virtual void add_toolbar_widgets();
68 virtual void show_multi_segment_ui(const bool state);
73 QAction *const action_view_zoom_in_;
74 QAction *const action_view_zoom_out_;
75 QAction *const action_view_zoom_fit_;
76 QAction *const action_view_zoom_one_to_one_;
77 QAction *const action_view_show_cursors_;
79 QToolButton *segment_display_mode_selector_;
80 QAction *const action_sdm_last_;
81 QAction *const action_sdm_last_complete_;
82 QAction *const action_sdm_single_;
84 QSpinBox *segment_selector_;
87 void segment_selected(int segment_id);
90 void on_actionViewZoomIn_triggered();
92 void on_actionViewZoomOut_triggered();
94 void on_actionViewZoomFit_triggered(bool checked);
96 void on_actionViewZoomOneToOne_triggered();
98 void on_actionViewShowCursors_triggered();
100 void on_actionSDMLast_triggered();
101 void on_actionSDMLastComplete_triggered();
102 void on_actionSDMSingle_triggered();
104 void on_always_zoom_to_fit_changed(bool state);
106 void on_new_segment(int new_segment_id);
107 void on_segment_changed(int segment_id);
108 void on_segment_selected(int ui_segment_id);
109 void on_segment_display_mode_changed(int mode, bool segment_selectable);
112 vector<QAction*> multi_segment_actions_;
119 #endif // PULSEVIEW_PV_VIEWS_TRACE_STANDARDBAR_HPP