]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | /* |
f3c0d7a5 A |
2 | ******************************************************************************* |
3 | * | |
4 | * © 2016 and later: Unicode, Inc. and others. | |
5 | * License & terms of use: http://www.unicode.org/copyright.html#License | |
6 | * | |
7 | ******************************************************************************* | |
b75a7d8f A |
8 | ******************************************************************************* |
9 | * | |
46f4442e | 10 | * Copyright (C) 1999-2007, International Business Machines |
b75a7d8f A |
11 | * Corporation and others. All Rights Reserved. |
12 | * | |
13 | ******************************************************************************* | |
14 | * file name: Paragraph.h | |
15 | * | |
16 | * created on: 09/06/2000 | |
17 | * created by: Eric R. Mader | |
18 | */ | |
19 | #ifndef __PARAGRAPH_H | |
20 | #define __PARAGRAPH_H | |
21 | ||
22 | #include "unicode/utypes.h" | |
73c04bcf | 23 | #include "unicode/ubidi.h" |
b75a7d8f A |
24 | |
25 | #include "layout/LEFontInstance.h" | |
26 | #include "layout/ParagraphLayout.h" | |
27 | ||
28 | #include "GUISupport.h" | |
29 | #include "RenderingSurface.h" | |
b75a7d8f A |
30 | |
31 | U_NAMESPACE_USE | |
32 | ||
33 | #define MARGIN 10 | |
34 | ||
35 | #if 0 | |
36 | class LineInfo; | |
37 | #endif | |
38 | ||
39 | class Paragraph | |
40 | { | |
41 | public: | |
374ca955 | 42 | Paragraph(const LEUnicode chars[], le_int32 charCount, const FontRuns *fontRuns, LEErrorCode &status); |
b75a7d8f A |
43 | |
44 | ~Paragraph(); | |
45 | ||
46 | le_int32 getAscent(); | |
47 | le_int32 getLineHeight(); | |
48 | le_int32 getLineCount(); | |
49 | void breakLines(le_int32 width, le_int32 height); | |
50 | void draw(RenderingSurface *surface, le_int32 firstLine, le_int32 lastLine); | |
51 | ||
52 | static Paragraph *paragraphFactory(const char *fileName, const LEFontInstance *font, GUISupport *guiSupport); | |
53 | ||
54 | private: | |
73c04bcf | 55 | void addLine(const ParagraphLayout::Line *line); |
b75a7d8f | 56 | |
73c04bcf A |
57 | ParagraphLayout **fParagraphLayout; |
58 | ||
59 | le_int32 fParagraphCount; | |
60 | le_int32 fParagraphMax; | |
61 | le_int32 fParagraphGrow; | |
62 | ||
63 | le_int32 fLineCount; | |
64 | le_int32 fLinesMax; | |
65 | le_int32 fLinesGrow; | |
b75a7d8f A |
66 | |
67 | const ParagraphLayout::Line **fLines; | |
68 | LEUnicode *fChars; | |
69 | ||
70 | le_int32 fLineHeight; | |
71 | le_int32 fAscent; | |
72 | le_int32 fWidth; | |
73 | le_int32 fHeight; | |
73c04bcf | 74 | UBiDiLevel fParagraphLevel; |
b75a7d8f A |
75 | }; |
76 | ||
77 | inline le_int32 Paragraph::getLineHeight() | |
78 | { | |
79 | return fLineHeight; | |
80 | } | |
81 | ||
82 | inline le_int32 Paragraph::getLineCount() | |
83 | { | |
84 | return fLineCount; | |
85 | } | |
86 | ||
87 | inline le_int32 Paragraph::getAscent() | |
88 | { | |
89 | return fAscent; | |
90 | } | |
91 | ||
92 | #endif | |
93 | ||
94 |