Class THTMLWriter (unit HTMLWrtr)

Inherits from

TComponent

The HTML writer class that allows HTML to be generated

Constructors


constructor Create(AOwner: TComponent);

Read only

***************************************************************************** HTMLWriter functions and procedures } { Create HTML writer component



Functions

procedure Base(sUrl: String);

Write base directive

procedure BaseFont(iSize: THTMLFontSize);

Write base font

procedure Body;

Write start of HTML body

procedure BodyParams(sImage: String; clrBackground, clrText, clrLinks, clrVisited, clrActive: TColor; bFixed: Boolean);

HTML body procedures

Write start of HTML body, with optional parameters


procedure CheckboxField(sName, sValue: String; bChecked: Boolean);

Write check box field on form

procedure Comment(sText: String);

Write HTML comment

procedure Content(sContent: String);

Procedures to write text to Destination with appropriate HTML tags } { HTML header procedures

Write content type


destructor Destroy;

Release resources

procedure EscapeText(sText: String);

Write text straight to output, converting reserved characters

procedure EscapeTextList(slText: TStringList);

Write list of text straight to output, converting reserved characters

procedure Finalise;

And tidy up

***************************************************************************** HTML miscellaneous functions and procedures } { Finish off HTML document


procedure Font(sText: String; iSize: THTMLFontSize; fcChange: THTMLFontChange; sFace: String; clrColour: TColor);

Write font change

procedure FontEnd;

Write end of font change

procedure FontStart(iSize: THTMLFontSize; fcChange: THTMLFontChange; sFace: String; clrColour: TColor);

Write start of font change

function FormatBase(sUrl: String): String;

Return base directive as string

function FormatBaseFont(iSize: THTMLFontSize): String;

Return base font as string

function FormatBody: String;

Return start of HTML body as string

function FormatBodyParams(sImage: String; clrBackground, clrText, clrLinks, clrVisited, clrActive: TColor; bFixed: Boolean): String;

HTML body functions

***************************************************************************** HTML body functions and procedures } { Return start of HTML body, with optional parameters, as string


function FormatCheckboxField(sName, sValue: String; bChecked: Boolean): String;

Return check box field on form as string

function FormatComment(sText: String): String;

Return HTML comment as string

function FormatContent(sContent: String): String;

Functions to format text with appropriate HTML tags, returned as strings } { HTML header functions

***************************************************************************** HTML header functions and procedures } { Return content type as string - default to text/html


function FormatEscapeText(sText: String): String;

HTML bulk insertion functions

Return text after converting reserved characters


function FormatFont(sText: String; iSize: THTMLFontSize; fcChange: THTMLFontChange; sFace: String; clrColour: TColor): String;

Return font change as string

function FormatFontEnd: String;

Return end of font change as string

function FormatFontStart(iSize: THTMLFontSize; fcChange: THTMLFontChange; sFace: String; clrColour: TColor): String;

Return start of font change as string

function FormatFormEnd: String;

Return end of form as string

function FormatFormStart(sUrl: String; fmMethod: THTMLFormMethod): String;

HTML form functions

***************************************************************************** HTML form functions and procedures } { Return start of form as string


function FormatHead: String;

Return start of HTML document as string

function FormatHeading(iLevel: THTMLHeadingLevel; sHeading: String; ahAlign: THTMLAlignHoriz): String;

Return heading as string

function FormatHeadingEnd(iLevel: THTMLHeadingLevel): String;

Return end of heading as string

function FormatHeadingStart(iLevel: THTMLHeadingLevel; ahAlign: THTMLAlignHoriz): String;

HTML basic formatting functions

***************************************************************************** HTML basic formatting functions and procedures } { Return start of heading as string


function FormatHiddenField(sName, sValue: String): String;

Return hidden field on form as string

function FormatHorizRule: String;

Return default horizontal rule as string

function FormatHorizRuleParams(iSize: Byte; iWidth: Integer; ahAlign: THTMLAlignHoriz; bNoShade: Boolean; crClear: THTMLClear): String;

HTML line break functions

***************************************************************************** HTML line break functions and procedures } { Return horizontal rule with parameters as string


function FormatImage(sImage, sAlt: String; aiAlign: THTMLAlignImage): String;

Return image as string

function FormatImageField(sName, sImage: String; ahAlign: THTMLAlignHoriz; iBorder: Byte): String;

Return image field on form as string

function FormatImageParams(sImage, sAlt, sMap: String; aiAlign: THTMLAlignImage; iHeight, iWidth: Integer; iHSpace, iVSpace, iBorder: Byte; bIsMap: Boolean): String;

HTML image processing functions

***************************************************************************** HTML image processing functions and procedures } { Return image, with all parameters, as string


function FormatIsIndex: String;

Return isindex directive as string

function FormatLineBreak(crClear: THTMLClear): String;

Return line break as string

function FormatLink(sUrl, sName, sText: String): String;

Return link as string

function FormatLinkEnd: String;

Return end of link as string

function FormatLinkStart(sUrl, sName: String): String;

HTML link functions

***************************************************************************** HTML link functions and procedures } { Return start of link as string


function FormatListEnd(ltList: THTMLListType): String;

Return end of list as string

function FormatListItem(liItem: THTMLListItem; sText: String): String;

Return list element as string

function FormatListItemParams(liItem: THTMLListItem; sText: String; nsNum: THTMLNumberScheme; iValue: Byte): String;

Return list element with parameters as string

function FormatListStart(ltList: THTMLListType): String;

Return start of list as string

function FormatListStartParams(ltList: THTMLListType; nsNum: THTMLNumberScheme; iStart: Byte): String;

HTML list processing functions

***************************************************************************** HTML list processing functions and procedures } { Return start of list with parameters as string


function FormatMapArea(shShape: THTMLShapes; iCoords: array of Integer; sUrl, sAlt: String): String;

Return area for inline map as string

function FormatMapEnd: String;

Return end of inline map as string

function FormatMapStart(sName: String): String;

Return start of inline map as string

function FormatMarquee(sText: String; avAlign: THTMLAlignVert; iHeight, iWidth: Integer; iHSpace, iVSpace, iScrollAmount: Byte; iScrollDelay: Integer; mbBehave: THTMLMarqueeBehave; mdDir: THTMLMarqueeDirection; iLoop: Byte; clrColour: TColor): String;

Return marquee as string

function FormatMarqueeEnd: String;

Return end of marquee as string

function FormatMarqueeStart(avAlign: THTMLAlignVert; iHeight, iWidth: Integer; iHSpace, iVSpace, iScrollAmount: Byte; iScrollDelay: Integer; mbBehave: THTMLMarqueeBehave; mdDir: THTMLMarqueeDirection; iLoop: Byte; clrColour: TColor): String;

Return start of marquee as string

function FormatMeta(sName, sHttpEquiv, sContent: String): String;

Return meta directive as string

function FormatParagraph(sText: String; ahAlign: THTMLAlignHoriz): String;

Return parargraph as string

function FormatParagraphEnd: String;

Return end of paragraph as string

function FormatParagraphStart(ahAlign: THTMLAlignHoriz): String;

Return start of paragraph as string

function FormatPasswordField(sName, sDefault: String; iSize, iMaxLength: Byte): String;

Return password field on form as string

function FormatRadioField(sName, sValue: String; bChecked: Boolean): String;

Return radio button field on form as string

function FormatResetField(sLabel: String): String;

Return reset button on form as string

function FormatSelectEnd: String;

Return end of select field on form as string

function FormatSelectOption(sText, sValue: String; bSelected: Boolean): String;

Return select field option on form as string

function FormatSelectStart(sName: String; iSize: Byte; bMultiple: Boolean): String;

Return start of select field on form as string

function FormatSound(sUrl: String; iLoop: Byte): String;

Return background sound as string

function FormatSpecialChar(scSpecial: THTMLSpecialChar): String;

Return special character as string

function FormatSpecialCharValue(iValue: Byte): String;

Return special character by value as string

function FormatSubmitField(sName, sLabel: String): String;

Return submit button on form as string

function FormatTableCell(sText: String): String;

Return table cell as string

function FormatTableCellEnd: String;

Return end of table cell as string

function FormatTableCellParams(sText: String; iRowSpan, iColSpan: Byte; iWidth: Integer; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor): String;

Return table cell with parameters as string

function FormatTableCellStart: String;

Return start of table cell as string

function FormatTableCellStartParams(iRowSpan, iColSpan: Byte; iWidth: Integer; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor): String;

Return start of table cell with parameters as string

function FormatTableEnd: String;

Return end of table as string

function FormatTableHeading(sHeading: String): String;

Return table heading as string

function FormatTableHeadingEnd: String;

Return end of table heading as string

function FormatTableHeadingParams(sHeading: String; iRowSpan, iColSpan: Byte; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor): String;

Return table heading with parameters as string

function FormatTableHeadingStart: String;

Return start of table heading as string

function FormatTableHeadingStartParams(iRowSpan, iColSpan: Byte; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor): String;

Return start of table heading with parameters as string

function FormatTableRowEnd: String;

Return end of table row as string

function FormatTableRowStart: String;

Return start of table row as string

function FormatTableRowStartParams(ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor): String;

Return start of table row with parameters as string

function FormatTableStart(iBorder: Byte; iWidth: Integer): String;

Return start of table as string

function FormatTableStartParams(iBorder: Byte; iWidth: Integer; iCellSpacing, iCellPadding: Byte; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor; sCaption: String; ahCaptionHAlign: THTMLAlignHoriz; avCaptionVAlign: THTMLAlignVert): String;

HTML table functions

Return start of table as string


function FormatTextArea(sName, sDefault: String; iRows, iCols: Byte): String;

Return text area field on form as string

function FormatTextAreaEnd: String;

Return end of text area field on form as string

function FormatTextAreaStart(sName: String; iRows, iCols: Byte): String;

Return start of text area field on form as string

function FormatTextEffect(efEffect: THTMLTextEffect; sText: String): String;

Return text formatting as string

function FormatTextEffectEnd(efEffect: THTMLTextEffect): String;

Return end of text formatting as string

function FormatTextEffectStart(efEffect: THTMLTextEffect): String;

HTML character formatting functions

***************************************************************************** HTML character formatting functions and procedures } { Return start of text formatting as string


function FormatTextField(sName, sDefault: String; iSize, iMaxLength: Byte): String;

Return text field on form as string

function FormatTitle(sTitle: String): String;

Return page title as string

function FormatWordBreak: String;

Return work break as string

procedure FormEnd;

Write end of form

procedure FormStart(sUrl: String; fmMethod: THTMLFormMethod);

HTML form procedures

Write start of form


procedure Head;

Write start of HTML document

procedure Heading(iLevel: THTMLHeadingLevel; sHeading: String; ahAlign: THTMLAlignHoriz);

Write heading

procedure HeadingEnd(iLevel: THTMLHeadingLevel);

Write end of heading

procedure HeadingStart(iLevel: THTMLHeadingLevel; ahAlign: THTMLAlignHoriz);

HTML basic formatting procedures

Write start of heading


procedure HiddenField(sName, sValue: String);

Write hidden field on form

procedure HorizRule;

Write default horizontal rule

procedure HorizRuleParams(iSize: Byte; iWidth: Integer; ahAlign: THTMLAlignHoriz; bNoShade: Boolean; crClear: THTMLClear);

HTML line break procedures

Write horizontal rule with parameters


procedure Image(sImage, sAlt: String; aiAlign: THTMLAlignImage);

Write image

procedure ImageField(sName, sImage: String; ahAlign: THTMLAlignHoriz; iBorder: Byte);

Write image field on form

procedure ImageParams(sImage, sAlt, sMap: String; aiAlign: THTMLAlignImage; iHeight, iWidth: Integer; iHSpace, iVSpace, iBorder: Byte; bIsMap: Boolean);

HTML image processing procedures

Write image, with all parameters


procedure Initialise;

Initialise internal flags, etc.

procedure InsertFile(sFileName: String);

Write the contents of a file straight to output

procedure IsIndex;

Write isindex directive

procedure LineBreak(crClear: THTMLClear);

Write line break

procedure Link(sUrl, sName, sText: String);

Write link

procedure LinkEnd;

Write end of link

procedure LinkStart(sUrl, sName: String);

HTML link procedures

Write start of link


procedure ListEnd(ltList: THTMLListType);

Write end of list

procedure ListItem(liItem: THTMLListItem; sText: String);

Write list element

procedure ListItemParams(liItem: THTMLListItem; sText: String; nsNum: THTMLNumberScheme; iValue: Byte);

Write list element with parameters

procedure ListStart(ltList: THTMLListType);

Write start of list

procedure ListStartParams(ltList: THTMLListType; nsNum: THTMLNumberScheme; iStart: Byte);

HTML list procedures

Write start of list with parameters


procedure MapArea(shShape: THTMLShapes; iCoords: array of Integer; sUrl, sAlt: String);

Write area for inline map

procedure MapEnd;

Write end of inline map

procedure MapStart(sName: String);

Write start of inline map

procedure Marquee(sText: String; avAlign: THTMLAlignVert; iHeight, iWidth: Integer; iHSpace, iVSpace, iScrollAmount: Byte; iScrollDelay: Integer; mbBehave: THTMLMarqueeBehave; mdDir: THTMLMarqueeDirection; iLoop: Byte; clrColour: TColor);

Write marquee

procedure MarqueeEnd;

Write end of marquee

procedure MarqueeStart(avAlign: THTMLAlignVert; iHeight, iWidth: Integer; iHSpace, iVSpace, iScrollAmount: Byte; iScrollDelay: Integer; mbBehave: THTMLMarqueeBehave; mdDir: THTMLMarqueeDirection; iLoop: Byte; clrColour: TColor);

Write start of marquee

procedure MergeFile(sFileName: String; dicDictionary: THTMLDictionary);

Write the contents of a file to output, replacing values as directed in dictionary - Substitution points are specified between the braces, with the contents being '^' followed by a filename, or just a variable name.

procedure Meta(sName, sHttpEquiv, sContent: String);

Write meta directive

procedure Paragraph(sText: String; ahAlign: THTMLAlignHoriz);

Write paragraph

procedure ParagraphEnd;

Write end of paragraph

procedure ParagraphStart(ahAlign: THTMLAlignHoriz);

Write start of paragraph

procedure PasswordField(sName, sDefault: String; iSize, iMaxLength: Byte);

Write password field on form

procedure RadioField(sName, sValue: String; bChecked: Boolean);

Write radio button field on form

procedure ResetField(sLabel: String);

Write reset button on form

procedure SelectEnd;

Write end of select field on form

procedure SelectOption(sText, sValue: String; bSelected: Boolean);

Write select field option on form

procedure SelectStart(sName: String; iSize: Byte; bMultiple: Boolean);

Write start of select field on form

procedure Sound(sUrl: String; iLoop: Byte);

Write background sound

procedure SpecialChar(scSpecial: THTMLSpecialChar);

Write special character

procedure SpecialCharValue(iValue: Byte);

Write special character by value

procedure SubmitField(sName, sLabel: String);

Write submit button on form

procedure TableCell(sText: String);

Write table cell

procedure TableCellEnd;

Write end of table cell

procedure TableCellParams(sText: String; iRowSpan, iColSpan: Byte; iWidth: Integer; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor);

Write table cell with parameters

procedure TableCellStart;

Write start of table cell

procedure TableCellStartParams(iRowSpan, iColSpan: Byte; iWidth: Integer; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor);

Write start of table cell with parameters

procedure TableEnd;

Write end of table

procedure TableHeading(sHeading: String);

Write table heading

procedure TableHeadingEnd;

Write end of table heading

procedure TableHeadingParams(sHeading: String; iRowSpan, iColSpan: Byte; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor);

Write table heading with parameters

procedure TableHeadingStart;

Write start of table heading

procedure TableHeadingStartParams(iRowSpan, iColSpan: Byte; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor);

Write start of table heading with parameters

procedure TableRowEnd;

Write end of table row

procedure TableRowStart;

Write start of table row

procedure TableRowStartParams(ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor);

Write start of table row with parameters

procedure TableStart(iBorder: Byte; iWidth: Integer);

Write start of table

procedure TableStartParams(iBorder: Byte; iWidth: Integer; iCellSpacing, iCellPadding: Byte; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor; sCaption: String; ahCaptionHAlign: THTMLAlignHoriz; avCaptionVAlign: THTMLAlignVert);

HTML table procedures

Write start of table with all parameters


procedure Text(sText: String);

HTML bulk insertion procedures

***************************************************************************** HTML bulk insertion functions and procedures } { Write text straight to output


procedure TextArea(sName, sDefault: String; iRows, iCols: Byte);

Write text area field on form

procedure TextAreaEnd;

Write end of text area field on form

procedure TextAreaStart(sName: String; iRows, iCols: Byte);

Write start of text area field on form

procedure TextEffect(efEffect: THTMLTextEffect; sText: String);

Write text formatting

procedure TextEffectEnd(efEffect: THTMLTextEffect);

Write end of text formatting

procedure TextEffectStart(efEffect: THTMLTextEffect);

HTML character formatting procedures

Write start of text formatting


procedure TextField(sName, sDefault: String; iSize, iMaxLength: Byte);

Write text field on form

procedure TextList(slText: TStringList);

Write list of text straight to output

procedure Title(sTitle: String);

Write page title

procedure WordBreak;

Write word break

procedure CheckBorderColours(clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor; sResult: String);

Check if border colours used - warn if required

procedure CheckClosing(tcTag: THTMLTagCategory; bNotThere: Boolean; sTag, sText: String);

Check that the tag can be closed successfully

procedure CheckField;

Check positioning of fields

function CheckIfPercentage(sText: String; iValue: Integer): String;

Return the text and value as a string - allowing for percentages

procedure CheckNesting(tcTag: THTMLTagCategory; bAllowedInHead, bAllowedInBody, bAllowedInMap, bAllowedInTable, bAllowedInForm: Boolean);

Check that the tag is in the correct part of the document

function ConvertColour(clrColour: TColor): String;

Convert from Delphi colour value to HTML colour value

function FormatBorderColours(clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor): String;

***************************************************************************** HTML table functions and procedures } { Return border colours as string

function FormatInputField(ifField: THTMLInputField; sName, sValue: String; bChecked: Boolean; iSize, iMaxLength: Byte; sImage: String; ahAlign: THTMLAlignHoriz; iBorder: Byte): String;

Return input field on form as string

procedure SetFilename(sFilename: String);

Set up a new destination for the HTML

Properties

property Errors : THTMLErrorSet


property Filename : String

Published declarations

property IncludeMIMEType : Boolean


property Version : String

Public declarations

Events

Variables

bBulkInsert : Boolean;


bInBody : Boolean;


bInForm : Boolean;


bInHead : Boolean;


bInLink : Boolean;


bInMap : Boolean;


bInSelect : Boolean;


bInTextArea : Boolean;


bSelectOption : Boolean;


bSubmit : Boolean;


bWrittenArea : Boolean;


bWrittenBase : Boolean;


bWrittenContent : Boolean;


bWrittenHead : Boolean;


bWrittenIsIndex : Boolean;


bWrittenTitle : Boolean;


FErrors : THTMLErrorSet;


FFilename : String;

Private declarations

FIncludeMIMEType : Boolean;


fOutput : TextFile;


FVersion : String;


iCurHeadingLevel : Byte;


iCurList : Byte;


iLastHeadingLevel : Byte;


iTableLevels : Byte;


recListCheck : array [1..20] of THTMLListCheck;


sTags : TStringList;



Constructors


constructor Create(AOwner: TComponent);

Read only

***************************************************************************** HTMLWriter functions and procedures } { Create HTML writer component


Functions


procedure Base(sUrl: String);

Write base directive


procedure BaseFont(iSize: THTMLFontSize);

Write base font


procedure Body;

Write start of HTML body


procedure BodyParams(sImage: String; clrBackground, clrText, clrLinks, clrVisited, clrActive: TColor; bFixed: Boolean);

HTML body procedures

Write start of HTML body, with optional parameters


procedure CheckboxField(sName, sValue: String; bChecked: Boolean);

Write check box field on form


procedure Comment(sText: String);

Write HTML comment


procedure Content(sContent: String);

Procedures to write text to Destination with appropriate HTML tags } { HTML header procedures

Write content type


destructor Destroy;

Release resources


procedure EscapeText(sText: String);

Write text straight to output, converting reserved characters


procedure EscapeTextList(slText: TStringList);

Write list of text straight to output, converting reserved characters


procedure Finalise;

And tidy up

***************************************************************************** HTML miscellaneous functions and procedures } { Finish off HTML document


procedure Font(sText: String; iSize: THTMLFontSize; fcChange: THTMLFontChange; sFace: String; clrColour: TColor);

Write font change


procedure FontEnd;

Write end of font change


procedure FontStart(iSize: THTMLFontSize; fcChange: THTMLFontChange; sFace: String; clrColour: TColor);

Write start of font change


function FormatBase(sUrl: String): String;

Return base directive as string


function FormatBaseFont(iSize: THTMLFontSize): String;

Return base font as string


function FormatBody: String;

Return start of HTML body as string


function FormatBodyParams(sImage: String; clrBackground, clrText, clrLinks, clrVisited, clrActive: TColor; bFixed: Boolean): String;

HTML body functions

***************************************************************************** HTML body functions and procedures } { Return start of HTML body, with optional parameters, as string


function FormatCheckboxField(sName, sValue: String; bChecked: Boolean): String;

Return check box field on form as string


function FormatComment(sText: String): String;

Return HTML comment as string


function FormatContent(sContent: String): String;

Functions to format text with appropriate HTML tags, returned as strings } { HTML header functions

***************************************************************************** HTML header functions and procedures } { Return content type as string - default to text/html


function FormatEscapeText(sText: String): String;

HTML bulk insertion functions

Return text after converting reserved characters


function FormatFont(sText: String; iSize: THTMLFontSize; fcChange: THTMLFontChange; sFace: String; clrColour: TColor): String;

Return font change as string


function FormatFontEnd: String;

Return end of font change as string


function FormatFontStart(iSize: THTMLFontSize; fcChange: THTMLFontChange; sFace: String; clrColour: TColor): String;

Return start of font change as string


function FormatFormEnd: String;

Return end of form as string


function FormatFormStart(sUrl: String; fmMethod: THTMLFormMethod): String;

HTML form functions

***************************************************************************** HTML form functions and procedures } { Return start of form as string


function FormatHead: String;

Return start of HTML document as string


function FormatHeading(iLevel: THTMLHeadingLevel; sHeading: String; ahAlign: THTMLAlignHoriz): String;

Return heading as string


function FormatHeadingEnd(iLevel: THTMLHeadingLevel): String;

Return end of heading as string


function FormatHeadingStart(iLevel: THTMLHeadingLevel; ahAlign: THTMLAlignHoriz): String;

HTML basic formatting functions

***************************************************************************** HTML basic formatting functions and procedures } { Return start of heading as string


function FormatHiddenField(sName, sValue: String): String;

Return hidden field on form as string


function FormatHorizRule: String;

Return default horizontal rule as string


function FormatHorizRuleParams(iSize: Byte; iWidth: Integer; ahAlign: THTMLAlignHoriz; bNoShade: Boolean; crClear: THTMLClear): String;

HTML line break functions

***************************************************************************** HTML line break functions and procedures } { Return horizontal rule with parameters as string


function FormatImage(sImage, sAlt: String; aiAlign: THTMLAlignImage): String;

Return image as string


function FormatImageField(sName, sImage: String; ahAlign: THTMLAlignHoriz; iBorder: Byte): String;

Return image field on form as string


function FormatImageParams(sImage, sAlt, sMap: String; aiAlign: THTMLAlignImage; iHeight, iWidth: Integer; iHSpace, iVSpace, iBorder: Byte; bIsMap: Boolean): String;

HTML image processing functions

***************************************************************************** HTML image processing functions and procedures } { Return image, with all parameters, as string


function FormatIsIndex: String;

Return isindex directive as string


function FormatLineBreak(crClear: THTMLClear): String;

Return line break as string


function FormatLink(sUrl, sName, sText: String): String;

Return link as string


function FormatLinkEnd: String;

Return end of link as string


function FormatLinkStart(sUrl, sName: String): String;

HTML link functions

***************************************************************************** HTML link functions and procedures } { Return start of link as string


function FormatListEnd(ltList: THTMLListType): String;

Return end of list as string


function FormatListItem(liItem: THTMLListItem; sText: String): String;

Return list element as string


function FormatListItemParams(liItem: THTMLListItem; sText: String; nsNum: THTMLNumberScheme; iValue: Byte): String;

Return list element with parameters as string


function FormatListStart(ltList: THTMLListType): String;

Return start of list as string


function FormatListStartParams(ltList: THTMLListType; nsNum: THTMLNumberScheme; iStart: Byte): String;

HTML list processing functions

***************************************************************************** HTML list processing functions and procedures } { Return start of list with parameters as string


function FormatMapArea(shShape: THTMLShapes; iCoords: array of Integer; sUrl, sAlt: String): String;

Return area for inline map as string


function FormatMapEnd: String;

Return end of inline map as string


function FormatMapStart(sName: String): String;

Return start of inline map as string


function FormatMarquee(sText: String; avAlign: THTMLAlignVert; iHeight, iWidth: Integer; iHSpace, iVSpace, iScrollAmount: Byte; iScrollDelay: Integer; mbBehave: THTMLMarqueeBehave; mdDir: THTMLMarqueeDirection; iLoop: Byte; clrColour: TColor): String;

Return marquee as string


function FormatMarqueeEnd: String;

Return end of marquee as string


function FormatMarqueeStart(avAlign: THTMLAlignVert; iHeight, iWidth: Integer; iHSpace, iVSpace, iScrollAmount: Byte; iScrollDelay: Integer; mbBehave: THTMLMarqueeBehave; mdDir: THTMLMarqueeDirection; iLoop: Byte; clrColour: TColor): String;

Return start of marquee as string


function FormatMeta(sName, sHttpEquiv, sContent: String): String;

Return meta directive as string


function FormatParagraph(sText: String; ahAlign: THTMLAlignHoriz): String;

Return parargraph as string


function FormatParagraphEnd: String;

Return end of paragraph as string


function FormatParagraphStart(ahAlign: THTMLAlignHoriz): String;

Return start of paragraph as string


function FormatPasswordField(sName, sDefault: String; iSize, iMaxLength: Byte): String;

Return password field on form as string


function FormatRadioField(sName, sValue: String; bChecked: Boolean): String;

Return radio button field on form as string


function FormatResetField(sLabel: String): String;

Return reset button on form as string


function FormatSelectEnd: String;

Return end of select field on form as string


function FormatSelectOption(sText, sValue: String; bSelected: Boolean): String;

Return select field option on form as string


function FormatSelectStart(sName: String; iSize: Byte; bMultiple: Boolean): String;

Return start of select field on form as string


function FormatSound(sUrl: String; iLoop: Byte): String;

Return background sound as string


function FormatSpecialChar(scSpecial: THTMLSpecialChar): String;

Return special character as string


function FormatSpecialCharValue(iValue: Byte): String;

Return special character by value as string


function FormatSubmitField(sName, sLabel: String): String;

Return submit button on form as string


function FormatTableCell(sText: String): String;

Return table cell as string


function FormatTableCellEnd: String;

Return end of table cell as string


function FormatTableCellParams(sText: String; iRowSpan, iColSpan: Byte; iWidth: Integer; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor): String;

Return table cell with parameters as string


function FormatTableCellStart: String;

Return start of table cell as string


function FormatTableCellStartParams(iRowSpan, iColSpan: Byte; iWidth: Integer; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor): String;

Return start of table cell with parameters as string


function FormatTableEnd: String;

Return end of table as string


function FormatTableHeading(sHeading: String): String;

Return table heading as string


function FormatTableHeadingEnd: String;

Return end of table heading as string


function FormatTableHeadingParams(sHeading: String; iRowSpan, iColSpan: Byte; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor): String;

Return table heading with parameters as string


function FormatTableHeadingStart: String;

Return start of table heading as string


function FormatTableHeadingStartParams(iRowSpan, iColSpan: Byte; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor): String;

Return start of table heading with parameters as string


function FormatTableRowEnd: String;

Return end of table row as string


function FormatTableRowStart: String;

Return start of table row as string


function FormatTableRowStartParams(ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor): String;

Return start of table row with parameters as string


function FormatTableStart(iBorder: Byte; iWidth: Integer): String;

Return start of table as string


function FormatTableStartParams(iBorder: Byte; iWidth: Integer; iCellSpacing, iCellPadding: Byte; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor; sCaption: String; ahCaptionHAlign: THTMLAlignHoriz; avCaptionVAlign: THTMLAlignVert): String;

HTML table functions

Return start of table as string


function FormatTextArea(sName, sDefault: String; iRows, iCols: Byte): String;

Return text area field on form as string


function FormatTextAreaEnd: String;

Return end of text area field on form as string


function FormatTextAreaStart(sName: String; iRows, iCols: Byte): String;

Return start of text area field on form as string


function FormatTextEffect(efEffect: THTMLTextEffect; sText: String): String;

Return text formatting as string


function FormatTextEffectEnd(efEffect: THTMLTextEffect): String;

Return end of text formatting as string


function FormatTextEffectStart(efEffect: THTMLTextEffect): String;

HTML character formatting functions

***************************************************************************** HTML character formatting functions and procedures } { Return start of text formatting as string


function FormatTextField(sName, sDefault: String; iSize, iMaxLength: Byte): String;

Return text field on form as string


function FormatTitle(sTitle: String): String;

Return page title as string


function FormatWordBreak: String;

Return work break as string


procedure FormEnd;

Write end of form


procedure FormStart(sUrl: String; fmMethod: THTMLFormMethod);

HTML form procedures

Write start of form


procedure Head;

Write start of HTML document


procedure Heading(iLevel: THTMLHeadingLevel; sHeading: String; ahAlign: THTMLAlignHoriz);

Write heading


procedure HeadingEnd(iLevel: THTMLHeadingLevel);

Write end of heading


procedure HeadingStart(iLevel: THTMLHeadingLevel; ahAlign: THTMLAlignHoriz);

HTML basic formatting procedures

Write start of heading


procedure HiddenField(sName, sValue: String);

Write hidden field on form


procedure HorizRule;

Write default horizontal rule


procedure HorizRuleParams(iSize: Byte; iWidth: Integer; ahAlign: THTMLAlignHoriz; bNoShade: Boolean; crClear: THTMLClear);

HTML line break procedures

Write horizontal rule with parameters


procedure Image(sImage, sAlt: String; aiAlign: THTMLAlignImage);

Write image


procedure ImageField(sName, sImage: String; ahAlign: THTMLAlignHoriz; iBorder: Byte);

Write image field on form


procedure ImageParams(sImage, sAlt, sMap: String; aiAlign: THTMLAlignImage; iHeight, iWidth: Integer; iHSpace, iVSpace, iBorder: Byte; bIsMap: Boolean);

HTML image processing procedures

Write image, with all parameters


procedure Initialise;

Initialise internal flags, etc., for a new document


procedure InsertFile(sFileName: String);

Write the contents of a file straight to output


procedure IsIndex;

Write isindex directive


procedure LineBreak(crClear: THTMLClear);

Write line break


procedure Link(sUrl, sName, sText: String);

Write link


procedure LinkEnd;

Write end of link


procedure LinkStart(sUrl, sName: String);

HTML link procedures

Write start of link


procedure ListEnd(ltList: THTMLListType);

Write end of list


procedure ListItem(liItem: THTMLListItem; sText: String);

Write list element


procedure ListItemParams(liItem: THTMLListItem; sText: String; nsNum: THTMLNumberScheme; iValue: Byte);

Write list element with parameters


procedure ListStart(ltList: THTMLListType);

Write start of list


procedure ListStartParams(ltList: THTMLListType; nsNum: THTMLNumberScheme; iStart: Byte);

HTML list procedures

Write start of list with parameters


procedure MapArea(shShape: THTMLShapes; iCoords: array of Integer; sUrl, sAlt: String);

Write area for inline map


procedure MapEnd;

Write end of inline map


procedure MapStart(sName: String);

Write start of inline map


procedure Marquee(sText: String; avAlign: THTMLAlignVert; iHeight, iWidth: Integer; iHSpace, iVSpace, iScrollAmount: Byte; iScrollDelay: Integer; mbBehave: THTMLMarqueeBehave; mdDir: THTMLMarqueeDirection; iLoop: Byte; clrColour: TColor);

Write marquee


procedure MarqueeEnd;

Write end of marquee


procedure MarqueeStart(avAlign: THTMLAlignVert; iHeight, iWidth: Integer; iHSpace, iVSpace, iScrollAmount: Byte; iScrollDelay: Integer; mbBehave: THTMLMarqueeBehave; mdDir: THTMLMarqueeDirection; iLoop: Byte; clrColour: TColor);

Write start of marquee


procedure MergeFile(sFileName: String; dicDictionary: THTMLDictionary);

Write the contents of a file to output, replacing values as directed in dictionary - Substitution points are specified between the braces, with the contents being '^' followed by a filename, or just a variable name. If specified, the file is merged recursively, otherwise the variable's value is inserted and processed recursively. An opening brace followed immediately by another opening brace or a closing brace is replaced by the second character.


procedure Meta(sName, sHttpEquiv, sContent: String);

Write meta directive


procedure Paragraph(sText: String; ahAlign: THTMLAlignHoriz);

Write paragraph


procedure ParagraphEnd;

Write end of paragraph


procedure ParagraphStart(ahAlign: THTMLAlignHoriz);

Write start of paragraph


procedure PasswordField(sName, sDefault: String; iSize, iMaxLength: Byte);

Write password field on form


procedure RadioField(sName, sValue: String; bChecked: Boolean);

Write radio button field on form


procedure ResetField(sLabel: String);

Write reset button on form


procedure SelectEnd;

Write end of select field on form


procedure SelectOption(sText, sValue: String; bSelected: Boolean);

Write select field option on form


procedure SelectStart(sName: String; iSize: Byte; bMultiple: Boolean);

Write start of select field on form


procedure Sound(sUrl: String; iLoop: Byte);

Write background sound


procedure SpecialChar(scSpecial: THTMLSpecialChar);

Write special character


procedure SpecialCharValue(iValue: Byte);

Write special character by value


procedure SubmitField(sName, sLabel: String);

Write submit button on form


procedure TableCell(sText: String);

Write table cell


procedure TableCellEnd;

Write end of table cell


procedure TableCellParams(sText: String; iRowSpan, iColSpan: Byte; iWidth: Integer; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor);

Write table cell with parameters


procedure TableCellStart;

Write start of table cell


procedure TableCellStartParams(iRowSpan, iColSpan: Byte; iWidth: Integer; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor);

Write start of table cell with parameters


procedure TableEnd;

Write end of table


procedure TableHeading(sHeading: String);

Write table heading


procedure TableHeadingEnd;

Write end of table heading


procedure TableHeadingParams(sHeading: String; iRowSpan, iColSpan: Byte; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor);

Write table heading with parameters


procedure TableHeadingStart;

Write start of table heading


procedure TableHeadingStartParams(iRowSpan, iColSpan: Byte; ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor);

Write start of table heading with parameters


procedure TableRowEnd;

Write end of table row


procedure TableRowStart;

Write start of table row


procedure TableRowStartParams(ahAlign: THTMLAlignHoriz; avAlign: THTMLAlignVert; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor);

Write start of table row with parameters


procedure TableStart(iBorder: Byte; iWidth: Integer);

Write start of table


procedure TableStartParams(iBorder: Byte; iWidth: Integer; iCellSpacing, iCellPadding: Byte; clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor; sCaption: String; ahCaptionHAlign: THTMLAlignHoriz; avCaptionVAlign: THTMLAlignVert);

HTML table procedures

Write start of table with all parameters


procedure Text(sText: String);

HTML bulk insertion procedures

***************************************************************************** HTML bulk insertion functions and procedures } { Write text straight to output


procedure TextArea(sName, sDefault: String; iRows, iCols: Byte);

Write text area field on form


procedure TextAreaEnd;

Write end of text area field on form


procedure TextAreaStart(sName: String; iRows, iCols: Byte);

Write start of text area field on form


procedure TextEffect(efEffect: THTMLTextEffect; sText: String);

Write text formatting


procedure TextEffectEnd(efEffect: THTMLTextEffect);

Write end of text formatting


procedure TextEffectStart(efEffect: THTMLTextEffect);

HTML character formatting procedures

Write start of text formatting


procedure TextField(sName, sDefault: String; iSize, iMaxLength: Byte);

Write text field on form


procedure TextList(slText: TStringList);

Write list of text straight to output


procedure Title(sTitle: String);

Write page title


procedure WordBreak;

Write word break


procedure CheckBorderColours(clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor; sResult: String);

Check if border colours used - warn if required


procedure CheckClosing(tcTag: THTMLTagCategory; bNotThere: Boolean; sTag, sText: String);

Check that the tag can be closed successfully


procedure CheckField;

Check positioning of fields


function CheckIfPercentage(sText: String; iValue: Integer): String;

Return the text and value as a string - allowing for percentages


procedure CheckNesting(tcTag: THTMLTagCategory; bAllowedInHead, bAllowedInBody, bAllowedInMap, bAllowedInTable, bAllowedInForm: Boolean);

Check that the tag is in the correct part of the document


function ConvertColour(clrColour: TColor): String;

Convert from Delphi colour value to HTML colour value


function FormatBorderColours(clrBackground, clrBorder, clrBorderLight, clrBorderDark: TColor): String;

***************************************************************************** HTML table functions and procedures } { Return border colours as string


function FormatInputField(ifField: THTMLInputField; sName, sValue: String; bChecked: Boolean; iSize, iMaxLength: Byte; sImage: String; ahAlign: THTMLAlignHoriz; iBorder: Byte): String;

Return input field on form as string


procedure SetFilename(sFilename: String);

Set up a new destination for the HTML


Properties


property Errors : THTMLErrorSet


property Filename : String

Published declarations


property IncludeMIMEType : Boolean


property Version : String

Public declarations


Events


Variables


bBulkInsert : Boolean;


bInBody : Boolean;


bInForm : Boolean;


bInHead : Boolean;


bInLink : Boolean;


bInMap : Boolean;


bInSelect : Boolean;


bInTextArea : Boolean;


bSelectOption : Boolean;


bSubmit : Boolean;


bWrittenArea : Boolean;


bWrittenBase : Boolean;


bWrittenContent : Boolean;


bWrittenHead : Boolean;


bWrittenIsIndex : Boolean;


bWrittenTitle : Boolean;


FErrors : THTMLErrorSet;


FFilename : String;

Private declarations


FIncludeMIMEType : Boolean;


fOutput : TextFile;


FVersion : String;


iCurHeadingLevel : Byte;


iCurList : Byte;


iLastHeadingLevel : Byte;


iTableLevels : Byte;


recListCheck : array [1..20] of THTMLListCheck;


sTags : TStringList;