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 * Gets the drag point of the row item.
78 * Paints the background layer of the trace with a QPainter
79 * @param p the QPainter to paint into.
80 * @param left the x-coordinate of the left edge of the signal
81 * @param right the x-coordinate of the right edge of the signal
83 virtual void paint_back(QPainter &p, int left, int right);
86 * Paints the mid-layer of the trace with a QPainter
87 * @param p the QPainter to paint into.
88 * @param left the x-coordinate of the left edge of the signal
89 * @param right the x-coordinate of the right edge of the signal
91 virtual void paint_mid(QPainter &p, int left, int right);
94 * Paints the foreground layer of the trace with a QPainter
95 * @param p the QPainter to paint into.
96 * @param left the x-coordinate of the left edge of the signal
97 * @param right the x-coordinate of the right edge of the signal
99 virtual void paint_fore(QPainter &p, int left, int right);
102 * Paints the signal label.
103 * @param p the QPainter to paint into.
104 * @param right the x-coordinate of the right edge of the header
106 * @param hover true if the label is being hovered over by the mouse.
108 virtual void paint_label(QPainter &p, int right, bool hover) = 0;
111 * Computes the outline rectangle of a label.
112 * @param right the x-coordinate of the right edge of the header
114 * @return Returns the rectangle of the signal label.
116 virtual QRectF label_rect(int right) const = 0;
119 virtual void hover_point_changed();
122 void appearance_changed();
125 pv::view::RowItemOwner *_owner;
133 #endif // PULSEVIEW_PV_VIEW_HEADERITEM_H