Handle the generated topic links

Methods available in templates

Generate multiple files from a single template file

HTML and CHM templates can leverage various methods to get information or manipulate the currently opened project. The following list describes the methods available to the templates. As ab example for the ClearDictionaries method, it can be used as follows: HndDictionaries.ClearDictionaries;


HndDictionaries

procedure ClearDictionaries;
Clears the loaded dictionaries list and disable the spell checker component.

procedure DisableAllDictionaries;
Disable all the dictionaries.

function EnableDictionaries(const aLocalIdList: TStringList; const DisabledOthers: Boolean = True): Boolean;
Enable a list of dictionaries. Disable the other ones if needed.

function EnableDictionary(const aLocaleId: Cardinal; const DisabledOthers: Boolean = True): Boolean;
Enable the specific dictionary and disables others if asked.

function GetActiveDictionariesCount: Integer;
Returns the number of currently active dictionaries.

function GetActiveDictionariesList: THndDictionaryInfoArray;
Returns the list of currently active dictionaries.

function GetDictionariesCount: Integer;
Get the number of dictionaries.

function GetDictionariesList: THndDictionaryInfoArray;
Get a list of dictionaries.

function GetDictionaryInfo(const aLocalId: Cardinal): THndDictionaryInfo;
Returns information about the specific locale.

function InstallOOoDictionay(const aFileName: string): Boolean;
Installs a new OpenOffice.org dictionary.

procedure NotifyActiveDictionariesChange(Sender: TObject; const SaveToProject: Boolean = True);
Notifies every listener the dictionary list has been updated.

procedure PauseLiveSpell;
Pause live spell in all possible controls.

function ReloadDictionaries: Boolean;
Reload the dictionary list from the disk.

procedure ResumeLiveSpell;
Resume the live spell after it has been paused.

procedure SaveActiveDictionariesToProject;
Save the currently active dictionaries to the currently open project.

procedure SwitchDictionaryStatus(const aLocalId: Cardinal);
If dictionary is enable, then disable it and vice-versa.

HndEditor

procedure ApplyStyleToSelection(const anEditor: TObject; const aStyleId: Integer);
Apply the specified style to the selection.

procedure Clear(const anEditor: TObject);
Clears the content of the specified editor.

function CreateTemporaryEditor: TObject;
Creates a new temporary editor.

function CreateTemporaryReportHelper: TObject;
Create a new temporary report helper.

procedure DestroyTemporaryEditor(const anEditor: TObject);
Destroys a previously created temporary editor.

procedure DestroyTemporaryReportHelper(const aReportHelper: TObject);
Destroys a previously created temporary report helper.

function GetAnchorList(const anEditor: TObject): TStringList;
Retrieves the list of anchors in the specified editor.

function GetContentAsHtml(const anEditor: TObject; out aCssContent: string): string;
Returns the editor content as HTML.

function GetContentAsText(const anEditor: TObject): string;
Returns the editor content as text.

function GetCurrentAnchorName(const anEditor: TObject): string;
Returns the name of the current checkpoint or an empty string if there isn't any.

function GetCurrentPictureAltText(const anEditor: TObject): string;
Return the currently selected picture's alternative text.

function GetCurrentPictureHeight(const anEditor: TObject): Integer;
Returns the currently selected picture's height.

function GetCurrentPictureSpacing(const anEditor: TObject): Integer;
Get the current picture spacing.

function GetCurrentPictureVAlign(const anEditor: TObject): THndVAlign;
Return the currently selected picture's vertical alignment.

function GetCurrentPictureWidth(const anEditor: TObject): Integer;
Returns the currently selected picture's width.

procedure InsertAnchorBeforeCurrentItem(const anEditor: TObject; const aName: string);
Inserts a checkpoint at the current cursor position.

function InsertFile(const anEditor: TObject; const aFile: string): Boolean;
Inserts a file in the editor.

function InsertFileFromLibraryItem(const anEditor: TObject; const aLibraryItem: string): Boolean;
Insert the content of the library item.

