Class TNonSelfTag

Unit

Declaration

type TNonSelfTag = class(TTag)

Description

This item has no description.

Source: source/component/PasDoc_TagManager.pas (line 286).

Hierarchy

Show Additional Members:

Overview

Methods

Public constructor Create(ATagManager: TTagManager; const AName: string; AOnPreExecute: TTagExecuteEvent; AOnExecute: TTagExecuteEvent; const ATagOptions: TTagOptions);
Public procedure PreExecute(var ThisTagData: TObject; EnclosingTag: TTag; var EnclosingTagData: TObject; const TagParameter: string; var ReplaceStr: string); virtual;
Public procedure Execute(var ThisTagData: TObject; EnclosingTag: TTag; var EnclosingTagData: TObject; const TagParameter: string; var ReplaceStr: string); virtual;
Public function CreateOccurenceData: TObject; virtual;
Public procedure DestroyOccurenceData(Value: TObject); virtual;
Public function AllowedInside(EnclosingTag: TTag): boolean; override;

Properties

Public property TagOptions: TTagOptions read FTagOptions write FTagOptions;
Public property TagManager: TTagManager read FTagManager;
Public property Name: string read FName write FName;
Public property OnPreExecute: TTagExecuteEvent read FOnPreExecute write FOnPreExecute;
Public property OnExecute: TTagExecuteEvent read FOnExecute write FOnExecute;
Public property OnAllowedInside: TTagAllowedInsideEvent read FOnAllowedInside write FOnAllowedInside;

Description

Methods

Public constructor Create(ATagManager: TTagManager; const AName: string; AOnPreExecute: TTagExecuteEvent; AOnExecute: TTagExecuteEvent; const ATagOptions: TTagOptions);

This item is declared in ancestor TTag.

Note that AName will be converted to lowercase before assigning to Name.

Source: source/component/PasDoc_TagManager.pas (line 147).

Public procedure PreExecute(var ThisTagData: TObject; EnclosingTag: TTag; var EnclosingTagData: TObject; const TagParameter: string; var ReplaceStr: string); virtual;

This item is declared in ancestor TTag.

This is completely analogous to Execute but used when TTagManager.PreExecute is True. In this class this simply calls OnPreExecute.

Source: source/component/PasDoc_TagManager.pas (line 194).

Public procedure Execute(var ThisTagData: TObject; EnclosingTag: TTag; var EnclosingTagData: TObject; const TagParameter: string; var ReplaceStr: string); virtual;

This item is declared in ancestor TTag.

This will be used to do main work when this @-tag occured in description.

EnclosingTag parameter specifies enclosing tag. This is useful for tags that must behave differently in different contexts, e.g. in plain-text output @item tag will behave differently inside @orderedList and @unorderedList. EnclosingTag is nil when the tag occured at top level of the description.

ThisTagData and EnclosingTagData form a mechanism to pass arbitraty data between child tags enclosed within one parent tag. Example uses:

  • This is the way for multiple @item tags inside @orderedList tag to count themselves (to provide list item numbers, for pasdoc output formats that can't automatically number list items).

  • This is the way for @itemSpacing tag to communicate with enclosing @orderedList tag to specify list style.

  • And this is the way for @cell tags to be collected inside rows data and then @rows tags to be collected inside table data. Thanks to such collecting TDocGenerator.FormatTable receives at once all information about given table, and can use it to format table.

How does this XxxTagData mechanism work:

When we start parsing parameter of some tag with toRecursiveTags, we create a new pointer inited to CreateOccurenceData. When @-tags occur inside this parameter, we pass them this pointer as EnclosingTagData (this way all @-tags with the same parent can use this pointer to communicate with each other). At the end, when parameter was parsed, we call given tag's Execute method passing the resulting pointer as ThisTagData (this way @-tags with the same parent can use this pointer to pass some data to their parent).

In this class this method simply calls OnExecute (if assigned).

Source: source/component/PasDoc_TagManager.pas (line 245).

Public function CreateOccurenceData: TObject; virtual;

This item is declared in ancestor TTag.

In this class this simply returns Nil.

Source: source/component/PasDoc_TagManager.pas (line 272).

Public procedure DestroyOccurenceData(Value: TObject); virtual;

This item is declared in ancestor TTag.

In this class this simply does Value.Free.

Source: source/component/PasDoc_TagManager.pas (line 275).

Public function AllowedInside(EnclosingTag: TTag): boolean; override;

This returns just inherited and (EnclosingTag <> Self).

Which means that (assuming that OnAllowedInside is not assigned) this tag is allowed at top level of description and inside parameter of any tag but not within itself and not within tags without toAllowOtherTagsInsideByDefault.

This is currently not used by any tag.

Source: source/component/PasDoc_TagManager.pas (line 296).

Properties

Public property TagOptions: TTagOptions read FTagOptions write FTagOptions;

This item is declared in ancestor TTag.

This item has no description.

Source: source/component/PasDoc_TagManager.pas (line 153).

Public property TagManager: TTagManager read FTagManager;

This item is declared in ancestor TTag.

TagManager that will recognize and handle this tag. Note that the tag instance is owned by this tag manager (i.e. it will be freed inside this tag manager). It can be nil if no tag manager currently owns this tag.

Note that it's very useful in Execute or OnExecute implementations.

E.g. you can use it to report a message by TagManager.DoMessage(...), this is e.g. used by implementation of TPasItem.StoreAbstractTag.

You could also use this to manually force recursive behavior of a given tag. I.e let's suppose that you have a tag with TagOptions = [toParameterRequired], so the TagParameter parameter passed to handler was not recursively expanded. Then you can do inside your handler

NewTagParameter := TagManager.Execute(TagParameter, ...)

and this way you have explicitly recursively expanded the tag.

Scenario above is actually used in implementation of @noAutoLink tag. There I call TagManager.Execute with parameter AutoLink set to false thus preventing auto-linking inside text within @noAutoLink.

Source: source/component/PasDoc_TagManager.pas (line 179).

Public property Name: string read FName write FName;

This item is declared in ancestor TTag.

Name of the tag, that must be specified by user after the "@" sign. Value of this property must always be lowercase.

Source: source/component/PasDoc_TagManager.pas (line 183).

Public property OnPreExecute: TTagExecuteEvent read FOnPreExecute write FOnPreExecute;

This item is declared in ancestor TTag.

This item has no description.

Source: source/component/PasDoc_TagManager.pas (line 185).

Public property OnExecute: TTagExecuteEvent read FOnExecute write FOnExecute;

This item is declared in ancestor TTag.

This item has no description.

Source: source/component/PasDoc_TagManager.pas (line 188).

Public property OnAllowedInside: TTagAllowedInsideEvent read FOnAllowedInside write FOnAllowedInside;

This item is declared in ancestor TTag.

This item has no description.

Source: source/component/PasDoc_TagManager.pas (line 249).


Generated by PasDoc 1.0.2.