xref: /haiku/src/apps/haikudepot/textview/ParagraphStyleData.h (revision 002f37b0cca92e4cf72857c72ac95db5a8b09615)
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
7 
8 #include "Bullet.h"
9 
10 
11 enum Alignment {
12 	ALIGN_LEFT		= 0,
13 	ALIGN_CENTER	= 1,
14 	ALIGN_RIGHT		= 2,
15 };
16 
17 
18 class ParagraphStyleData;
19 typedef BReference<ParagraphStyleData>	ParagraphStyleDataRef;
20 
21 
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);
29 
30 			bool				operator==(
31 									const ParagraphStyleData& other) const;
32 			bool				operator!=(
33 									const ParagraphStyleData& other) const;
34 
35 			ParagraphStyleDataRef SetAlignment(::Alignment alignment);
36 	inline	::Alignment			Alignment() const
37 									{ return fAlignment; }
38 
39 			ParagraphStyleDataRef SetJustify(bool justify);
40 	inline	bool				Justify() const
41 									{ return fJustify; }
42 
43 			ParagraphStyleDataRef SetFirstLineInset(float inset);
44 	inline	float				FirstLineInset() const
45 									{ return fFirstLineInset; }
46 
47 			ParagraphStyleDataRef SetLineInset(float inset);
48 	inline	float				LineInset() const
49 									{ return fLineInset; }
50 
51 			ParagraphStyleDataRef SetLineSpacing(float spacing);
52 	inline	float				LineSpacing() const
53 									{ return fLineSpacing; }
54 
55 			ParagraphStyleDataRef SetSpacingTop(float spacing);
56 	inline	float				SpacingTop() const
57 									{ return fSpacingTop; }
58 
59 			ParagraphStyleDataRef SetSpacingBottom(float spacing);
60 	inline	float				SpacingBottom() const
61 									{ return fSpacingBottom; }
62 
63 			ParagraphStyleDataRef SetBullet(const ::Bullet& bullet);
64 	inline	const ::Bullet&		Bullet() const
65 									{ return fBullet; }
66 private:
67 			ParagraphStyleData&	operator=(const ParagraphStyleData& other);
68 
69 private:
70 			::Alignment			fAlignment;
71 			bool				fJustify;
72 
73 			float				fFirstLineInset;
74 			float				fLineInset;
75 			float				fLineSpacing;
76 
77 			float				fSpacingTop;
78 			float				fSpacingBottom;
79 
80 			::Bullet			fBullet;
81 };
82 
83 
84 #endif // PARAGRAPH_STYLE_DATA_H
85