ScroogeXHTML for Object Pascal 9.1
Loading...
Searching...
No Matches
TSxBase Class Reference

The base class for ScroogeXHTML. More...

Inheritance diagram for TSxBase:
ISxWriterOptions TSxMain TCustomScrooge TBTScroogeXHTML

Public Member Functions

 TSxBase ()
 Create a new TSxBase instance.
 
 TSxBase (TComponent AOwner)
 Create a new TSxBase instance.
 
 ~TSxBase ()
 Destroy TSxBase instance.
 
string GetCloseEmptyElement ()
 returns ' />' or '>' depending on DOCTYPE

 
string GetEmptyParagraph ()
 returns an empty paragraph
 
string GetLineBreakTag ()
 returns the line break element
 
string GetOrderedListTag ()
 get the opening tag for an ordered list
 
string GetParOpen ()
 returns the opening tag for a paragraph without ">"
 
string GetUnorderedListTag ()
 get the opening tag for an unordered list
 
 Log (const TLogLevel ALogLevel, const string ALogText)
 call the log event handler and pass the log level and message
 
 ReplaceFont (string &FontName)
 replace a font name
 
string TextElementToXHTML (const ISimpleDomTextNode TextElement, TParagraphProperties ParProps)
 convert a text element to HTML / XHTML.
 
 VerifySettings ()
 Checks properties for invalid settings.
 

Public Attributes

Boolean ConvertAnchors
 Activates support for anchor conversion.
 
Boolean ConvertEmptyParagraphs
 Set this property to True to replace empty paragraphs (where the opening <p> tag is followed by the closing </p> tag) by a line break tag (<br />).
 
Boolean ConvertFields
 Activates support for field conversion.
 
Boolean ConvertHyperlinks
 Set this property to True to activate hyperlink support.
 
Boolean ConvertIndent
 Set this property to True if You want to activate support for left and right paragraph indent.
 
Boolean ConvertLanguage
 Activates support for language conversion.
 
Boolean ConvertPictures
 Activates support for picture conversion.
 
Boolean ConvertSpaces
 If two or more spaces are found in sequence, they will be converted to &nbsp; Default: True
 
Boolean ConvertToPlainText
 Convert to plain text.
 
string DefaultLanguage
 Use this property to set the default language of the document.
 
TDocumentType DocumentType
 The document type.
 
TFontConversionOptions FontConversionOptions
 Set these options to control which character properties are converted.
 
TFontSizeScale FontSizeScale
 Use this option to set the font size scale.
 
ISxFormatter Formatter
 The formatter.
 
IHyperlinkURIBuilder HyperlinkURIBuilder
 
Boolean IncludeDocType
 Include DOCTYPE at the beginning of the document.
 
Boolean IncludeXMLDeclaration
 Includes the XML declaration line at the beginning of the document.
 
TLogLevel LogLevel
 This property can be used to control the detail level of the logging procedure.
 
IMarginBuilding MarginBuilder
 The margin builder.
 
TMarginConversionFlags MarginConversionFlags
 Flags for paragraph margin conversion.
 
TNoRTFHeaderAction NoRTFHeaderAction
 Action on missing or invalid RTF header.
 
TSxOptionsHead OptionsHead
 HTML HEAD options.
 
TSxOptionsOptimize OptionsOptimize
 Optimization options.
 
string ParagraphElementAttributes
 The optional attributes to use for the p element.
 
IPictureAdapter PictureAdapter
 The picture adapter.
 
TPostProcessEventListeners PostProcessEventListeners
 A list of TPostProcessEventListener instances.
 
TStrings ReplaceFonts
 Font names which will be replaced.
 
Boolean RtfEnd
 True -> end of document.
 
string TabString
 the HTML representation of a TAB charcter
 
ISxTranslator Translator
 The HTML / XHTML Translator.
 
string Version
 the ScroogeXHTML version
 
TSxBase events
TEncodingEvent OnAfterEncode
 Event handler which will be called after the encoding.
 
TEncodingEvent OnBeforeEncode
 Event handler which will be called before the encoding.
 
TLogEvent OnLog
 Event handler for log messages.
 
TReplaceFontEvent OnReplaceFont
 This event handler can be used to define a font substition.
 

Protected Member Functions

 DoPostProcessing (const ISimpleDomDocument ADocument)
 

Detailed Description

The base class for ScroogeXHTML.

Constructor & Destructor Documentation

◆ TSxBase() [1/2]

TSxBase::TSxBase ( )

Create a new TSxBase instance.

◆ TSxBase() [2/2]

TSxBase::TSxBase ( TComponent AOwner)

Create a new TSxBase instance.

◆ ~TSxBase()

TSxBase::~TSxBase ( )

Destroy TSxBase instance.

Member Function Documentation

