1 /*
2     Copyright (C) 2007 Remon Sijrier
3 
4     This file is part of Traverso
5 
6     Traverso 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.
10 
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.
15 
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.
19 
20 */
21 
22 #ifndef MARKER_VIEW_H
23 #define MARKER_VIEW_H
24 
25 #include "ViewItem.h"
26 
27 class Marker;
28 class SheetView;
29 class LineView;
30 class QColor;
31 class PositionIndicator;
32 
33 class MarkerView : public ViewItem
34 {
35 	Q_OBJECT
36 
37 public:
38 	MarkerView(Marker* marker, SheetView* sv, ViewItem* parent);
~MarkerView()39 	~MarkerView() {}
40 
41 	void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
42 	void calculate_bounding_rect();
43 	void load_theme_data();
44 	void set_active(bool);
45 	int position();
46 	void set_position(int);
47 	void set_dragging(bool dragging);
48 
get_marker()49 	Marker* get_marker() const {return m_marker;}
50 
51 private:
52 	Marker* m_marker;
53 	LineView* m_line;
54 	QColor	m_fillColor;
55 	bool	m_active;
56 	bool	m_dragging;
57 	PositionIndicator* m_posIndicator;
58 	int	m_ascent;
59 	int	m_width;
60 
61 private slots:
62 	void update_position();
63 	void update_drawing();
64 };
65 
66 #endif
67 
68 //eof
69