procedure InsertLibraryItem(const anEditor: TObject; const aLibraryItem: string; const OnlyReplaceContent: Boolean = False);
Insert a library item object in the specified editor at the current cursor position.

procedure InsertPageBreakBeforeCurrentItem(const anEditor: TObject);
Inserts a page break at the current cursor position.

procedure InsertTopicContent(const anEditor: TObject; const aTopicId: string);
Insert the content of the specified topic in the specified editor.

procedure MoveCaretTo(anEditor: TObject; X, Y: Integer);
Move the specified editor's caret to another location.

procedure MoveCarretToEnd(const anEditor: TObject);
Move the specified editor's caret to the end.

procedure RemoveCurrentAnchor(const anEditor: TObject);
Remove the current checkpoint in the specified Editor.

function ReplaceLibraryItems(const anEditor: TObject): Boolean;
Replace the library items by their actual content.

procedure SetAsTopicContent(const anEditor: TObject; const aTopicId: string);
Set the specific topic's content as the current editor's content.

function SetContent(const anEditor: TObject; const aContentStream: TStream): Boolean;
Set the content from a stream.

procedure SetCurrentCellsAlignment(const anEditor: TObject; const anHVAlignment: THndHVAlignment);
Sets the currently selected cells horizontal and vertical alignment.

procedure SetCurrentPictureAltText(const anEditor: TObject; const anAltText: string);
Set the currently selected picture's alternative text.

procedure SetCurrentPictureHeight(const anEditor: TObject; const aNewHeight: Integer);
Defines the currently selected picture's height.

procedure SetCurrentPictureSpacing(const anEditor: TObject; const aNewSpacing: Integer);
Set the currently selected picture's spacing.

procedure SetCurrentPictureVAlign(const anEditor: TObject; const aNewVAlign: THndVAlign);
Defines the currently selected picture's vertical alignment.

procedure SetCurrentPictureWidth(const anEditor: TObject; const aNewWidth: Integer);
Defines the currently selected picture's width.

procedure TogglePageBreak(const anEditor: TObject);
Create or remove the current page break.

procedure UpdateLibraryItem(const anEditor: TObject; anItemId: string);
Update a library item's visual appearance in the editor.

HndEditorHelper

function GetHyperlinkInfoFromString(const aString: string): THndHyperlinkInfo;
Extract the hyperlink information from a string.

procedure ImportImagesToLibrary(const anEditor: TObject);
Import the images to library.

function SetHyperlinkInfoToString(const anHyperLinkInfo: THndHyperlinkInfo): string;
Constructs a string based in hyperlink info.

procedure SetupEditorProperties(const anEditor: TObject);
Defines default editor properties and events.

HndMeta

function GetItemMetaRawValue(const aKey: string): WideString; override;
Returns the raw IROStrings value for the property of the specified item.

procedure SetItemMetaRawValue(const aKey: string; const aRawValue: WideString); override;
Assign a raw value to a specific key.

HndJsSearchEngine

procedure AddSearchData(const aSearchData, aAssociatedTopicId: string);
Add search data and associate it to a speicifc topic.

procedure ClearSearchData;
Clear the current search data.

function GetJsData: string;
Get the Javascript search data.

HndKeywords
Array of minimal keyword information

function CreateKeyword: string;
Create a new keyword. The new keyword will be placed at the bottom of the list.

procedure DeleteAllKeywords;
Delete all the keywords in the project, except the root project keyword.

function DeleteKeyword(const aKeywordId: string): Boolean;
Delete a specific keyword and its children.

function GenerateUniqueCaption(const aBaseCaption, aParentId: string; const aFilteredItems: array of string): string;
Generates a unique caption within the specified parent.

function GetKeywordCaption(const aKeywordId: string): string;
Get the caption of a specific keyword.

function GetKeywordDirectChildrenCount(const aKeywordId: string): Integer;
Returns the number of children for the speicified keyword.

function GetKeywordDirectChildrenList(const aParentId: string): THndKeywordsInfoArray;
Returns a list of all the children keywords.

