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 * Sets the owner this trace in the view trace hierachy.
56 * @param The new owner of the trace.
58 void set_owner(pv::view::RowItemOwner *owner);
61 * Gets the y-offset of the axis.
66 * Paints the background layer of the trace with a QPainter
67 * @param p the QPainter to paint into.
68 * @param left the x-coordinate of the left edge of the signal
69 * @param right the x-coordinate of the right edge of the signal
71 virtual void paint_back(QPainter &p, int left, int right);
74 * Paints the mid-layer of the trace with a QPainter
75 * @param p the QPainter to paint into.
76 * @param left the x-coordinate of the left edge of the signal
77 * @param right the x-coordinate of the right edge of the signal
79 virtual void paint_mid(QPainter &p, int left, int right);
82 * Paints the foreground layer of the trace with a QPainter
83 * @param p the QPainter to paint into.
84 * @param left the x-coordinate of the left edge of the signal
85 * @param right the x-coordinate of the right edge of the signal
87 virtual void paint_fore(QPainter &p, int left, int right);
90 * Paints the signal label.
91 * @param p the QPainter to paint into.
92 * @param right the x-coordinate of the right edge of the header
94 * @param hover true if the label is being hovered over by the mouse.
96 virtual void paint_label(QPainter &p, int right, bool hover) = 0;
99 * Computes the outline rectangle of a label.
100 * @param right the x-coordinate of the right edge of the header
102 * @return Returns the rectangle of the signal label.
104 virtual QRectF label_rect(int right) = 0;
107 virtual void hover_point_changed();
110 pv::view::RowItemOwner *_owner;
118 #endif // PULSEVIEW_PV_VIEW_HEADERITEM_H