]> git.saurik.com Git - apple/icu.git/blame - icuSources/samples/layout/paragraph.h
ICU-57166.0.1.tar.gz
[apple/icu.git] / icuSources / samples / layout / paragraph.h
CommitLineData
b75a7d8f
A
1/*
2 *******************************************************************************
3 *
46f4442e 4 * Copyright (C) 1999-2007, International Business Machines
b75a7d8f
A
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"
73c04bcf 17#include "unicode/ubidi.h"
b75a7d8f
A
18
19#include "layout/LEFontInstance.h"
20#include "layout/ParagraphLayout.h"
21
22#include "GUISupport.h"
23#include "RenderingSurface.h"
b75a7d8f
A
24
25U_NAMESPACE_USE
26
27#define MARGIN 10
28
29#if 0
30class LineInfo;
31#endif
32
33class Paragraph
34{
35public:
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
48private:
73c04bcf 49 void addLine(const ParagraphLayout::Line *line);
b75a7d8f 50
73c04bcf
A
51 ParagraphLayout **fParagraphLayout;
52
53 le_int32 fParagraphCount;
54 le_int32 fParagraphMax;
55 le_int32 fParagraphGrow;
56
57 le_int32 fLineCount;
58 le_int32 fLinesMax;
59 le_int32 fLinesGrow;
b75a7d8f
A
60
61 const ParagraphLayout::Line **fLines;
62 LEUnicode *fChars;
63
64 le_int32 fLineHeight;
65 le_int32 fAscent;
66 le_int32 fWidth;
67 le_int32 fHeight;
73c04bcf 68 UBiDiLevel fParagraphLevel;
b75a7d8f
A
69};
70
71inline le_int32 Paragraph::getLineHeight()
72{
73 return fLineHeight;
74}
75
76inline le_int32 Paragraph::getLineCount()
77{
78 return fLineCount;
79}
80
81inline le_int32 Paragraph::getAscent()
82{
83 return fAscent;
84}
85
86#endif
87
88