Skip to content

TFormattingWriter

Abstract base class for formatted document writers

Declaration

Source position: wformat.pp line 32

type

  TFormattingWriter = class
  public
    constructor Create;
    function EscapeText : string;
    procedure Dump;
    procedure DumpLn;
    procedure Write;
    procedure WriteFmt;
    procedure DocumentStart;
    procedure DocumentEnd;
    procedure Header;
    procedure HeaderStart;
    procedure HeaderEnd;
    procedure ParagraphStart;
    procedure ParagraphEnd;
    procedure LineBreak;
    procedure Rule;
    procedure BoldStart;
    procedure BoldEnd;
    procedure ItalicStart;
    procedure ItalicEnd;
    procedure UnderlineStart;
    procedure UnderlineEnd;
    procedure PreformatStart;
    procedure PreformatEnd;
    procedure TableStart;
    procedure TableEnd;
    procedure RowStart;
    procedure RowEnd;
    procedure RowNext;
    procedure CellStart;
    procedure CellEnd;
    procedure CellNext;
    procedure HeaderCellStart;
    procedure HeaderCellEnd;
    procedure HeaderCellNext;
    procedure ListStart;
    procedure ListEnd;
    procedure ListItemStart;
    procedure ListItemEnd;
    procedure ListItem;
    procedure DefinitionItem;
    procedure WriteList;
  end;

Description

TFormattingWriter is an abstract base class that defines the interface for creating formatted documents. It provides methods for document structure (headers, paragraphs), text formatting (bold, italic, underline), tables, and lists. Descendant classes implement the specific formatting for different output formats such as HTML, LaTeX, or plain text.

The class writes output to a stream provided during construction. Most methods are virtual and should be overridden by descendant classes to provide format-specific implementation.

Methods

Member Visibility Description
BoldEnd public Ends bold text formatting
BoldStart public Begins bold text formatting
CellEnd public Ends the current table cell
CellNext public Moves to the next table cell
CellStart public Begins a new table cell
Create public Creates a new formatting writer instance
DefinitionItem public Creates a definition list item with name and description
DocumentEnd public Ends the current document
DocumentStart public Begins a new document
Dump public Writes raw text directly to the output stream
DumpLn public Writes raw text followed by line ending to the output stream
EscapeText public Escapes text for the target format
Header public Writes a complete header at the specified level
HeaderCellEnd public Ends the current table header cell
HeaderCellNext public Moves to the next table header cell
HeaderCellStart public Begins a new table header cell
HeaderEnd public Ends a header at the specified level
HeaderStart public Begins a header at the specified level
ItalicEnd public Ends italic text formatting
ItalicStart public Begins italic text formatting
LineBreak public Inserts a line break
ListEnd public Ends a list of the specified type
ListItem public Creates a complete list item with text
ListItemEnd public Ends the current list item
ListItemStart public Begins a new list item
ListStart public Begins a list of the specified type
ParagraphEnd public Ends the current paragraph
ParagraphStart public Begins a new paragraph
PreformatEnd public Ends preformatted text block
PreformatStart public Begins preformatted text block
RowEnd public Ends the current table row
RowNext public Moves to the next table row
RowStart public Begins a new table row
Rule public Inserts a horizontal rule
TableEnd public Ends the current table
TableStart public Begins a table with specified columns and border
UnderlineEnd public Ends underlined text formatting
UnderlineStart public Begins underlined text formatting
Write public Writes escaped text to the output stream
WriteFmt public Writes formatted text using Format function
WriteList public Writes a complete list from string list

See also

Name Description
TListType Enumeration defining supported list types