vfs: check userland buffers before reading them.
[haiku.git] / src / apps / haikudepot / textview / ParagraphStyleData.h
blobe3847520ff48f4b35ba5e190ddbf27e6000f7111
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 PARAGRAPH_STYLE_DATA_H
6 #define PARAGRAPH_STYLE_DATA_H
8 #include "Bullet.h"
11 enum Alignment {
12 ALIGN_LEFT = 0,
13 ALIGN_CENTER = 1,
14 ALIGN_RIGHT = 2,
18 class ParagraphStyleData;
19 typedef BReference<ParagraphStyleData> ParagraphStyleDataRef;
22 // You cannot modify a ParagraphStyleData object once it has been
23 // created.
24 class ParagraphStyleData : public BReferenceable {
25 public:
26 ParagraphStyleData();
27 ParagraphStyleData(
28 const ParagraphStyleData& other);
30 bool operator==(
31 const ParagraphStyleData& other) const;
32 bool operator!=(
33 const ParagraphStyleData& other) const;
35 ParagraphStyleDataRef SetAlignment(::Alignment alignment);
36 inline ::Alignment Alignment() const
37 { return fAlignment; }
39 ParagraphStyleDataRef SetJustify(bool justify);
40 inline bool Justify() const
41 { return fJustify; }
43 ParagraphStyleDataRef SetFirstLineInset(float inset);
44 inline float FirstLineInset() const
45 { return fFirstLineInset; }
47 ParagraphStyleDataRef SetLineInset(float inset);
48 inline float LineInset() const
49 { return fLineInset; }
51 ParagraphStyleDataRef SetLineSpacing(float spacing);
52 inline float LineSpacing() const
53 { return fLineSpacing; }
55 ParagraphStyleDataRef SetSpacingTop(float spacing);
56 inline float SpacingTop() const
57 { return fSpacingTop; }
59 ParagraphStyleDataRef SetSpacingBottom(float spacing);
60 inline float SpacingBottom() const
61 { return fSpacingBottom; }
63 ParagraphStyleDataRef SetBullet(const ::Bullet& bullet);
64 inline const ::Bullet& Bullet() const
65 { return fBullet; }
66 private:
67 ParagraphStyleData& operator=(const ParagraphStyleData& other);
69 private:
70 ::Alignment fAlignment;
71 bool fJustify;
73 float fFirstLineInset;
74 float fLineInset;
75 float fLineSpacing;
77 float fSpacingTop;
78 float fSpacingBottom;
80 ::Bullet fBullet;
84 #endif // PARAGRAPH_STYLE_DATA_H