◆ DoPostProcessing()

TSxBase::DoPostProcessing ( const ISimpleDomDocument ADocument)
protected

◆ GetCloseEmptyElement()

string TSxBase::GetCloseEmptyElement ( )

returns ' />' or '>' depending on DOCTYPE

◆ GetEmptyParagraph()

string TSxBase::GetEmptyParagraph ( )

returns an empty paragraph

◆ GetLineBreakTag()

string TSxBase::GetLineBreakTag ( )

returns the line break element

◆ GetOrderedListTag()

string TSxBase::GetOrderedListTag ( )

get the opening tag for an ordered list

◆ GetParOpen()

string TSxBase::GetParOpen ( )

returns the opening tag for a paragraph without "&gt;"

◆ GetUnorderedListTag()

string TSxBase::GetUnorderedListTag ( )

get the opening tag for an unordered list

◆ Log()

TSxBase::Log ( const TLogLevel ALogLevel,
const string ALogText )

call the log event handler and pass the log level and message

◆ ReplaceFont()

TSxBase::ReplaceFont ( string & FontName)

replace a font name

◆ TextElementToXHTML()

string TSxBase::TextElementToXHTML ( const ISimpleDomTextNode TextElement,
TParagraphProperties ParProps )

convert a text element to HTML / XHTML.

This function receives a block of text and its attributes, packaged in a ISimpleDomTextNode object. It will then

◆ VerifySettings()

TSxBase::VerifySettings ( )

Checks properties for invalid settings.

Will throw an Exception to indicate bad values.

Member Data Documentation

◆ ConvertAnchors

Boolean TSxBase::ConvertAnchors

Activates support for anchor conversion.

See also
FConvertAnchors For reading
FConvertAnchors For writing

◆ ConvertEmptyParagraphs

Boolean TSxBase::ConvertEmptyParagraphs

Set this property to True to replace empty paragraphs (where the opening <p> tag is followed by the closing </p> tag) by a line break tag (<br />).

Default: False

See also
FConvertEmptyParagraphs For reading
FConvertEmptyParagraphs For writing

◆ ConvertFields

Boolean TSxBase::ConvertFields

Activates support for field conversion.

Deprecated
See also
FConvertFields For reading
FConvertFields For writing

◆ ConvertHyperlinks

Boolean TSxBase::ConvertHyperlinks

Set this property to True to activate hyperlink support.

Default: True

Note
Hyperlinks are detected if they use formatted blue and underlined in the source document or if the text contains a HYPERLINK field expression
See also
FConvertHyperlinks For reading
FConvertHyperlinks For writing

◆ ConvertIndent

Boolean TSxBase::ConvertIndent

Set this property to True if You want to activate support for left and right paragraph indent.

Default: False

Note
the right indent in the output document is relative to the browser window, if you change the browser window size, the text area will adjust its size
See also
FConvertIndent For reading
FConvertIndent For writing

◆ ConvertLanguage

Boolean TSxBase::ConvertLanguage

Activates support for language conversion.

See also
GetConvertLanguage For reading
FConvertLanguage For writing

◆ ConvertPictures

Boolean TSxBase::ConvertPictures

Activates support for picture conversion.

See also
FConvertPictures For reading
FConvertPictures For writing

◆ ConvertSpaces

Boolean TSxBase::ConvertSpaces

If two or more spaces are found in sequence, they will be converted to &nbsp; Default: True

See also
FConvertSpaces For reading
FConvertSpaces For writing

◆ ConvertToPlainText

Boolean TSxBase::ConvertToPlainText

Convert to plain text.

See also
FConvertToPlainText For reading
FConvertToPlainText For writing

◆ DefaultLanguage

string TSxBase::DefaultLanguage

Use this property to set the default language of the document.

See also
GetDefaultLanguage For reading
FDefaultLanguage For writing

◆ DocumentType

TDocumentType TSxBase::DocumentType

The document type.

Note
Depending on the document type, some HTML/XHTML elements or parameters are not supported.
See also
FDocumentType For reading
SetDocumentType For writing

◆ FontConversionOptions

TFontConversionOptions TSxBase::FontConversionOptions

Set these options to control which character properties are converted.

  • opFontSize enables conversion of font sizes. Default: enabled.
  • opFontName enables conversion of font names. See also TCustomScrooge::ReplaceFonts . Default: enabled.
  • opFontStyle enables conversion of font styles (bold, italic, underlined, strikeout). Default: enabled.
  • opFontColor enables conversion of font colors. Default: enabled
  • opFontBGColor enables conversion of background font colors. Default: enabled.
  • opFontHLColor enables conversion of highlight font colors. Default: enabled.
    See also
    GetFontConversionOptions For reading
    FFontConversionOptions For writing

◆ FontSizeScale

