THYVCLModuleController

Overview

The purpose of the THYVCLModuleController component is to centralize plugin registration in the Hydra module DLL. Each Hydra plugin in the DLL registers itself with the module controller, and the host application uses the module controller for accessing the plugins.

There must be one THYVCLModuleController in each Hydra module, and it must be returned by a function that is exported from the plugin DLL under the HYGetCrossPlatformModule or HYGetModuleController.

Location


 

constructor Create (TComponent)  overload override    (declared in THYSimpleModuleController)

Creates a new instance of the class.

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner:

constructor Create (string, Integer, Integer, string, string)  reintroduce overload virtual    (declared in THYSimpleModuleController)

Creates a new instance of the class.

constructor Create(const aLibraryName: string; aMajorVersion: Integer; aMinorVersion: Integer; const aRequiredPrivilege: string; const aDescription: string)

Parameters:

  • aLibraryName:
  • aMajorVersion:
  • aMinorVersion:
  • aRequiredPrivilege:
  • aDescription:

constructor CreateNew (string, Integer, Integer, string, string, Integer)  reintroduce overload virtual    (declared in THYSimpleModuleController)

Creates a new instance of the class.

constructor CreateNew(const aLibraryName: string; aMajorVersion: Integer; aMinorVersion: Integer; const aRequiredPrivilege: string; const aDescription: string; Dummy: Integer)

Parameters:

  • aLibraryName:
  • aMajorVersion:
  • aMinorVersion:
  • aRequiredPrivilege:
  • aDescription:
  • Dummy:

CreateInstance  protected override safecall

Creates a new instance of the plugin with specified name.

function CreateInstance(const aPluginName: WideString): IHYCrossPlatformPlugin

Parameters:

  • aPluginName: Name of the plugin instance.

CrossPlatformHost    (declared in THYSimpleModuleController)

Reference to an instance of a cross platform host.

property CrossPlatformHost: IHYCrossPlatformHost read

Descriptor

Gets refence to the descriptor of the module.

property Descriptor:

Descriptor    (declared in THYSimpleModuleController)

property Descriptor: THYBaseDescriptor read

DuplicatePluginDescriptor  protected    (declared in THYSimpleModuleController)

function DuplicatePluginDescriptor(Index: Integer): THYPluginDescriptor

Parameters:

  • Index:

Factories

Returns reference to a factory with given index.

property Factories[Index: Integer]: THYBasePluginFactory read

FactoryCount

Gets number of registered factories.

property FactoryCount: Integer read

FindFactory

Searches for a factory with given name.

function FindFactory(const aPluginName: string): THYBasePluginFactory

Parameters:

  • aPluginName: Name of the factory.

get_Plugin  protected override safecall

Returns the reference to a plugin descriptor with specified index.

function get_Plugin(aIndex: Integer): IHYCrossPlatformPluginDescriptor

Parameters:

  • aIndex:

GetDLLInstance

Gets handle of the module.

function GetDLLInstance: cardinal

GetModuleController  protected safecall    (declared in THYSimpleModuleController)

Returns the interface of the current module controller.

function GetModuleController: IHYCrossPlatformModuleController

GetPluginDescriptor    (declared in THYSimpleModuleController)

Receives reference to a plugin descriptor with specified name.

function GetPluginDescriptor(aPluginName: string): THYPluginDescriptor

Parameters:

  • aPluginName: plugin name.

Host

Gets reference to an instance of the host.

property Host: IHYVCLHost read

IHYCrossPlatformModuleController_GetLargeImages  protected override safecall

Returns the handle of the image list used for large images.

function IHYCrossPlatformModuleController_GetLargeImages: THandle

IHYCrossPlatformModuleController_GetSmallImages  protected override safecall

Returns the handle of the image list used for small images.

function IHYCrossPlatformModuleController_GetSmallImages: THandle

InitializeObject  protected override

procedure InitializeObject

LargeImages

Gets or sets reference to a image list that holds large images.

property LargeImages: TImageList read write

LargeImagesDisabled

Gets or sets reference to a image list that holds large disabled images.

