summaryrefslogtreecommitdiff
path: root/plugins/Skins/SkinLib/FontState.h
blob: de32bcdfb32903cc45ccfe0fccaf40a26d06beda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef __FONT_STATE_H__
# define __FONT_STATE_H__

#include "Field.h"


class FontState
{
public:
	FontState(HFONT hFont, COLORREF aColor);
	~FontState();

	HFONT getHFONT() const;
	void setHFONT(HFONT hFont);
	HFONT createHFONT() const; /// Return a copy of the internal HFONT. The caller must free it

	const TCHAR * getFace() const;
	void setFace(const TCHAR * face);

	int getSize() const;
	void setSize(int size);

	COLORREF getColor() const;
	void setColor(COLORREF color);

	bool isItalic() const;
	void setItalic(bool italic);

	bool isBold() const;
	void setBold(bool bold);

	bool isUnderline() const;
	void setUnderline(bool underline);

	bool isStrikeOut() const;
	void setStrikeOut(bool strikeout);

private:
	COLORREF color;
	HFONT hFont;
	bool externalFont;
	std::tstring face;
	int size;
	bool italic;
	bool bold;
	bool underline;
	bool strikeout;

	void rebuildHFONT();
	void buildHFONT();
	void releaseHFONT();
	void buildAttribs();
};



#endif // __FONT_STATE_H__