TFontSizeScale TSxBase::FontSizeScale

Use this option to set the font size scale.

The following units are supported:

  • point (pt)
  • em
  • ex
  • percent
    Note
    Point is an absolute size scale, all others are relative scales.
    See also
    FFontSizeScale For reading
    FFontSizeScale For writing

◆ Formatter

ISxFormatter TSxBase::Formatter

The formatter.

The hyper link URI builder.

See also
FFormatter For reading

◆ HyperlinkURIBuilder

IHyperlinkURIBuilder TSxBase::HyperlinkURIBuilder
See also
FHyperlinkURIBuilder For reading
SetHyperlinkURIBuilder For writing

◆ IncludeDocType

Boolean TSxBase::IncludeDocType

Include DOCTYPE at the beginning of the document.

Default: True.

Note
Some HTML browsers check this element, and use the information in it to verify the document code.
XHTML 1.1 will always be generated with DOCTYPE.
See also
FIncludeDocType For reading
FIncludeDocType For writing

◆ IncludeXMLDeclaration

Boolean TSxBase::IncludeXMLDeclaration

Includes the XML declaration line at the beginning of the document.

Default: False

* <?xml version="1.0"?> 
Note
the default encodig for documents which use this declaration is UTF-8
See also
FIncludeXMLDeclaration For reading
FIncludeXMLDeclaration For writing

◆ LogLevel

TLogLevel TSxBase::LogLevel

This property can be used to control the detail level of the logging procedure.

Default: logInfo

See also
FLogLevel For reading
FLogLevel For writing

◆ MarginBuilder

IMarginBuilding TSxBase::MarginBuilder

The margin builder.

See also
FMarginBuilder For reading

◆ MarginConversionFlags

TMarginConversionFlags TSxBase::MarginConversionFlags

Flags for paragraph margin conversion.

See also
FMarginConversionFlags For reading
FMarginConversionFlags For writing

◆ NoRTFHeaderAction

TNoRTFHeaderAction TSxBase::NoRTFHeaderAction

Action on missing or invalid RTF header.

See also
FNoRTFHeaderAction For reading
FNoRTFHeaderAction For writing

◆ OnAfterEncode

TEncodingEvent TSxBase::OnAfterEncode

Event handler which will be called after the encoding.

See also
FOnAfterEncode For reading
FOnAfterEncode For writing

◆ OnBeforeEncode

TEncodingEvent TSxBase::OnBeforeEncode

Event handler which will be called before the encoding.

See also
FOnBeforeEncode For reading
FOnBeforeEncode For writing

◆ OnLog

TLogEvent TSxBase::OnLog

Event handler for log messages.

See also
LogLevel
FOnLog For reading
FOnLog For writing

◆ OnReplaceFont

TReplaceFontEvent TSxBase::OnReplaceFont

This event handler can be used to define a font substition.

See also
FOnReplaceFont For reading
FOnReplaceFont For writing

◆ OptionsHead

TSxOptionsHead TSxBase::OptionsHead

HTML HEAD options.

See also
FOptionsHead For reading
SetOptionsHead For writing

◆ OptionsOptimize

TSxOptionsOptimize TSxBase::OptionsOptimize

Optimization options.

See also
GetOptionsOptimize For reading
SetOptionsOptimize For writing

◆ ParagraphElementAttributes

string TSxBase::ParagraphElementAttributes

The optional attributes to use for the p element.

Example: ParagraphAttributes := 'class="myclass"'

See also
FParagraphElementAttributes For reading
FParagraphElementAttributes For writing

◆ PictureAdapter

IPictureAdapter TSxBase::PictureAdapter

The picture adapter.

See also
GetPictureAdapter For reading
FPictureAdapter For writing

◆ PostProcessEventListeners

TPostProcessEventListeners TSxBase::PostProcessEventListeners

A list of TPostProcessEventListener instances.

The converter will TPostProcessEventListener instance PostProcess methods, passing a internal DOM representation of the document, which may be modified before it is written to the actual result HTML.

See also
FPostProcessEventListeners For reading

◆ ReplaceFonts

TStrings TSxBase::ReplaceFonts

Font names which will be replaced.

See also
FReplaceFonts For reading
SetReplaceFonts For writing

◆ RtfEnd

Boolean TSxBase::RtfEnd

True -> end of document.

See also
FRtfEnd For reading
FRtfEnd For writing

◆ TabString

string TSxBase::TabString

the HTML representation of a TAB charcter

See also
GetTabString For reading
FTabString For writing

◆ Translator

ISxTranslator TSxBase::Translator

The HTML / XHTML Translator.

Note
To change the Translator, please use the DocumentType property.
See also
FTranslator For reading

◆ Version

string TSxBase::Version

the ScroogeXHTML version

See also
False For reading