ContRap-Core
|
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. | |
XMLLayoutBox * | layout_text (const std::string &text, XMLGlyphPrinter *printer) |
Layouts the given formatted text. | |
Protected Attributes | |
std::map< std::string, XMLRule > | rules |
Rules. |
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.
crp::XMLLayout::XMLLayout | ( | XMLDataPool * | format | ) |
Creates an XMLLayout with the given set of glyphs, meta-rules and the glyph printer.
format | Glyphs and the meta rules |
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.
text | Text to layout |
printer | Implementation of the glyph printer |
void crp::XMLLayout::set_format | ( | XMLDataPool * | format | ) |
Sets a new glyphs and rules format.
format | Glyphs and the meta rules |
std::map<std::string, XMLRule> crp::XMLLayout::rules [protected] |
Rules.