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