TSxBase Class Reference

The base class for ScroogeXHTML. More...

Inheritance diagram for TSxBase:

TSxMain TCustomScrooge TBTScroogeXHTML

List of all members.

Public Member Functions

 TSxBase (TComponent AOwner)
 create a new TSxBase instance
 ~TSxBase ()
 Destroy TSxBase instance.
 VerifySettings ()
 Checks properties for invalid settings.
string GetCloseEmptyElement ()
 check if we are in debug mode
string GetEmptyParagraph ()
 returns an empty paragraph
string GetParOpen ()
 returns the opening tag for a paragraph without ">"
string GetOrderedListTag ()
 get the opening tag for an ordered list
string GetUnorderedListTag ()
 get the opening tag for an unordered list
string GetListItemTag ()
 get the opening tag for a list item
AnsiString GetElementClassParam (const AnsiString ElementName)
 returns the class parameter for the given element
AnsiString GetElementStyleParam (const AnsiString ElementName)
 returns the style="..." parameter for the given element
AnsiString GetElementStyle (const AnsiString ElementName)
 returns the CSS style for the given element
AnsiString GetLineBreakTag ()
 returns the line break element
 Log (const TLogLevel alogLevel, const AnsiString logText)
 call the log event handler and pass the log level and message
 ReplaceFont (AnsiString &FontName)
 replace a font name
 ReplaceHyperlink (const ISimpleDomTextNode TextElement)
 replace a hyperlink
AnsiString TextElementToXHTML (const ISimpleDomTextNode TextElement)
 convert a text element to HTML / XHTML.

Public Attributes

TSxBase public properties
These properties are not visible in the Object Inspector, except OptionsHead and OptionsOptimize.

Boolean AbortConversion
 set this property to True to abort the conversion
ISxFormatter Formatter
 
See also:
FFormatter For reading

TSxOptionsHead OptionsHead
 Properties which control HEAD area.
TSxOptionsOptimize OptionsOptimize
 Properties which control optimization.
ISxPictureAdapter PictureAdapter
 The picture adapter.
Boolean RtfEnd
 True -> end of document or conversion aborted.
ISxTranslator Translator
 The HTML / XHTML Translator.
TSxBase published properties
These properties are visible in the Object Inspector.

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 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;.
Boolean ConvertToPlainText
 Convert to plain text.
Boolean ConvertUsingPrettyIndents
 ScroogeXHTML generates output documents with 'pretty printed' formatting by default.
