vfs: check userland buffers before reading them.
[haiku.git] / src / apps / haikudepot / textview / CharacterStyle.h
blob781964bcb2955a397b37deca756c7550fb058835
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
8 #include "CharacterStyleData.h"
11 class CharacterStyle {
12 public:
13 CharacterStyle();
14 CharacterStyle(const CharacterStyle& other);
16 CharacterStyle& operator=(const CharacterStyle& other);
17 bool operator==(const CharacterStyle& other) const;
18 bool operator!=(const CharacterStyle& other) const;
20 bool SetFont(const BFont& font);
21 const BFont& Font() const;
23 bool SetFontSize(float size);
24 float FontSize() const;
26 bool SetBold(bool bold);
27 bool IsBold() const;
29 bool SetItalic(bool italic);
30 bool IsItalic() const;
32 bool SetAscent(float ascent);
33 float Ascent() const;
35 bool SetDescent(float descent);
36 float Descent() const;
38 bool SetWidth(float width);
39 float Width() const;
41 bool SetGlyphSpacing(float spacing);
42 float GlyphSpacing() const;
44 bool SetForegroundColor(
45 uint8 r, uint8 g, uint8 b,
46 uint8 a = 255);
47 bool SetForegroundColor(color_which which);
48 bool SetForegroundColor(rgb_color color);
49 rgb_color ForegroundColor() const;
50 color_which WhichForegroundColor() const;
52 bool SetBackgroundColor(
53 uint8 r, uint8 g, uint8 b,
54 uint8 a = 255);
55 bool SetBackgroundColor(color_which which);
56 bool SetBackgroundColor(rgb_color color);
57 rgb_color BackgroundColor() const;
58 color_which WhichBackgroundColor() const;
60 bool SetStrikeOutColor(color_which which);
61 bool SetStrikeOutColor(rgb_color color);
62 rgb_color StrikeOutColor() const;
63 color_which WhichStrikeOutColor() const;
65 bool SetUnderlineColor(color_which which);
66 bool SetUnderlineColor(rgb_color color);
67 rgb_color UnderlineColor() const;
68 color_which WhichUnderlineColor() const;
70 bool SetStrikeOut(uint8 strikeOut);
71 uint8 StrikeOut() const;
73 bool SetUnderline(uint8 underline);
74 uint8 Underline() const;
76 private:
77 BFont _FindFontForFace(uint16 face) const;
79 private:
80 CharacterStyleDataRef fStyleData;
84 #endif // CHARACTER_STYLE_H