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 write

Descriptor

Gets refence to the descriptor of the module.

property Descriptor:

Descriptor    (declared in THYSimpleModuleController)

property Descriptor: THYBaseDescriptor read write

Factories

Sets reference to an instance of the host.

property Factories[Index: Integer]: THYBasePluginFactory read write

FactoryCount

Gets number of registered factories.

property FactoryCount: Integer read write

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)

function GetPluginDescriptor(aPluginName: string): THYPluginDescriptor

Parameters:

  • aPluginName:

Host

The reference to the plugin host interface.

property Host: IHYVCLHost read write

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 write

PluginDescriptors

The reference to a plugin descriptor with specified index.

property PluginDescriptors[Index: Integer]: THYPluginDescriptor read write

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.

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 write

Descriptor

Gets refence to the descriptor of the module.

property Descriptor:

Descriptor    (declared in THYSimpleModuleController)

property Descriptor: THYBaseDescriptor read write

Factories

Sets reference to an instance of the host.

property Factories[Index: Integer]: THYBasePluginFactory read write

FactoryCount

Gets number of registered factories.

property FactoryCount: Integer read write

Host

The reference to the plugin host interface.

property Host: IHYVCLHost read write

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 write

PluginDescriptors

The reference to a plugin descriptor with specified index.

property PluginDescriptors[Index: Integer]: THYPluginDescriptor read write

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.

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)

function GetPluginDescriptor(aPluginName: string): THYPluginDescriptor

Parameters:

  • aPluginName:

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.

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)