property LargeImagesDisabled: TImageList read write

LargeImagesHot

Gets or sets reference to a image list that holds large hot images.

property LargeImagesHot: TImageList read write

OnHostParametersChange  protected virtual

Event handler. Reacts on a host parameters changes.

procedure OnHostParametersChange(Sender: TObject)

Parameters:

  • Sender: Sender of the event.

OnSetHost

Fires when reference to a host is changed.

property OnSetHost: THYHostSetEvent read write
delegate: procedure OnSetHost(const Sender: IHYVCLHostAware; const aHost: IHYVCLHost)

OnSetHostParameters

Fires when host parameters is set.

property OnSetHostParameters: THYHostParametersChangeEvent read write
delegate: procedure OnSetHostParameters(const aHost: IHYVCLHost; aParameters: TStrings)

PluginDescriptorCount

Gets number of registered plugin descriptors.

property PluginDescriptorCount: Integer read

PluginDescriptors

The reference to a plugin descriptor with specified index.

property PluginDescriptors[Index: Integer]: THYPluginDescriptor read

RegisterPluginFactory

Register plugin factory inside module controller.

procedure RegisterPluginFactory(const aPluginFactory: THYBasePluginFactory)

Parameters:

  • aPluginFactory: Reference to a plugin factory.

SafeCallException  override

Handles exceptions in methods declared using the safecall calling convention.

function SafeCallException(ExceptObject: TObject; ExceptAddr: Pointer): HResult

Parameters:

  • ExceptObject: Exception object.
  • ExceptAddr: Addres of the exception.

SetHost  protected virtual

Sets reference to an instance of the host.

procedure SetHost(const Value: IHYVCLHost)

Parameters:

  • Value: Reference to the host instance.

SetHostParameters  protected virtual

Sets list of a host parameters.

procedure SetHostParameters(Value: TStrings)

Parameters:

  • Value: Reference to a list of parameters.

SmallImages

Gets or sets reference to a image list that holds small images.

property SmallImages: TImageList read write

SmallImagesDisabled

Gets or sets reference to a image list that holds small disabled images.

property SmallImagesDisabled: TImageList read write

SmallImagesHot

Gets or sets reference to a image list that holds small hot images.

property SmallImagesHot: TImageList read write

 

CrossPlatformHost    (declared in THYSimpleModuleController)

Reference to an instance of a cross platform host.

property CrossPlatformHost: IHYCrossPlatformHost read

Descriptor

Gets refence to the descriptor of the module.

property Descriptor:

Descriptor    (declared in THYSimpleModuleController)

property Descriptor: THYBaseDescriptor read

Factories

Returns reference to a factory with given index.

property Factories[Index: Integer]: THYBasePluginFactory read

FactoryCount

Gets number of registered factories.

property FactoryCount: Integer read

Host

Gets reference to an instance of the host.

property Host: IHYVCLHost read

LargeImages

Gets or sets reference to a image list that holds large images.

property LargeImages: TImageList read write

LargeImagesDisabled

Gets or sets reference to a image list that holds large disabled images.

property LargeImagesDisabled: TImageList read write

LargeImagesHot

Gets or sets reference to a image list that holds large hot images.

property LargeImagesHot: TImageList read write

PluginDescriptorCount

Gets number of registered plugin descriptors.

property PluginDescriptorCount: Integer read

PluginDescriptors

The reference to a plugin descriptor with specified index.

property PluginDescriptors[Index: Integer]: THYPluginDescriptor read

SmallImages

Gets or sets reference to a image list that holds small images.

property SmallImages: TImageList read write

SmallImagesDisabled

Gets or sets reference to a image list that holds small disabled images.

property SmallImagesDisabled: TImageList read write

SmallImagesHot

Gets or sets reference to a image list that holds small hot images.

property SmallImagesHot: TImageList read write

 

constructor Create (TComponent)  overload override    (declared in THYSimpleModuleController)

Creates a new instance of the class.

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner:

constructor Create (string, Integer, Integer, string, string)  reintroduce overload virtual    (declared in THYSimpleModuleController)

