2001-11-07 23:48:17 +00:00
|
|
|
/*
|
|
|
|
*******************************************************************************
|
|
|
|
*
|
2005-08-02 18:22:23 +00:00
|
|
|
* Copyright (C) 1999-2005, International Business Machines
|
2001-11-07 23:48:17 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
|
|
|
*******************************************************************************
|
|
|
|
* file name: Paragraph.h
|
|
|
|
*
|
|
|
|
* created on: 09/06/2000
|
|
|
|
* created by: Eric R. Mader
|
|
|
|
*/
|
|
|
|
#ifndef __PARAGRAPH_H
|
|
|
|
#define __PARAGRAPH_H
|
|
|
|
|
|
|
|
#include "unicode/utypes.h"
|
2005-08-09 00:54:54 +00:00
|
|
|
#include "unicode/ubidi.h"
|
2003-03-03 23:07:01 +00:00
|
|
|
|
|
|
|
#include "layout/LEFontInstance.h"
|
2003-04-23 23:05:00 +00:00
|
|
|
#include "layout/ParagraphLayout.h"
|
2001-11-07 23:48:17 +00:00
|
|
|
|
|
|
|
#include "GUISupport.h"
|
2003-03-03 23:07:01 +00:00
|
|
|
#include "RenderingSurface.h"
|
2003-05-07 21:42:38 +00:00
|
|
|
//#include "FontMap.h"
|
2001-11-07 23:48:17 +00:00
|
|
|
|
|
|
|
U_NAMESPACE_USE
|
|
|
|
|
|
|
|
#define MARGIN 10
|
|
|
|
|
2003-03-03 23:07:01 +00:00
|
|
|
#if 0
|
2002-12-05 22:50:29 +00:00
|
|
|
class LineInfo;
|
2003-03-03 23:07:01 +00:00
|
|
|
#endif
|
2001-11-07 23:48:17 +00:00
|
|
|
|
|
|
|
class Paragraph
|
|
|
|
{
|
|
|
|
public:
|
2003-11-04 21:30:00 +00:00
|
|
|
Paragraph(const LEUnicode chars[], le_int32 charCount, const FontRuns *fontRuns, LEErrorCode &status);
|
2001-11-07 23:48:17 +00:00
|
|
|
|
|
|
|
~Paragraph();
|
|
|
|
|
2002-12-05 22:50:29 +00:00
|
|
|
le_int32 getAscent();
|
|
|
|
le_int32 getLineHeight();
|
|
|
|
le_int32 getLineCount();
|
|
|
|
void breakLines(le_int32 width, le_int32 height);
|
|
|
|
void draw(RenderingSurface *surface, le_int32 firstLine, le_int32 lastLine);
|
2001-11-07 23:48:17 +00:00
|
|
|
|
2003-05-07 21:42:38 +00:00
|
|
|
static Paragraph *paragraphFactory(const char *fileName, const LEFontInstance *font, GUISupport *guiSupport);
|
2001-11-07 23:48:17 +00:00
|
|
|
|
|
|
|
private:
|
2005-08-09 00:54:54 +00:00
|
|
|
void addLine(const ParagraphLayout::Line *line);
|
|
|
|
|
2005-08-02 18:22:23 +00:00
|
|
|
ParagraphLayout **fParagraphLayout;
|
|
|
|
|
|
|
|
le_int32 fParagraphCount;
|
|
|
|
le_int32 fParagraphMax;
|
|
|
|
le_int32 fParagraphGrow;
|
|
|
|
|
|
|
|
le_int32 fLineCount;
|
|
|
|
le_int32 fLinesMax;
|
|
|
|
le_int32 fLinesGrow;
|
2003-03-03 23:07:01 +00:00
|
|
|
|
|
|
|
const ParagraphLayout::Line **fLines;
|
2003-05-07 21:42:38 +00:00
|
|
|
LEUnicode *fChars;
|
2001-11-07 23:48:17 +00:00
|
|
|
|
2002-12-05 22:50:29 +00:00
|
|
|
le_int32 fLineHeight;
|
|
|
|
le_int32 fAscent;
|
|
|
|
le_int32 fWidth;
|
|
|
|
le_int32 fHeight;
|
2005-08-09 00:54:54 +00:00
|
|
|
UBiDiLevel fParagraphLevel;
|
2002-12-05 22:50:29 +00:00
|
|
|
};
|
2001-11-07 23:48:17 +00:00
|
|
|
|
2002-12-05 22:50:29 +00:00
|
|
|
inline le_int32 Paragraph::getLineHeight()
|
|
|
|
{
|
|
|
|
return fLineHeight;
|
|
|
|
}
|
2001-11-07 23:48:17 +00:00
|
|
|
|
2002-12-05 22:50:29 +00:00
|
|
|
inline le_int32 Paragraph::getLineCount()
|
|
|
|
{
|
|
|
|
return fLineCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline le_int32 Paragraph::getAscent()
|
|
|
|
{
|
|
|
|
return fAscent;
|
|
|
|
}
|
2001-11-07 23:48:17 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|