2 * This file is part of the PulseView project.
4 * Copyright (C) 2015 Joel Holdsworth <joel@airwebreathe.org.uk>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNALSCALEHANDLE_HPP
21 #define PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNALSCALEHANDLE_HPP
23 #include "rowitem.hpp"
32 * A row item owned by a @c Signal that implements the v-scale adjustment grab
35 class SignalScaleHandle : public RowItem
42 explicit SignalScaleHandle(Signal &owner);
46 * Returns true if the parent item is enabled.
51 * Selects or deselects the signal.
53 void select(bool select = true);
56 * Sets this item into the un-dragged state.
61 * Drags the item to a delta relative to the drag point.
62 * @param delta the offset from the drag point.
64 void drag_by(const QPoint &delta);
68 * @param rect the rectangle of the widget area.
70 QPoint point(const QRect &rect) const;
73 * Computes the outline rectangle of the viewport hit-box.
74 * @param rect the rectangle of the viewport area.
75 * @return Returns the rectangle of the hit-box.
77 QRectF hit_box_rect(const ViewItemPaintParams &pp) const;
80 * Paints the foreground layer of the item with a QPainter
81 * @param p the QPainter to paint into.
82 * @param pp the painting parameters object to paint with.
84 void paint_fore(QPainter &p, const ViewItemPaintParams &pp);
90 } // namespace TraceView
94 #endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNALSCALEHANDLE_HPP