xref: /haiku/src/apps/debuganalyzer/gui/chart/ChartLegend.h (revision fce4895d1884da5ae6fb299d23c735c598e690b1)
1 /*
2  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef CHART_LEGEND_H
6 #define CHART_LEGEND_H
7 
8 #include <Point.h>
9 #include <Size.h>
10 
11 
12 class BView;
13 class ChartDataRange;
14 
15 
16 class ChartLegend {
17 public:
18 								ChartLegend(int32 level = 0);
19 									// A lower level means more likely to be
20 									// shown. <= 0 is mandatory.
21 	virtual						~ChartLegend();
22 
23 			int32				Level()		{ return fLevel; }
24 
25 private:
26 			int32				fLevel;
27 };
28 
29 
30 class ChartLegendRenderer {
31 public:
32 	virtual						~ChartLegendRenderer();
33 
34 	virtual	void				GetMinimumLegendSpacing(BView* view,
35 									float* horizontal, float* vertical) = 0;
36 
37 	virtual	BSize				LegendSize(ChartLegend* legend,
38 									BView* view) = 0;
39 	virtual	void				RenderLegend(ChartLegend* legend, BView* view,
40 									BPoint point) = 0;
41 };
42 
43 
44 #endif	// CHART_LEGEND_H
45