function GetKeywordLevel(const aKeywordId: string): Integer;
Returns the level of the specified keyword.

function GetKeywordList(const aIncludingProjectKeyword: Boolean = False): THndKeywordsInfoArray;
Returns a list of all the keywords.

function GetKeywordNext(const aKeywordId: string): string;
Get the next keyword in line. Could be a child or the next keyword.

function GetKeywordNextSibbling(const aKeywordId: string): string;
Returns the next sibbling of a specific keyword.

function GetKeywordParent(const aKeywordId: string): string;
Returns the parent keyword of a specific keyword.

function GetKeywordPreviousSibbling(const aKeywordId: string): string;
Get the previous sibbling keyword.

function GetProjectKeyword: string;
Returns the root project keyword.

function MoveKeyword(const aKeywordId, aReferencedKeywordId: string; const oAttachMode: THndKeywordsAttachMode): Boolean;
Move the keyword to a new position in reference to nReferencedKeywordsId.

function MoveKeywordLeft(const aKeywordId: string): Boolean;
Move the specific keyword left in the hierarchy.

function MoveKeywordRight(const aKeywordId: string): Boolean;
Move the specific keyword right in the hierarchy.

procedure SetCurrentKeyword(const aKeywordId: string);
Set the DB pointer to the specified keyword.

function SetKeywordCaption(const aKeywordId, sNewCaption: string): string;
Defines the specific keyword' caption.

HndLibraryItems
Array of minimal library item information

function CreateItem: string;
Creates a new unspecified item to the library.

function DeleteItem(const anItemId: string): Boolean;
Delete a specific library item.

function GetItemCaption(const anItemId: string): string;
Gets the caption of a specific item.

function GetItemContent(const anItemId: string): TMemoryStream;
Get the content of the item as a stream. Caller must free the stream after using it.

function GetItemContentAsText(const anItemId: string): string;
Get the content of an item as a text.

function GetItemExtension(const anItemId: string): string;
Get the item's file extension.

function GetItemKind(const anItemId: string): Integer;
Gets the kind of the specific item.

function GetItemList(aIncludingKinds: array of Integer): THndLibraryItemsInfoArray;
Returns a list of items filtered by aIncludingKinds.

function GetItemSource(const anItemId: string): Integer;
Gets the source of a specific library item.

function GetItemUrlFile(const anItemId: string): string;
Sets the URL File of a specified library item.

function GetItemUrlLink(const anItemId: string): string;
Sets the URL Link of a specified library item.

function SetItemCaption(const anItemId, aCaption: string): string;
Sets the caption of a specific item.

function SetItemContent(const anItemId: string; const aContent: TStream): Boolean;
Sets the content stream of a specified item.

function SetItemContentFromFile(const anItemId, aContentFile: string): Boolean;
Set the content of the item from an existing file.

function SetItemContentFromText(const anItemId, aContentText: string): Boolean;
Sets the content as text of a specific item.

function SetItemExtension(const anItemId, anExtension: string): Boolean;
Set the item's file extension.

function SetItemKind(const anItemId: string; const aKind: Integer): Boolean;
Sets the kind of a specific item.

function SetItemSource(const anItemId: string; const aSource: Integer): Boolean;
Sets the source of a specific library item.

function SetItemUrlFile(const anItemId, anUrlFile: string): Boolean;
Sets the URL File of a specified library item.

function SetItemUrlLink(const anItemId, anUrlLink: string): Boolean;
Sets the URL Link of a specified library item.

HndLibraryItemsCache

procedure AddOrInvalidateItem(anItemId: string);
Add an item to the cache or invalidate it.

procedure DeleteItem(anItemId: string);
Delete an item from the cache.

function GenerateUniqueCaption(const aBaseCaption: string; const aFilteredItems: array of string): string;
Generates a unique caption amongst all cached items.

function GetItemFromCache(anItemId: string): THndLibraryItemsCacheInfo;
Get item cache info.

procedure Invalidate;
Invalidate all the items from the cache.

procedure InvalidateVariables;
Invalidate the variable values based on user changes.

HndProjects

procedure SetProjectName(const aProjectName: string);
Defines the project name.

procedure CloseProject;
Closes the currently openned project.

function CopyProject(const aNewProjectName: string; const OpenNewOne: Boolean): Boolean;
Copy the project to a new location and open the new one if needed.

function DeleteProject: Boolean;
Physically delete the currently openned project.

function GetProjectAuthor: string;
Returns the author of the project.

function GetProjectBusy: Boolean;
Project is currently busy: creating, loading or closing.

function GetProjectCharset: Integer;
Returns the project current charset.

function GetProjectClosing: Boolean;
Project is currently closing.

function GetProjectComment: string;
Return the current project's comment.

function GetProjectCopyright: string;
Returns the project copyright.

function GetProjectCreating: Boolean;
Project is currently being created.

function GetProjectCssContent: string;
Returns the CSS content of the current project. Can only be returned when generating an HTML related format.

function GetProjectId: string;
Returns the currently open project id.

function GetProjectLanguage: Integer;
Returns the project current language.

function GetProjectModified: Boolean;
Indicates whether or no the current project has been modified since last save.

function GetProjectName: string;
Returns the current project name (or file name).

function GetProjectNeverSaved: Boolean;
Indicates whether the project as already been saved or not.

function GetProjectOpenning: Boolean;
Returns True if the project is currently openning.

function GetProjectSummary: string;
Returns the project summary.

function GetProjectTitle: string;
Gets the title of the specified project.

function GetProjectVersion: string;
Return the current project's version number.

function MoveProject(const aNewProjectName: string): Boolean;
Move the project to a new location.

function NewProject(const aProjectName: string = ''): string;
Creates a new project and returns its unique id.

function OpenProject(const aProjectName: string): string;
Open an existing project and returns its unique id.

procedure SaveProject;
Saves the project to a file.

procedure SetProjectAuthor(const anAuthor: string);
Defines the project author.

procedure SetProjectCharset(const aCharSet: Integer);
Defines the project charset.

procedure SetProjectComment(const aComment: string);
Set the current project comment.

procedure SetProjectCopyright(const aCopyrightValue: string);
Defines the project copyright.

procedure SetProjectLanguage(const aLanguage: Integer);
Defines the project language.

procedure SetProjectModified(const IsModified: Boolean = True);
Mark the current project as being modified since last save.

procedure SetProjectNeverSaved(const IsProjectNeverSaved: Boolean = True);
Mark the project as being never saved.

procedure SetProjectSummary(const aSummary: string);
Set the project summary.

procedure SetProjectTitle(const aProjectTitle: string);
Sets the title of the specified project.

procedure SetProjectVersion(const aProjectVersion: string);
Sets the version of the current project.

HndProjectsMeta

function GetItemMetaRawValue(const aKey: string): WideString; override;
Returns the raw IROStrings value for the property of the specified item.

procedure SetItemMetaRawValue(const aKey: string; const aRawValue: WideString); override;
Assign a raw value to a specific key.

function EnforceLogin: Boolean; static;
Makes sure the user is logged in before calling the methods.

function GetDateTime: TDateTime; static;
Returns the current date and time from the server.

function IsConnectedToServer: Boolean; static;
Whether we are connected to a server.

HndStyles

function CleanStyleName(const aStyleName: string): string;
Clean a style name by removing system and kind texts.

function GetStyleKindFromName(const aStyleName: string): THndStyleKind;
Returns the style's kind based on its name.

function IsStyleSystemFromName(const aStyleName: string): Boolean;
Returns true if the given style name is from a standard style (contains -S).

HndTemplates

function GetTemplateKindList: TStringDynArray;
Returns a list of templat kinds available on the system: 'html', 'chm'...

function GetDefaultTemplateFor(const aTemplateKind: string): THndTemplateInfo;
Constructor.

