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.
ITemplates adds BeginUpdate, EndUpdate, IsUpdating, and
OnChange in engine version 25. BeginUpdate, EndUpdate, IsUpdating, and
GetOnChange are appended after the existing vtable slots under the same interface GUID. See Update scopes
for nesting, notifications, and error handling. Rebuild plugins against the
matching SDK; the Desktop host requires an exact engine version match.
Interfaces
Declarations are shown in Pascal and, where the SDK's generated language-support manifest lists the member for C++, in C++; the build fails if that manifest no longer matches TonCutPluginSdk.hpp. There is no C# declaration: C# plugins are native-shim-only, so a C++ shim owns every interface on this page. Methods are listed with their accessors folded into properties; open Vtable order for the exact slot sequence, and see ABI and marshalling for type sizes and ownership rules.
ITemplate
Saved template that owns a collection of reusable formats.
- IID
- {13F64158-F0FF-4D5A-AFE4-D8AB7969D82E}
- Parent
- IUnknown (implicit: a Delphi interface without a parent is IUnknown)
- Unit
- uITemplate
The SDK's language-support manifest lists no C++ member of this interface. If your TonCutPluginSdk.hpp leaves it opaque, declare the interface yourself in the vtable order below.
Vtable order (15 methods, slots 3 to 17, after the three IUnknown slots)
- function GetId(): Int64;
- procedure SetId(aId: Int64);
- function GetTitle(): WideString;
- procedure SetTitle(const aTitle: WideString);
- function GetDescription(): WideString;
- procedure SetDescription(const aDescription: WideString);
- function GetFormats(): IFormats;
- function GetOnChange(): INotifyEvent;
- function GetOnIdChange(): IIdChangeEvent;
- function GetOnFormatAdd(): IFormatChangeEvent;
- function GetOnFormatRemove(): IFormatChangeEvent;
- function GetOnFormatChange(): IFormatChangeEvent;
- procedure Assign(const aOther: ITemplate);
- procedure BeginUpdate();
- procedure EndUpdate();
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;
- Property name
- Title
- Type
- WideString
- Description
Human-readable title shown to users.
Declaration
property Title: WideString read GetTitle write SetTitle;
- Property name
- Description
- Type
- WideString
- Description
Name or descriptive text shown to the user.
Declaration
property Description: WideString read GetDescription write SetDescription;
- Property name
- Formats
- Type
- IFormats
- Description
Shared format collection exposed by the host.
Declaration
property Formats: IFormats read GetFormats;
- Property name
- OnChange
- Type
- INotifyEvent
- Description
Event fired when the object or collection changes.
Declaration
property OnChange: INotifyEvent read GetOnChange;
- Property name
- OnIdChange
- Type
- IIdChangeEvent
- Description
Event fired when an identifier changes.
Declaration
property OnIdChange: IIdChangeEvent read GetOnIdChange;
- Property name
- OnFormatAdd
- Type
- IFormatChangeEvent
- Description
Event exposed through OnFormatAdd.
Declaration
property OnFormatAdd: IFormatChangeEvent read GetOnFormatAdd;
- Property name
- OnFormatRemove
- Type
- IFormatChangeEvent
- Description
Event exposed through OnFormatRemove.
Declaration
property OnFormatRemove: IFormatChangeEvent read GetOnFormatRemove;
- Property name
- OnFormatChange
- Type
- IFormatChangeEvent
- Description
Event exposed through OnFormatChange.
Declaration
property OnFormatChange: IFormatChangeEvent read GetOnFormatChange;
Methods
- Method name
- Assign()
- Type
- procedure
- Description
Copy values from another object of the same type.
Declaration
procedure Assign(const aOther: ITemplate); safecall;Parameters
- Method name
- BeginUpdate()
- Type
- procedure
- Description
Start a batched update so change notifications can be delayed.
Declaration
procedure BeginUpdate(); safecall;
- Method name
- EndUpdate()
- Type
- procedure
- Description
Finish a batched update and allow deferred notifications to resume.
Declaration
procedure EndUpdate(); safecall;
ITemplates
Collection interface used to create, enumerate, query, and reload a shared Desktop object set.
- IID
- {EDBF1B3E-F26E-49C9-807A-C2D5601849BF}
- Parent
- IUnknown (implicit: a Delphi interface without a parent is IUnknown)
- Unit
- uITemplates
The SDK's language-support manifest lists no C++ member of this interface. If your TonCutPluginSdk.hpp leaves it opaque, declare the interface yourself in the vtable order below.
Vtable order (20 methods, slots 3 to 22, after the three IUnknown slots)
- function CreateTemplate(): ITemplate;
- function CreateFormat(): IFormat;
- procedure Add(aTemplate: ITemplate);
- procedure DeleteByIndex(aIndex: Cardinal);
- procedure DeleteById(aId: Int64);
- procedure Remove(const aTemplate: ITemplate);
- function IndexOf(const aTemplate: ITemplate): Integer; overload;
- function IndexOf(aId: Int64): Integer; overload;
- function CheckUniqueName(const aTitle: WideString; const aIgnoreTemplate: ITemplate): Boolean; overload;
- function CheckUniqueName(aTemplate: ITemplate): Boolean; overload;
- function GetCount(): Integer;
- function GetByIndex(aIndex: Cardinal): ITemplate;
- function GetById(aId: Int64): ITemplate;
- function GetOnAdd(): ITemplateChangeEvent;
- function GetOnRemove(): ITemplateChangeEvent;
- procedure Reload();
- procedure BeginUpdate();
- procedure EndUpdate();
- function IsUpdating(): Boolean;
- function GetOnChange(): INotifyEvent;
Properties
- Property name
- Count
- Type
- Integer
- Description
Number of items currently exposed by the interface.
Declaration
property Count: Integer read GetCount;
- 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;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. Suppressed during a collection update scope; the outermost changed scope emits one collection
OnChangeinstead.Declaration
property OnAdd: ITemplateChangeEvent read GetOnAdd;
- Property name
- OnRemove
- Type
- ITemplateChangeEvent
- Description
Event fired when an item is removed. Suppressed during a collection update scope; the outermost changed scope emits one collection
OnChangeinstead.Declaration
property OnRemove: ITemplateChangeEvent read GetOnRemove;
- Property name
- OnChange
- Type
- INotifyEvent
- Description
Collection notification emitted once when the outermost changed update scope ends (engine version 25). Empty scopes emit nothing. Outside a scope, adds/removes use
OnAdd/OnRemove, and item edits do not emit this collection event. Item events remain active inside collection scopes.Declaration
property OnChange: INotifyEvent read GetOnChange;
Methods
- Method name
- CreateTemplate()
- Type
- ITemplate
- Description
Create a new template instance.
Declaration
function CreateTemplate(): ITemplate; safecall;ReturnsA new template interface instance.
- Method name
- CreateFormat()
- Type
- IFormat
- Description
Create a new format instance.
Declaration
function CreateFormat(): IFormat; safecall;ReturnsA new format interface instance.
- Method name
- Add()
- Type
- procedure
- Description
Add an item or handler.
Declaration
procedure Add(aTemplate: ITemplate); safecall;Parameters
- Method name
- DeleteByIndex()
- Type
- procedure
- Description
Delete the item at the specified zero-based index.
Declaration
procedure DeleteByIndex(aIndex: Cardinal); safecall;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;ParametersaIdInt64TonCut object identifier.
- Method name
- Remove()
- Type
- procedure
- Description
Remove an item or handler.
Declaration
procedure Remove(const aTemplate: ITemplate); safecall;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;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;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;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;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;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;
- Method name
- BeginUpdate()
- Type
- procedure
- Description
Begin a nested collection notification scope (engine version 25). Balance each call with
EndUpdateinfinally. Changes take effect immediately; the scope provides no rollback.Declaration
procedure BeginUpdate(); safecall;
- Method name
- EndUpdate()
- Type
- procedure
- Description
End one collection notification scope (engine version 25). The outermost call emits one collection
OnChangeonly if an add, remove, or itemOnChangeoccurred in the scope; suppressed add/remove callbacks are not replayed. Raises an error without a matchingBeginUpdate.Declaration
procedure EndUpdate(); safecall;
- Method name
- IsUpdating()
- Type
- Boolean
- Description
Report whether at least one collection notification scope remains open (engine version 25). Nested scopes remain active until the outermost
EndUpdate.Declaration
function IsUpdating(): Boolean; safecall;ReturnsReturnstruewhile the interface is inside aBeginUpdate/EndUpdatebatch.
ITemplateChangeEventHandler
Callback sink consumed by the matching change-event interface.
- IID
- {E8FE8BF5-57E6-4A4A-B643-1856BA84EF66}
- Parent
- IUnknown
- Unit
- uITemplateChangeEvent
The SDK's language-support manifest lists no C++ member of this interface. If your TonCutPluginSdk.hpp leaves it opaque, declare the interface yourself in the vtable order below.
Vtable order (1 methods, slots 3 to 3, after the three IUnknown slots)
- procedure Invoke(aSender: IUnknown; aTemplate: ITemplate; aIndex: Integer);
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;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.
- IID
- {EBFFBF8E-66C3-4401-8A2B-6E7419D58BD3}
- Parent
- IUnknown
- Unit
- uITemplateChangeEvent
The SDK's language-support manifest lists no C++ member of this interface. If your TonCutPluginSdk.hpp leaves it opaque, declare the interface yourself in the vtable order below.
Vtable order (3 methods, slots 3 to 5, after the three IUnknown slots)
- procedure Add(aHandler: ITemplateChangeEventHandler);
- procedure Remove(aHandler: ITemplateChangeEventHandler);
- procedure Invoke(aSender: IUnknown; aTemplate: ITemplate; aIndex: Integer);
Methods
- Method name
- Add()
- Type
- procedure
- Description
Add an item or handler.
Declaration
procedure Add(aHandler: ITemplateChangeEventHandler); safecall;Parameters
- Method name
- Remove()
- Type
- procedure
- Description
Remove an item or handler.
Declaration
procedure Remove(aHandler: ITemplateChangeEventHandler); safecall;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;ParametersaSenderIUnknownObject that raised the event.aIndexIntegerEvent payload field for index.