![]() |
ScroogeXHTML for Object Pascal 9.3
|
The base class for ScroogeXHTML. More...
Public Member Functions | |
TSxBase () | |
Creates a new instance of TSxBase. | |
TSxBase (TComponent AOwner) | |
Creates a new instance of TSxBase with a specified owner. | |
~TSxBase () | |
Destroys the TSxBase instance and releases all allocated resources. | |
string | GetCloseEmptyElement () |
Returns the closing tag for an empty HTML element. | |
string | GetEmptyParagraph () |
Returns an empty paragraph element. | |
string | GetLineBreakTag () |
Returns the line break element. | |
string | GetOrderedListTag () |
Returns the opening tag for an ordered list. | |
string | GetParOpen () |
Returns the opening tag for a paragraph without the closing angle bracket. | |
string | GetUnorderedListTag () |
Returns the opening tag for an unordered list. | |
Log (const TLogLevel ALogLevel, const string ALogText) | |
Logs a message with the specified log level. | |
ReplaceFont (string &FontName) | |
Replaces a font name with a predefined substitution. | |
string | TextElementToXHTML (const ISimpleDomTextNode TextElement, TParagraphProperties ParProps) |
convert a text element to HTML / XHTML. | |
VerifySettings () | |
Verifies the current settings of the component. |
Public Attributes | |
Boolean | ConvertAnchors |
Activates support for anchor conversion. | |
Boolean | ConvertEmptyParagraphs |
Replaces empty paragraphs with a line break tag (<br />). | |
Boolean | ConvertHyperlinks |
Enables hyperlink support. | |
Boolean | ConvertIndent |
Enables support for left and right paragraph indentation. | |
Boolean | ConvertLanguage |
Activates support for language conversion. | |
Boolean | ConvertPictures |
Enables picture conversion. | |
Boolean | ConvertSpaces |
Converts consecutive spaces into non-breaking spaces ( ). | |
Boolean | ConvertToPlainText |
Converts the document content to plain text. | |
Boolean | ConvertToPreviewText |
Enables preview text conversion. | |
string | DefaultLanguage |
Sets the default language of the document. | |
TDocumentType | DocumentType |
Specifies the document type. | |
TFontConversionOptions | FontConversionOptions |
Configure which character properties are converted. | |
TFontSizeScale | FontSizeScale |
Set the font size scale. | |
ISxFormatter | Formatter |
Provides access to the formatter used for generating the output. | |
IHyperlinkURIBuilder | HyperlinkURIBuilder |
Provides access to the hyperlink URI builder. | |
Boolean | IncludeDocType |
Include the DOCTYPE declaration at the beginning of the document. | |
Boolean | IncludeXMLDeclaration |
Include the XML declaration line at the beginning of the document. | |
TLogLevel | LogLevel |
Control the detail level of the logging procedure. | |
IMarginBuilding | MarginBuilder |
Provides access to the margin builder. | |
TMarginConversionFlags | MarginConversionFlags |
Configure flags for paragraph margin conversion. | |
TNoRTFHeaderAction | NoRTFHeaderAction |
Define the action to take for missing or invalid RTF headers. | |
TSxOptionsHead | OptionsHead |
Configure HTML HEAD options. | |
TSxOptionsOptimize | OptionsOptimize |
Configure optimization options for the document. | |
string | ParagraphElementAttributes |
Specify optional attributes for the. | |
IPictureAdapter | PictureAdapter |
Provides access to the picture adapter. | |
TPostProcessEventListeners | PostProcessEventListeners |
A list of TPostProcessEventListener instances. | |
TStrings | ReplaceFonts |
Define font names to be replaced. | |
Boolean | RtfEnd |
Indicates whether the end of the document has been reached. | |
string | TabString |
Define the HTML representation of a TAB character. | |
ISxTranslator | Translator |
Provides access to the HTML/XHTML translator. | |
string | Version |
Retrieve 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) | |
Boolean | GetConvertToPreviewText () |
The base class for ScroogeXHTML.
TSxBase::TSxBase | ( | ) |
Creates a new instance of TSxBase.
This constructor initializes the component with default settings.
TSxBase::TSxBase | ( | TComponent | AOwner | ) |
Creates a new instance of TSxBase with a specified owner.
AOwner | The owner component. |
TSxBase::~TSxBase | ( | ) |
Destroys the TSxBase instance and releases all allocated resources.
|
protected |
string TSxBase::GetCloseEmptyElement | ( | ) |
Returns the closing tag for an empty HTML element.
The result depends on the document type (e.g., XHTML or HTML).
|
protected |
Implements ISxWriterOptions.
string TSxBase::GetEmptyParagraph | ( | ) |
Returns an empty paragraph element.
The result includes the opening and closing tags for a paragraph.
string TSxBase::GetLineBreakTag | ( | ) |
Returns the line break element.
The result depends on whether plain text conversion is enabled.
string TSxBase::GetOrderedListTag | ( | ) |
Returns the opening tag for an ordered list.
string TSxBase::GetParOpen | ( | ) |
Returns the opening tag for a paragraph without the closing angle bracket.
Additional attributes can be included based on the ParagraphElementAttributes
property.
string TSxBase::GetUnorderedListTag | ( | ) |
Returns the opening tag for an unordered list.
TSxBase::Log | ( | const TLogLevel | ALogLevel, |
const string | ALogText ) |
Logs a message with the specified log level.
If a log event handler is assigned, it will be called with the provided message.
ALogLevel | The severity level of the log message (e.g., debug, info, warning, error). |
ALogText | The text of the log message to be logged or displayed. |
TSxBase::ReplaceFont | ( | string & | FontName | ) |
Replaces a font name with a predefined substitution.
If a font replacement event handler is assigned, it will be used instead.
FontName | The name of the font to be replaced. This parameter is modified in place. |
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
TSxBase::VerifySettings | ( | ) |
Verifies the current settings of the component.
Throws an exception if any property is set to an invalid value.
Exception | Raised when invalid settings are detected. |
Boolean TSxBase::ConvertAnchors |
Activates support for anchor conversion.
When enabled, anchors in the document will be processed and converted.
Boolean TSxBase::ConvertEmptyParagraphs |
Replaces empty paragraphs with a line break tag (<br />).
Set this property to True to replace paragraphs where the opening <p> tag is immediately followed by the closing </p> tag. Default: False.
Boolean TSxBase::ConvertHyperlinks |
Enables hyperlink support.
Set this property to True to detect and process hyperlinks in the document. Default: True.
Boolean TSxBase::ConvertIndent |
Enables support for left and right paragraph indentation.
Set this property to True to activate indentation support. Default: False.
Boolean TSxBase::ConvertLanguage |
Activates support for language conversion.
When enabled, language attributes in the document will be processed and converted.
Boolean TSxBase::ConvertPictures |
Enables picture conversion.
Set this property to True to process and convert pictures in the document.
Boolean TSxBase::ConvertSpaces |
Converts consecutive spaces into non-breaking spaces ( ).
If two or more spaces are found in sequence, they will be replaced with . Default: True.
Boolean TSxBase::ConvertToPlainText |
Converts the document content to plain text.
When enabled, the output will be plain text instead of HTML or XHTML.
Boolean TSxBase::ConvertToPreviewText |
Enables preview text conversion.
Set this property to True to convert only the first paragraph. Default: False.
string TSxBase::DefaultLanguage |
Sets the default language of the document.
Use this property to specify the language attribute for the document.
TDocumentType TSxBase::DocumentType |
Specifies the document type.
The document type determines the supported HTML/XHTML elements and parameters.
TFontConversionOptions TSxBase::FontConversionOptions |
Configure 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. TFontSizeScale TSxBase::FontSizeScale |
Set the font size scale.
Supported units:
point
(pt): Absolute size scale.em:
Relative size scale.ex:
Relative size scale.percent:
Relative size scale. ISxFormatter TSxBase::Formatter |
Provides access to the formatter used for generating the output.
The formatter is responsible for formatting the document structure.
IHyperlinkURIBuilder TSxBase::HyperlinkURIBuilder |
Provides access to the hyperlink URI builder.
This builder is used to construct hyperlink elements in the output.
Boolean TSxBase::IncludeDocType |
Include the DOCTYPE declaration at the beginning of the document.
Default: True
.
Boolean TSxBase::IncludeXMLDeclaration |
Include the XML declaration line at the beginning of the document.
Default: False
. Example:
* <?xml version="1.0"?> *
TLogLevel TSxBase::LogLevel |
Control the detail level of the logging procedure.
Default: logInfo
.
IMarginBuilding TSxBase::MarginBuilder |
Provides access to the margin builder.
The margin builder is used to calculate and apply margins to the document.
TMarginConversionFlags TSxBase::MarginConversionFlags |
Configure flags for paragraph margin conversion.
TNoRTFHeaderAction TSxBase::NoRTFHeaderAction |
Define the action to take for missing or invalid RTF headers.
TEncodingEvent TSxBase::OnAfterEncode |
Event handler which will be called after the encoding.
TEncodingEvent TSxBase::OnBeforeEncode |
Event handler which will be called before the encoding.
TLogEvent TSxBase::OnLog |
Event handler for log messages.
TReplaceFontEvent TSxBase::OnReplaceFont |
This event handler can be used to define a font substition.
TSxOptionsHead TSxBase::OptionsHead |
Configure HTML HEAD options.
TSxOptionsOptimize TSxBase::OptionsOptimize |
Configure optimization options for the document.
string TSxBase::ParagraphElementAttributes |
Specify optional attributes for the.
element. Example: ParagraphAttributes := 'class="myclass"'.
IPictureAdapter TSxBase::PictureAdapter |
Provides access to the picture adapter.
The picture adapter is responsible for handling image conversions and embedding.
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.
TStrings TSxBase::ReplaceFonts |
Define font names to be replaced.
Example: ReplaceFonts.Add('Arial=Arial,sans-serif').
Boolean TSxBase::RtfEnd |
Indicates whether the end of the document has been reached.
True if the document has ended, otherwise False.
string TSxBase::TabString |
Define the HTML representation of a TAB character.
ISxTranslator TSxBase::Translator |
Provides access to the HTML/XHTML translator.
The translator is responsible for converting the document content into the desired format.
string TSxBase::Version |
Retrieve the ScroogeXHTML version.