2 * This file is part of the PulseView project.
4 * Copyright (C) 2013 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, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef PULSEVIEW_PV_VIEW_HEADERITEM_H
22 #define PULSEVIEW_PV_VIEW_HEADERITEM_H
24 #include "selectableitem.h"
31 class RowItem : public SelectableItem
40 * Returns true if the item is visible and enabled.
42 virtual bool enabled() const = 0;
45 * Gets the vertical layout offset of this signal.
50 * Sets the vertical layout offset of this signal.
52 void set_v_offset(int v_offset);
55 * Gets the owner this trace in the view trace hierachy.
57 pv::view::RowItemOwner* owner() const;
60 * Sets the owner this trace in the view trace hierachy.
61 * @param The new owner of the trace.
63 void set_owner(pv::view::RowItemOwner *owner);
66 * Gets the y-offset of the axis.
71 * Paints the background layer of the trace with a QPainter
72 * @param p the QPainter to paint into.
73 * @param left the x-coordinate of the left edge of the signal
74 * @param right the x-coordinate of the right edge of the signal
76 virtual void paint_back(QPainter &p, int left, int right);
79 * Paints the mid-layer of the trace with a QPainter
80 * @param p the QPainter to paint into.
81 * @param left the x-coordinate of the left edge of the signal
82 * @param right the x-coordinate of the right edge of the signal
84 virtual void paint_mid(QPainter &p, int left, int right);
87 * Paints the foreground layer of the trace with a QPainter
88 * @param p the QPainter to paint into.
89 * @param left the x-coordinate of the left edge of the signal
90 * @param right the x-coordinate of the right edge of the signal
92 virtual void paint_fore(QPainter &p, int left, int right);
95 * Paints the signal label.
96 * @param p the QPainter to paint into.
97 * @param right the x-coordinate of the right edge of the header
99 * @param hover true if the label is being hovered over by the mouse.
101 virtual void paint_label(QPainter &p, int right, bool hover) = 0;
104 * Computes the outline rectangle of a label.
105 * @param right the x-coordinate of the right edge of the header
107 * @return Returns the rectangle of the signal label.
109 virtual QRectF label_rect(int right) = 0;
112 virtual void hover_point_changed();
115 pv::view::RowItemOwner *_owner;
123 #endif // PULSEVIEW_PV_VIEW_HEADERITEM_H