TextLegendProperties.hh 1.31 KB
/*
 * TextLegendProperties.hh
 *
 *  Created on: 24 sep. 2014
 *      Author: AKKA
 */

#ifndef TEXTLEGENDPROPERTIES_HH_
#define TEXTLEGENDPROPERTIES_HH_

#include <string>
#include <vector>
#include "Color.hh"
#include "Color.hh"
#include "Font.hh"

namespace plot
{
	typedef enum {POS_RIGHT, POS_LEFT, POS_TOP, POS_BOTTOM} TextLegendPosition;

	class TextLegendProperties
	{
	public:
		TextLegendProperties(void);
		virtual ~TextLegendProperties(void);

		void reset(void);

		void setText(const std::string& text);
		const std::string& getText() const;

		void setFont(Font font);

		Font& getFont(void);

		void setFontStyle(Font::Style fontStyle) {
			_font._style = fontStyle;
		}

		void setFontWeight(int fontWeight) {
			_font._weight = fontWeight;
		}

		void setPosition(TextLegendPosition position);
		TextLegendPosition getPosition(void);

		void setColor(const Color& color);
		Color& getColor();

		void setOffset(double offset);
		double getOffset(void);

		int getTextLinesNb (void);
		std::vector<std::string> getTextLines (void);

		bool isDrawn(void);

		void setDrawn(bool drawn);

		static const std::string DELIMITER;

	private:
		std::string 		_text;
		TextLegendPosition 	_position;
		Color 				_color;
		Font _font;

		double				_offset;

		bool                _drawn;
	};
}

#endif /* TEXTLEGENDPROPERTIES_HH_ */