
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 |
| |
| 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 . | |
| 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 |
| |
| 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. | |
| 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
| Boolean TSxBase.AbortConversion |
set this property to True to abort the conversion
SetAbortConversion For writing
Properties which control HEAD area.
SetOptionsHead For writing
Properties which control optimization.
SetOptionsOptimize For writing
| ISxPictureAdapter TSxBase.PictureAdapter |
The picture adapter.
FPictureAdapter For writing
| Boolean TSxBase.RtfEnd |
True -> end of document or conversion aborted.
FRtfEnd For writing
| ISxTranslator TSxBase.Translator |
The HTML / XHTML Translator.
| 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
FConvertEmptyParagraphs For writing
| Boolean TSxBase.ConvertHyperlinks |
Set this property to True to activate hyperlink support.
Default: false
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
FConvertIndent For writing
| Boolean TSxBase.ConvertLanguage |
Activates support for language conversion.
FConvertLanguage For writing
| Boolean TSxBase.ConvertPictures |
Activates support for picture conversion.
FConvertPictures For writing
| Boolean TSxBase.ConvertSpaces |
If two or more spaces are found in sequence, they will be converted to .
FConvertSpaces For writing
| Boolean TSxBase.ConvertToPlainText |
Convert to plain text.
FConvertToPlainText For writing
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
SetConvertUsingPrettyIndents For writing
| Boolean TSxBase.DebugMode |
In debug mode, the HTML code includes all elements of the RTF document (RTF tokens, control characters.
..).
SetDebugMode For writing
| AnsiString TSxBase.DefaultLanguage |
Use this property to set the default language of the document.
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.
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'.
| TStrings TSxBase.ElementStyles |
A list of name-value pairs which defines the style="..." parameter for the elements 'p', 'br', 'ol', 'ul' and 'li'.
| TFontConversionOptions TSxBase.FontConversionOptions |
Set these options to control which character properties are converted.
FFontConversionOptions For writing
| TFontSizeScale TSxBase.FontSizeScale |
Use this option to set the font size scale.
The following units are supported:
FFontSizeScale For writing
| TStrings TSxBase.HyperlinkList |
In this list of name value pairs, the visible link text for all known target addresses is associated with an URL.
SetHyperlinkList For writing
| THyperlinkOptions TSxBase.HyperlinkOptions |
This property controls additional options for the hyperlink conversion.
The ConvertHyperlink property has to be set to True.
FHyperlinkOptions For writing
| Boolean TSxBase.IncludeDocType |
Include DOCTYPE at the beginning of the document.
Default: True.
XHTML 1.1 will always be generated with DOCTYPE.
FIncludeDocType For writing
| Boolean TSxBase.IncludeXMLDeclaration |
Includes the XML declaration line at the beginning of the document.
Default: True
* <?xml version="1.0"?> FIncludeXMLDeclaration For writing
| TLogLevel TSxBase.LogLevel |
This property can be used to control the detail level of the logging procedure.
Default: logInfo
FLogLevel For writing
Font names which will be replaced.
| AnsiString TSxBase.TabString |
the HTML representation of a TAB charcter
FTabString For writing
| AnsiString TSxBase.Version |
the ScroogeXHTML version
false For writing
| ISxXmlValidator TSxBase.XmlValidator |
XmlValidator.
\sa FXmlValidator For reading
| TNotifyEvent TSxBase.OnAfterConvert |
This event handler will be called after the conversion.
FOnAfterConvert For writing
| TEncodingEvent TSxBase.OnAfterEncode |
Event handler which will be called after the encoding.
FOnAfterEncode For writing
| TNotifyEvent TSxBase.OnBeforeConvert |
Event handler which will be called before the conversion.
FOnBeforeConvert For writing
| TEncodingEvent TSxBase.OnBeforeEncode |
Event handler which will be called before the encoding.
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.
The ConvertHyperlink property has to be set to True.
FOnHyperlink For writing
| TLogEvent TSxBase.OnLog |
| TProgressEvent TSxBase.OnProgress |
This event is called periodically during the conversion.
It can be used to display the conversion progress.
procedure TfrmMain.converterProgress(Sender: TObject;
const Position: Integer; var continue: Boolean);
begin
Label1.Caption := IntToStr(Position)+'%';
Application.ProcessMessages;
end;
FOnProgress For writing
| TReplaceFontEvent TSxBase.OnReplaceFont |
This event handler can be used to define a font substition.
FOnReplaceFont For writing
1.5.4