10SN/A/*
27184SN/A * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
30SN/A * Distributed under the terms of the MIT License.
40SN/A */
50SN/A#ifndef STRING_CHART_LEGEND_H
60SN/A#define STRING_CHART_LEGEND_H
72362SN/A
80SN/A#include <Font.h>
92362SN/A#include <String.h>
100SN/A
110SN/A#include "chart/ChartLegend.h"
120SN/A
130SN/A
140SN/Aclass StringChartLegend : public ChartLegend {
150SN/Apublic:
160SN/A								StringChartLegend(const char* string,
170SN/A									int32 level = 0);
180SN/A
190SN/A			const char*			String() const	{ return fString.String(); }
200SN/A
212362SN/Aprivate:
222362SN/A			BString				fString;
232362SN/A};
240SN/A
250SN/A
260SN/Aclass StringChartLegendRenderer : public ChartLegendRenderer {
270SN/Apublic:
280SN/A								StringChartLegendRenderer();
290SN/A								StringChartLegendRenderer(const BFont& font);
300SN/A
310SN/A	virtual	void				GetMinimumLegendSpacing(BView* view,
320SN/A									float* horizontal, float* vertical);
330SN/A
340SN/A	virtual	BSize				LegendSize(ChartLegend* legend,
350SN/A									BView* view);
360SN/A	virtual	void				RenderLegend(ChartLegend* legend, BView* view,
370SN/A									BPoint point);
380SN/A
390SN/Aprivate:
400SN/A			void				_Init();
410SN/A
420SN/Aprivate:
430SN/A			BFont				fFont;
440SN/A			float				fFontAscent;
450SN/A			float				fFontHeight;
460SN/A			float				fEmWidth;
470SN/A};
480SN/A
490SN/A
500SN/A#endif	// STRING_CHART_LEGEND_H
510SN/A