Creates a new instance of the class.

constructor Create(const aLibraryName: string; aMajorVersion: Integer; aMinorVersion: Integer; const aRequiredPrivilege: string; const aDescription: string)

Parameters:

  • aLibraryName:
  • aMajorVersion:
  • aMinorVersion:
  • aRequiredPrivilege:
  • aDescription:

constructor CreateNew (string, Integer, Integer, string, string, Integer)  reintroduce overload virtual    (declared in THYSimpleModuleController)

Creates a new instance of the class.

constructor CreateNew(const aLibraryName: string; aMajorVersion: Integer; aMinorVersion: Integer; const aRequiredPrivilege: string; const aDescription: string; Dummy: Integer)

Parameters:

  • aLibraryName:
  • aMajorVersion:
  • aMinorVersion:
  • aRequiredPrivilege:
  • aDescription:
  • Dummy:

CreateInstance  protected override safecall

Creates a new instance of the plugin with specified name.

function CreateInstance(const aPluginName: WideString): IHYCrossPlatformPlugin

Parameters:

  • aPluginName: Name of the plugin instance.

DuplicatePluginDescriptor  protected    (declared in THYSimpleModuleController)

function DuplicatePluginDescriptor(Index: Integer): THYPluginDescriptor

Parameters:

  • Index:

FindFactory

Searches for a factory with given name.

function FindFactory(const aPluginName: string): THYBasePluginFactory

Parameters:

  • aPluginName: Name of the factory.

get_Plugin  protected override safecall

Returns the reference to a plugin descriptor with specified index.

function get_Plugin(aIndex: Integer): IHYCrossPlatformPluginDescriptor

Parameters:

  • aIndex:

GetDLLInstance

Gets handle of the module.

function GetDLLInstance: cardinal

GetModuleController  protected safecall    (declared in THYSimpleModuleController)

Returns the interface of the current module controller.

function GetModuleController: IHYCrossPlatformModuleController

GetPluginDescriptor    (declared in THYSimpleModuleController)

Receives reference to a plugin descriptor with specified name.

function GetPluginDescriptor(aPluginName: string): THYPluginDescriptor

Parameters:

  • aPluginName: plugin name.

IHYCrossPlatformModuleController_GetLargeImages  protected override safecall

Returns the handle of the image list used for large images.

function IHYCrossPlatformModuleController_GetLargeImages: THandle

IHYCrossPlatformModuleController_GetSmallImages  protected override safecall

Returns the handle of the image list used for small images.

function IHYCrossPlatformModuleController_GetSmallImages: THandle

InitializeObject  protected override

procedure InitializeObject

OnHostParametersChange  protected virtual

Event handler. Reacts on a host parameters changes.

procedure OnHostParametersChange(Sender: TObject)

Parameters:

  • Sender: Sender of the event.

RegisterPluginFactory

Register plugin factory inside module controller.

procedure RegisterPluginFactory(const aPluginFactory: THYBasePluginFactory)

Parameters:

  • aPluginFactory: Reference to a plugin factory.

SafeCallException  override

Handles exceptions in methods declared using the safecall calling convention.

function SafeCallException(ExceptObject: TObject; ExceptAddr: Pointer): HResult

Parameters:

  • ExceptObject: Exception object.
  • ExceptAddr: Addres of the exception.

SetHost  protected virtual

Sets reference to an instance of the host.

procedure SetHost(const Value: IHYVCLHost)

Parameters:

  • Value: Reference to the host instance.

SetHostParameters  protected virtual

Sets list of a host parameters.

procedure SetHostParameters(Value: TStrings)

Parameters:

  • Value: Reference to a list of parameters.

 

OnSetHost

Fires when reference to a host is changed.

property OnSetHost: THYHostSetEvent read write
delegate: procedure OnSetHost(const Sender: IHYVCLHostAware; const aHost: IHYVCLHost)

OnSetHostParameters

Fires when host parameters is set.

property OnSetHostParameters: THYHostParametersChangeEvent read write
delegate: procedure OnSetHostParameters(const aHost: IHYVCLHost; aParameters: TStrings)