Boolean DebugMode
 In debug mode, the HTML code includes all elements of the RTF document (RTF tokens, control characters.
AnsiString DefaultLanguage
 Use this property to set the default language of the document.
TDocumentType DocumentType
 The document type.
TStrings ElementClasses
 A list of name-value pairs which defines the class="..." parameter for the elements 'p', 'br', 'ol', 'ul' and 'li'.
TStrings ElementStyles
 A list of name-value pairs which defines the style="..." parameter for the elements 'p', 'br', 'ol', 'ul' and 'li'.
TFontConversionOptions FontConversionOptions
 Set these options to control which character properties are converted.
TFontSizeScale FontSizeScale
 Use this option to set the font size scale.
TStrings HyperlinkList
 In this list of name value pairs, the visible link text for all known target addresses is associated with an URL.
THyperlinkOptions HyperlinkOptions
 This property controls additional options for the hyperlink conversion.
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.
TStrings ReplaceFonts
 
See also:
FReplaceFonts For reading

AnsiString TabString
 the HTML representation of a TAB charcter
AnsiString Version
 the ScroogeXHTML version
ISxXmlValidator XmlValidator
 XmlValidator.
TSxBase events
TNotifyEvent OnAfterConvert
 This event handler will be called after the conversion.
TEncodingEvent OnAfterEncode
 Event handler which will be called after the encoding.
TNotifyEvent OnBeforeConvert
 Event handler which will be called before the conversion.
TEncodingEvent OnBeforeEncode
 Event handler which will be called before the encoding.
THyperlinkEvent OnHyperlink
 This event handler will be called if a hyperlink is detected.
TLogEvent OnLog
 Event handler for log messages.
TProgressEvent OnProgress
 This event is called periodically during the conversion.
TReplaceFontEvent OnReplaceFont
 This event handler can be used to define a font substition.


Detailed Description

The base class for ScroogeXHTML.

Member Function Documentation

TSxBase.VerifySettings (  ) 

Checks properties for invalid settings.

Will throw an Exception to indicate bad values.

string TSxBase::GetCloseEmptyElement (  ) 

check if we are in debug mode

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

AnsiString TSxBase::TextElementToXHTML ( const ISimpleDomTextNode  TextElement  ) 

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


Member Data Documentation

Boolean TSxBase.AbortConversion

set this property to True to abort the conversion

See also:
FAbortConversion For reading

SetAbortConversion For writing

TSxOptionsHead TSxBase.OptionsHead

Properties which control HEAD area.

Since:
4.0
See also:
FOptionsHead For reading

SetOptionsHead For writing

TSxOptionsOptimize TSxBase.OptionsOptimize

Properties which control optimization.

Since:
4.0
See also:
GetOptionsOptimize For reading

SetOptionsOptimize For writing

ISxPictureAdapter TSxBase.PictureAdapter

The picture adapter.

See also:
GetPictureAdapter For reading

FPictureAdapter For writing

Boolean TSxBase.RtfEnd

True -> end of document or conversion aborted.

See also:
FRtfEnd For reading

FRtfEnd For writing

ISxTranslator TSxBase.Translator

The HTML / XHTML Translator.

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

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

Boolean TSxBase.ConvertHyperlinks

Set this property to True to activate hyperlink support.

Default: false

Note:
Hyperlinks are detected only if they use formatted blue and underlined in the source document
If the OnHyperlink event handler is assigned, only the event handler will be executed, and all options defined in the property HyperlinkOptions have no effect.
See also:
FConvertHyperlinks For reading

FConvertHyperlinks For writing

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

Boolean TSxBase.ConvertLanguage

Activates support for language conversion.

See also:
GetConvertLanguage For reading

FConvertLanguage For writing

Boolean TSxBase.ConvertPictures

Activates support for picture conversion.

See also:
FConvertPictures For reading

FConvertPictures For writing

Boolean TSxBase.ConvertSpaces

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

See also:
FConvertSpaces For reading

FConvertSpaces For writing

Boolean TSxBase.ConvertToPlainText

Convert to plain text.

See also:
FConvertToPlainText For reading

FConvertToPlainText For writing

Boolean TSxBase.ConvertUsingPrettyIndents

ScroogeXHTML generates output documents with 'pretty printed' formatting by default.

Some web browsers however have problems with line breaks between html tags, which cause rendering errors. To provide support for more web browsers, the ConvertUsingPrettyIndents property should be set to false. Default: True for backward compatibility

Since:
4.4
See also:
FConvertUsingPrettyIndents For reading

SetConvertUsingPrettyIndents For writing

Boolean TSxBase.DebugMode

In debug mode, the HTML code includes all elements of the RTF document (RTF tokens, control characters.

..).

AnsiString TSxBase.DefaultLanguage

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

See also:
GetDefaultLanguage For reading

FDefaultLanguage For writing

TDocumentType TSxBase.DocumentType

The document type.

For the selected document type, the component will instantiate an object which implements the ISxTranslator interface and assign it to the public Translator property.

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

SetDocumentType For writing

TStrings TSxBase.ElementClasses

A list of name-value pairs which defines the class="..." parameter for the elements 'p', 'br', 'ol', 'ul' and 'li'.

See also:
FElementClasses For reading

TStrings TSxBase.ElementStyles

A list of name-value pairs which defines the style="..." parameter for the elements 'p', 'br', 'ol', 'ul' and 'li'.

See also:
FElementStyles For reading

TFontConversionOptions TSxBase.FontConversionOptions

Set these options to control which character properties are converted.

TFontSizeScale TSxBase.FontSizeScale

Use this option to set the font size scale.

The following units are supported:

TStrings TSxBase.HyperlinkList

In this list of name value pairs, the visible link text for all known target addresses is associated with an URL.

Note:
  • HyperlinkList works only with link text if it is formatted blue and underlined.
  • ConvertHyperlinks and HyperlinkOptions hoUseHyperlinkList option have to be enabled
See also:
FHyperlinkList For reading

SetHyperlinkList For writing

THyperlinkOptions TSxBase.HyperlinkOptions

This property controls additional options for the hyperlink conversion.

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

Boolean TSxBase.IncludeXMLDeclaration

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

Default: True

     * <?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

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

TSxBase::ReplaceFonts

See also:
FReplaceFonts For reading

Font names which will be replaced.

See also:
SetReplaceFonts For writing

AnsiString TSxBase.TabString

the HTML representation of a TAB charcter

See also:
GetTabString For reading

FTabString For writing

AnsiString TSxBase.Version

the ScroogeXHTML version

See also:
GetVersion For reading

false For writing

ISxXmlValidator TSxBase.XmlValidator

XmlValidator.

\sa FXmlValidator For reading

See also:
FXmlValidator For writing

TNotifyEvent TSxBase.OnAfterConvert

This event handler will be called after the conversion.

See also:
FOnAfterConvert For reading

FOnAfterConvert For writing

TEncodingEvent TSxBase.OnAfterEncode

Event handler which will be called after the encoding.

See also:
FOnAfterEncode For reading

FOnAfterEncode For writing

TNotifyEvent TSxBase.OnBeforeConvert

Event handler which will be called before the conversion.

See also:
FOnBeforeConvert For reading

FOnBeforeConvert For writing

TEncodingEvent TSxBase.OnBeforeEncode

Event handler which will be called before the encoding.

See also:
FOnBeforeEncode For reading

FOnBeforeEncode For writing

THyperlinkEvent TSxBase.OnHyperlink

This event handler will be called if a hyperlink is detected.

It can be used to modify the hyperlink text.

Note:
if the OnHyperlink event handler is assigned to a custom method, all settings of the HyperlinkOptions property will have no effect.

The ConvertHyperlink property has to be set to True.

See also:
FOnHyperlink For reading

FOnHyperlink For writing

TLogEvent TSxBase.OnLog

Event handler for log messages.

See also:
LogLevel

FOnLog For reading

FOnLog For writing

TProgressEvent TSxBase.OnProgress

This event is called periodically during the conversion.

It can be used to display the conversion progress.

Example:
      procedure TfrmMain.converterProgress(Sender: TObject;
        const Position: Integer; var continue: Boolean);
      begin
        Label1.Caption := IntToStr(Position)+'%';
        Application.ProcessMessages;
      end;
See also:
FOnProgress For reading

FOnProgress For writing

TReplaceFontEvent TSxBase.OnReplaceFont

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

See also:
FOnReplaceFont For reading

FOnReplaceFont For writing


Generated on Fri Feb 1 11:24:25 2008 for ScroogeXHTML for Delphi(tm) by  doxygen 1.5.4