Fix catalan translation
[geany-mirror.git] / scintilla / src / Style.h
blob411b11a08b9ff336d4685a5c7b2eae72f4516d74
1 // Scintilla source code edit control
2 /** @file Style.h
3 ** Defines the font and colour style for a class of text.
4 **/
5 // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
8 #ifndef STYLE_H
9 #define STYLE_H
11 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
15 struct FontSpecification {
16 const char *fontName;
17 int weight;
18 bool italic;
19 int size;
20 int characterSet;
21 int extraFontFlag;
22 FontSpecification() :
23 fontName(0),
24 weight(SC_WEIGHT_NORMAL),
25 italic(false),
26 size(10 * SC_FONT_SIZE_MULTIPLIER),
27 characterSet(0),
28 extraFontFlag(0) {
30 bool operator==(const FontSpecification &other) const;
31 bool operator<(const FontSpecification &other) const;
34 // Just like Font but only has a copy of the FontID so should not delete it
35 class FontAlias : public Font {
36 // Private so FontAlias objects can not be assigned except for intiialization
37 FontAlias &operator=(const FontAlias &);
38 public:
39 FontAlias();
40 FontAlias(const FontAlias &);
41 virtual ~FontAlias();
42 void MakeAlias(Font &fontOrigin);
43 void ClearFont();
46 struct FontMeasurements {
47 unsigned int ascent;
48 unsigned int descent;
49 XYPOSITION aveCharWidth;
50 XYPOSITION spaceWidth;
51 int sizeZoomed;
52 FontMeasurements();
53 void Clear();
56 /**
58 class Style : public FontSpecification, public FontMeasurements {
59 public:
60 ColourDesired fore;
61 ColourDesired back;
62 bool eolFilled;
63 bool underline;
64 enum ecaseForced {caseMixed, caseUpper, caseLower};
65 ecaseForced caseForce;
66 bool visible;
67 bool changeable;
68 bool hotspot;
70 FontAlias font;
72 Style();
73 Style(const Style &source);
74 ~Style();
75 Style &operator=(const Style &source);
76 void Clear(ColourDesired fore_, ColourDesired back_,
77 int size_,
78 const char *fontName_, int characterSet_,
79 int weight_, bool italic_, bool eolFilled_,
80 bool underline_, ecaseForced caseForce_,
81 bool visible_, bool changeable_, bool hotspot_);
82 void ClearTo(const Style &source);
83 void Copy(Font &font_, const FontMeasurements &fm_);
84 bool IsProtected() const { return !(changeable && visible);}
87 #ifdef SCI_NAMESPACE
89 #endif
91 #endif