ContRap-Core
Public Member Functions | Protected Attributes

crp::XMLLayout Class Reference

Class XMLLayout is an abstract text layouter and printer of XML-formatted texts. More...

#include <xmllayout.h>

Public Member Functions

 XMLLayout (XMLDataPool *format)
 Creates an XMLLayout with the given set of glyphs, meta-rules and the glyph printer.
void set_format (XMLDataPool *format)
 Sets a new glyphs and rules format.
XMLLayoutBoxlayout_text (const std::string &text, XMLGlyphPrinter *printer)
 Layouts the given formatted text.

Protected Attributes

std::map< std::string, XMLRulerules
 Rules.

Detailed Description

Class XMLLayout is an abstract text layouter and printer of XML-formatted texts.

The layout is defined by a set of glyphs and a set of meta rules, which declare how glyphs are combined when printing a specific XML-tag.

The printing is done by an abstract interface XMLGlyphPrinter, which enables the XMLLayout to draw one unicode character with given style at the given position.

All the three components, the glyph description, the meta rules and the printer are parametrizable at runtime.


Constructor & Destructor Documentation

crp::XMLLayout::XMLLayout ( XMLDataPool format)

Creates an XMLLayout with the given set of glyphs, meta-rules and the glyph printer.

Parameters:
formatGlyphs and the meta rules

Member Function Documentation

XMLLayoutBox* crp::XMLLayout::layout_text ( const std::string &  text,
XMLGlyphPrinter printer 
)

Layouts the given formatted text.

You can choose a different glyph printer each time you call this method.

Parameters:
textText to layout
printerImplementation of the glyph printer
Returns:
Root layout box of the created layout
void crp::XMLLayout::set_format ( XMLDataPool format)

Sets a new glyphs and rules format.

Parameters:
formatGlyphs and the meta rules

Field Documentation

std::map<std::string, XMLRule> crp::XMLLayout::rules [protected]

Rules.


The documentation for this class was generated from the following file: