Templates
This page covers ITemplate, ITemplates, ITemplateChangeEvent, and ITemplateChangeEventHandler. Templates own reusable groups of pieces and expose the same add, remove, and change patterns used elsewhere in the Desktop model.
Interfaces
ITemplate
Saved template that owns a collection of reusable formats.
Source: SDK/include/pascal/uITemplate.pas
Properties
- Property name
- Id
- Type
- Int64
- Description
Persistent numeric identifier used by TonCut to track the object.
Declaration
property Id: Int64 read GetId write SetId;Published SDK declaration languages: Pascal.
- Property name
- Title
- Type
- WideString
- Description
Human-readable title shown to users.
Declaration
property Title: WideString read GetTitle write SetTitle;Published SDK declaration languages: Pascal.
- Property name
- Description
- Type
- WideString
- Description
Longer descriptive text stored with the object.
Declaration
property Description: WideString read GetDescription write SetDescription;Published SDK declaration languages: Pascal.
- Property name
- Formats
- Type
- IFormats
- Description
Shared format collection exposed by the host.
Declaration
property Formats: IFormats read GetFormats;Published SDK declaration languages: Pascal.
- Property name
- OnChange
- Type
- INotifyEvent
- Description
Event fired when the object or collection changes.
Declaration
property OnChange: INotifyEvent read GetOnChange;Published SDK declaration languages: Pascal.
- Property name
- OnIdChange
- Type
- IIdChangeEvent
- Description
Event fired when an identifier changes.
Declaration
property OnIdChange: IIdChangeEvent read GetOnIdChange;Published SDK declaration languages: Pascal.
- Property name
- OnFormatAdd
- Type
- IFormatChangeEvent
- Description
Event exposed through OnFormatAdd.
Declaration
property OnFormatAdd: IFormatChangeEvent read GetOnFormatAdd;Published SDK declaration languages: Pascal.
- Property name
- OnFormatRemove
- Type
- IFormatChangeEvent
- Description
Event exposed through OnFormatRemove.
Declaration
property OnFormatRemove: IFormatChangeEvent read GetOnFormatRemove;Published SDK declaration languages: Pascal.
- Property name
- OnFormatChange
- Type
- IFormatChangeEvent
- Description
Event exposed through OnFormatChange.
Declaration
property OnFormatChange: IFormatChangeEvent read GetOnFormatChange;Published SDK declaration languages: Pascal.
Methods
- Method name
- Assign()
- Type
- procedure
- Description
Copy values from another object of the same type.
Declaration
procedure Assign(const aOther: ITemplate); safecall;Published SDK declaration languages: Pascal.
Parameters
- Method name
- BeginUpdate()
- Type
- procedure
- Description
Start a batched update so change notifications can be delayed.
Declaration
procedure BeginUpdate(); safecall;Published SDK declaration languages: Pascal.
- Method name
- EndUpdate()
- Type
- procedure
- Description
Finish a batched update and allow deferred notifications to resume.
Declaration
procedure EndUpdate(); safecall;Published SDK declaration languages: Pascal.
ITemplates
Collection interface used to create, enumerate, query, and reload a shared Desktop object set.
Source: SDK/include/pascal/uITemplates.pas
Properties
- Property name
- Count
- Type
- Integer
- Description
Number of items currently exposed by the interface.
Declaration
property Count: Integer read GetCount;Published SDK declaration languages: Pascal.
- Property name
- Items
- Type
- ITemplate
- Description
Indexed property used to read one item from the collection.
Declaration
property Items[aIndex: Cardinal]: ITemplate read GetByIndex; default;Published SDK declaration languages: Pascal.
Index ParametersaIndexCardinalZero-based position within a collection.ValueThe collection item located at the supplied index.
- Property name
- OnAdd
- Type
- ITemplateChangeEvent
- Description
Event fired when an item is added.
Declaration
property OnAdd: ITemplateChangeEvent read GetOnAdd;Published SDK declaration languages: Pascal.
- Property name
- OnRemove
- Type
- ITemplateChangeEvent
- Description
Event fired when an item is removed.
Declaration
property OnRemove: ITemplateChangeEvent read GetOnRemove;Published SDK declaration languages: Pascal.
Methods
- Method name
- CreateTemplate()
- Type
- ITemplate
- Description
Create a new template instance.
Declaration
function CreateTemplate(): ITemplate; safecall;Published SDK declaration languages: Pascal.
ReturnsA new template interface instance.
- Method name
- CreateFormat()
- Type
- IFormat
- Description
Create a new format instance.
Declaration
function CreateFormat(): IFormat; safecall;Published SDK declaration languages: Pascal.
ReturnsA new format interface instance.
- Method name
- Add()
- Type
- procedure
- Description
Add an item or handler.
Declaration
procedure Add(aTemplate: ITemplate); safecall;Published SDK declaration languages: Pascal.
Parameters
- Method name
- DeleteByIndex()
- Type
- procedure
- Description
Delete the item at the specified zero-based index.
Declaration
procedure DeleteByIndex(aIndex: Cardinal); safecall;Published SDK declaration languages: Pascal.
ParametersaIndexCardinalZero-based position within a collection.
- Method name
- DeleteById()
- Type
- procedure
- Description
Delete the item with the specified TonCut identifier.
Declaration
procedure DeleteById(aId: Int64); safecall;Published SDK declaration languages: Pascal.
ParametersaIdInt64TonCut object identifier.
- Method name
- Remove()
- Type
- procedure
- Description
Remove an item or handler.
Declaration
procedure Remove(const aTemplate: ITemplate); safecall;Published SDK declaration languages: Pascal.
Parameters
- Method name
- IndexOf()
- Type
- Integer
- Description
Return the zero-based index of the matching item.
Declaration
function IndexOf(const aTemplate: ITemplate): Integer; overload; safecall;Published SDK declaration languages: Pascal.
ParametersReturnsZero-based index of the matching item, or-1when no match exists.
- Method name
- IndexOf()
- Type
- Integer
- Description
Return the zero-based index of the matching item.
Declaration
function IndexOf(aId: Int64): Integer; overload; safecall;Published SDK declaration languages: Pascal.
ParametersaIdInt64TonCut object identifier.ReturnsZero-based index of the matching item, or-1when no match exists.
- Method name
- CheckUniqueName()
- Type
- Boolean
- Description
Check whether a proposed title is unique within the collection.
Declaration
function CheckUniqueName(const aTitle: WideString; const aIgnoreTemplate: ITemplate): Boolean; overload; safecall;Published SDK declaration languages: Pascal.
ParametersaTitleconstWideStringHuman-readable title.ReturnsReturnstrueif the proposed title is unique within the collection.
- Method name
- CheckUniqueName()
- Type
- Boolean
- Description
Check whether a proposed title is unique within the collection.
Declaration
function CheckUniqueName(aTemplate: ITemplate): Boolean; overload; safecall;Published SDK declaration languages: Pascal.
ParametersReturnsReturnstrueif the proposed title is unique within the collection.
- Method name
- GetById()
- Type
- ITemplate
- Description
Return the item stored under the specified TonCut identifier.
Declaration
function GetById(aId: Int64): ITemplate; safecall;Published SDK declaration languages: Pascal.
ParametersaIdInt64TonCut object identifier.ReturnsThe matching template interface instance.
- Method name
- Reload()
- Type
- procedure
- Description
Reload the underlying data from the host or storage layer.
Declaration
procedure Reload(); safecall;Published SDK declaration languages: Pascal.
ITemplateChangeEventHandler
Callback sink consumed by the matching change-event interface.
Source: SDK/include/pascal/uITemplateChangeEvent.pas
Methods
- Method name
- Invoke()
- Type
- procedure
- Description
Handle the event callback when the owning event interface invokes it.
Declaration
procedure Invoke(aSender: IUnknown; aTemplate: ITemplate; aIndex: Integer); safecall;Published SDK declaration languages: Pascal.
ParametersaSenderIUnknownObject that raised the event.aIndexIntegerZero-based position within a collection.
ITemplateChangeEvent
Event interface with Add, Remove, and Invoke hooks for collection or entity change notifications.
Source: SDK/include/pascal/uITemplateChangeEvent.pas
Methods
- Method name
- Add()
- Type
- procedure
- Description
Add an item or handler.
Declaration
procedure Add(aHandler: ITemplateChangeEventHandler); safecall;Published SDK declaration languages: Pascal.
Parameters
- Method name
- Remove()
- Type
- procedure
- Description
Remove an item or handler.
Declaration
procedure Remove(aHandler: ITemplateChangeEventHandler); safecall;Published SDK declaration languages: Pascal.
Parameters
- Method name
- Invoke()
- Type
- procedure
- Description
Raise the typed change event for the current payload.
Declaration
procedure Invoke(aSender: IUnknown; aTemplate: ITemplate; aIndex: Integer); safecall;Published SDK declaration languages: Pascal.
ParametersaSenderIUnknownObject that raised the event.aIndexIntegerEvent payload field for index.