2001-11-07 23:48:17 +00:00
|
|
|
/*
|
|
|
|
*******************************************************************************
|
|
|
|
*
|
2003-03-03 23:07:01 +00:00
|
|
|
* Copyright (C) 1999-2003, 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"
|
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-03-03 23:07:01 +00:00
|
|
|
Paragraph(const LEUnicode chars[], le_int32 charCount, const FontRuns *fontRuns);
|
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:
|
2002-12-05 22:50:29 +00:00
|
|
|
ParagraphLayout *fParagraphLayout;
|
2001-11-22 01:43:53 +00:00
|
|
|
|
2002-12-05 22:50:29 +00:00
|
|
|
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;
|
|
|
|
};
|
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
|
|
|
|
|
|
|
|
|