function GetTemplateFromName(const aTemplateName, aTemplateKind: string): THndTemplateInfo;
Returns a specific template based on its name and kind.

function GetTemplateHierarchy: THndTemplateHierarchyArray;
Returns the full hierarchy of available templates.

function GetTemplateList: THndTemplateInfoArray;
Returns a list of available templates on specified kind, or all kinds if none specified.

procedure UpdateTemplateList;
Retrieves the templates from the hard drive.

HndTemplatesEx

function GetTemplateKindFromPath(const aTemplatePath: string): string;
Returns the kind of template available at the speicified path.

HndTopics
Create, edit and manage topics within the current project.

procedure CopyTopicToClipboard(const aTopicId: string; const isCut: Boolean);
Copy the specified topic to clipboard.

procedure CreateMultipleTopics(const aTopicList: TStrings; const aParentTopic: string = '';
Creates multiple child topics of the specified parent based on a tabular lists.

function CreateTopic: string;
Create a new topic. The topic will be placed at the bottom of the topic list.

procedure DeleteAllTopics;
Delete all the topics in the project, except the parent topic.

function DeleteTopic(const aTopicId: string): Boolean;
Delete a specific topic and its children. Project topic can't be deleted.

function GenerateUniqueHelpContext(const aBaseHelpContext: Integer; const aFilteredTopics: array of string): Integer;
Generates a unique help context among all the topics except the filtered ones.

function GenerateUniqueHelpId(const aBaseHelpId: string; const aFilteredTopics: array of string): string;
Generates a unique help id among all the topics except the filtered ones.

function GetCurrentTopic: string;
Returns the ID of the currently edited topic.

function GetProjectTopic: string;
Returns the root project topic.

function GetTopicCaption(const aTopicId: string): string;
Get the caption of a specific topic.

function GetTopicContent(const aTopicId: string): TMemoryStream;
Returns the content of the specified topic.

function GetTopicContentAsHtml(const aTopicId: string): string;
Get the topic's content as HTML. Only available when generating an HTML related documentation.

function GetTopicCount: Integer;
Returns the number of topics available in the current project.

function GetTopicCreationDateTime(const aTopicId: string): TDateTime;
Returns the date and time when the topics was created.

function GetTopicDirectChildrenCount(const aParentId: string): Integer;
Returns the number of direct children a topic has.

function GetTopicDirectChildrenList(const aParentId: string): THndTopicsInfoArray;
Returns a list of direct children of the specified topic.

function GetTopicFirst: string;
Returns the first topic in the project.

function GetTopicFooterKind(const aTopicId: string): Integer;
Returns the topic's kind of footer text: normal, custom, hidden.

function GetTopicFooterText(const aTopicId: string): string;
Returns the custom topic footer text.

function GetTopicFooterTextCalculated(const aTopicId: string): string;
Returns the footer text based on the header kind: project caption, custom text or empty text for hidden footer.

function GetTopicHeaderKind(const aTopicId: string): Integer;
Returns the topic's kind of header text: normal, custom, hidden.

function GetTopicHeaderText(const aTopicId: string): string;
Returns the custom topic header text.

function GetTopicHeaderTextCalculated(const aTopicId: string): string;
Returns the header text based on the header kind: topic title, custom text or empty text for hidden header.

function GetTopicHelpContext(const aTopicId: string): Integer;
Get a specific topic's help context.

function GetTopicHelpId(const aTopicId: string): string;
Get a specific topic's help id.

function GetTopicIconIndex(const aTopicId: string): Integer;
Get the icon index for a specific topic.

function GetTopicKind(const aTopicId: string): Integer;
Returns the kind of the specific topic.

function GetTopicLast: string;
Returns the last topic in the project.

function GetTopicLevel(const aTopicId: string): Integer;
Returns the level of the specified topic.

function GetTopicList(const aIncludingProjectTopic: Boolean = False): THndTopicsInfoArray;
Returns a list of topics and their associated ID as object.

function GetTopicModificationDateTime(const aTopicId: string): TDateTime;
Returns the date and time when the topics was last modified.

function GetTopicNext(const aTopicId: string): string;
Get the next topic in line. Could be a child or a sibbling topic.

function GetTopicNextSibbling(const aTopicId: string): string;
Get the next sibbling topic.

function GetTopicOrder(const aTopicId: string): Integer;
Returns the order of the topic based on sibbling topics.

function GetTopicParent(const aTopicId: string): string;
Returns the parent topic of a topic.

function GetTopicPrevious(const aTopicId: string): string;
Returns a list of topics and their associated ID as object.

function GetTopicPreviousSibbling(const aTopicId: string): string;
Get the previous sibbling topic.

function GetTopicUrlFile(const aTopicId: string): string;
Returns the topic's URL file property.

function GetTopicUrlLink(const aTopicId: string): string;
Returns the topic's URL link property.

function MoveTopic(const aTopicId, aReferencedTopicId: string; const oAttachMode: THndTopicsAttachMode): Boolean;
Move the topic to a new position in reference to nReferencedTopicsId.

function MoveTopicDown(const aTopicId: string): Boolean;
Move the specific topic bellow the next sibbling.

function MoveTopicLeft(const aTopicId: string): Boolean;
Move the specific topic left in the hierarchy.

function MoveTopicRight(const aTopicId: string): Boolean;
Move the specific topic right in the hierarchy.

function MoveTopicUp(const aTopicId: string): Boolean;
Move the specific topic above the previous sibbling.

procedure PasteTopicFromClipboard(aParentId: string);
Paste the topic from clipboard as a child of the parent specified or as a child of the project topic.

procedure SetCurrentTopic(const aTopicId: string);
Defines the currently selected topic.

procedure SetTopicCaption(const aTopicId, sNewCaption: string);
Defines the specific topic's caption.

procedure SetTopicContent(const aTopicId: string; const aContentStream: TStream);
Set the topic's content.

procedure SetTopicFooterKind(const aTopicId: string; const aFooterKind: Integer);
Sets the topic footer kind.

function SetTopicFooterText(const aTopicId, aFooterText: string): string;
Sets the custom text for the topic footer.

procedure SetTopicHeaderKind(const aTopicId: string; const anHeaderKind: Integer);
Sets the topic header kind.

function SetTopicHeaderText(const aTopicId, anHeaderText: string): string;
Sets the custom text for the topic header.

function SetTopicHelpContext(const aTopicId: string; const aHelpContext: Integer): Integer;
Set a specific topic's help context. Returns the corrected context.

function SetTopicHelpId(const aTopicId, aHelpId: string): string;
Set a specific topic's help id. Returns the corrected string.

procedure SetTopicIconIndex(const aTopicId: string; const nIconIndex: Integer);
et the icon index of a specific topic.

function SetTopicKind(const aTopicId: string; const aNewKind: Integer): Integer;
Set the topic kind (1: normal; 2: empty; 3: Link to URL; 4: Link to file)

procedure SetTopicUrlFile(const aTopicId, anUrlFile: string);
Set the topic's URL file.

procedure SetTopicUrlLink(const aTopicId, anUrlLink: string);
Set the topic's URL link.

HndTopicsKeywords

function AreTopicAndKeywordAssociated(const aTopicId, aKeywordId: string): Boolean;
Indicates wether the specified topic and keyword are associated.

function AssociateTopicWithKeyword(const aTopicId, aKeywordId: string): Boolean;
Link a specific topic to a specific keyword.

function DissociateTopicFromKeyword(const aTopicId, aKeywordId: string): Boolean;
Remove the association between the specified topic and keyword.

function GetKeywordsAssociatedWithTopic(const aTopicId: string): TStringDynArray;
Get a list of keyword Ids associated with a specific topic.

function GetTopicsAssociatedWithKeyword(const aKeywordId: string): TStringDynArray;
Get a list of topic Ids associated with a specific keyword.

Home

Copyright © 2011 by IBE Software. All Rights Reserved.