1 /* 2 * Copyright 2013, Stephan Aßmus <superstippi@gmx.de>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef CHARACTER_STYLE_H 6 #define CHARACTER_STYLE_H 7 8 #include "CharacterStyleData.h" 9 10 11 class CharacterStyle { 12 public: 13 CharacterStyle(); 14 CharacterStyle(const CharacterStyle& other); 15 16 CharacterStyle& operator=(const CharacterStyle& other); 17 bool operator==(const CharacterStyle& other) const; 18 bool operator!=(const CharacterStyle& other) const; 19 20 bool SetFont(const BFont& font); 21 const BFont& Font() const; 22 23 bool SetFontSize(float size); 24 float FontSize() const; 25 26 bool SetBold(bool bold); 27 bool IsBold() const; 28 29 bool SetItalic(bool italic); 30 bool IsItalic() const; 31 32 bool SetAscent(float ascent); 33 float Ascent() const; 34 35 bool SetDescent(float descent); 36 float Descent() const; 37 38 bool SetWidth(float width); 39 float Width() const; 40 41 bool SetGlyphSpacing(float spacing); 42 float GlyphSpacing() const; 43 44 bool SetForegroundColor( 45 uint8 r, uint8 g, uint8 b, 46 uint8 a = 255); 47 bool SetForegroundColor(rgb_color color); 48 rgb_color ForegroundColor() const; 49 50 bool SetBackgroundColor( 51 uint8 r, uint8 g, uint8 b, 52 uint8 a = 255); 53 bool SetBackgroundColor(rgb_color color); 54 rgb_color BackgroundColor() const; 55 56 bool SetStrikeOutColor(rgb_color color); 57 rgb_color StrikeOutColor() const; 58 59 bool SetUnderlineColor(rgb_color color); 60 rgb_color UnderlineColor() const; 61 62 bool SetStrikeOut(uint8 strikeOut); 63 uint8 StrikeOut() const; 64 65 bool SetUnderline(uint8 underline); 66 uint8 Underline() const; 67 68 69 private: 70 BFont _FindFontForFace(uint16 face) const; 71 72 private: 73 CharacterStyleDataRef fStyleData; 74 }; 75 76 77 #endif // CHARACTER_STYLE_H 78