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
42 * Returns true if the item is visible and enabled.
44 virtual bool enabled() const = 0;
47 * Gets the vertical layout offset of this signal.
52 * Sets the vertical layout offset of this signal.
54 void set_v_offset(int v_offset);
57 * Gets the owner this trace in the view trace hierachy.
59 pv::view::RowItemOwner* owner() const;
62 * Sets the owner this trace in the view trace hierachy.
63 * @param The new owner of the trace.
65 void set_owner(pv::view::RowItemOwner *owner);
68 * Gets the y-offset of the axis.
73 * Paints the background layer of the trace with a QPainter
74 * @param p the QPainter to paint into.
75 * @param left the x-coordinate of the left edge of the signal
76 * @param right the x-coordinate of the right edge of the signal
78 virtual void paint_back(QPainter &p, int left, int right);
81 * Paints the mid-layer of the trace with a QPainter
82 * @param p the QPainter to paint into.
83 * @param left the x-coordinate of the left edge of the signal
84 * @param right the x-coordinate of the right edge of the signal
86 virtual void paint_mid(QPainter &p, int left, int right);
89 * Paints the foreground layer of the trace with a QPainter
90 * @param p the QPainter to paint into.
91 * @param left the x-coordinate of the left edge of the signal
92 * @param right the x-coordinate of the right edge of the signal
94 virtual void paint_fore(QPainter &p, int left, int right);
97 * Paints the signal label.
98 * @param p the QPainter to paint into.
99 * @param right the x-coordinate of the right edge of the header
101 * @param hover true if the label is being hovered over by the mouse.
103 virtual void paint_label(QPainter &p, int right, bool hover) = 0;
106 * Computes the outline rectangle of a label.
107 * @param right the x-coordinate of the right edge of the header
109 * @return Returns the rectangle of the signal label.
111 virtual QRectF label_rect(int right) const = 0;
114 virtual void hover_point_changed();
117 void appearance_changed();
120 pv::view::RowItemOwner *_owner;
128 #endif // PULSEVIEW_PV_VIEW_HEADERITEM_H