////////////////////////////////////////////////////////////////////////////////
// CM2CMLXInterface.pas
// --------------------
// This unit contains the CMLx plugin interfaces.
//
// Last Edit: June, 20th 2006
// Certified: NA
//
// This unit is coded in : Delphi 7
//
// Unit is copyright (c) 2004 - 2006, The CoolMon Project
////////////////////////////////////////////////////////////////////////////////
//
// NOTE:
//  Use the ICM2CMLXPlug2 interface. ICM2CMLXPlug is outdated and doesn't
//  work with large return strings, it's only there because of backward
//  compatibility.
//
////////////////////////////////////////////////////////////////////////////////
unit CM2CMLXInterface;

interface

Type
 ICM2CMLXPlug2 = Interface
  ['{606BE16E-ABF4-403C-9039-A3C30318BE87}']
   // Declare Basics
   Function Name(OUT Name: Pchar): HResult; stdcall;
   Function Version(OUT Version: word): HResult; stdcall; // Uses MMRB Notation
   Function RequiredCoreVersion(OUT RCV: Word): HResult; stdcall; // Uses MMRB Notation - Please refer to CM2Plugtypes for details
   Function SetParentHandle(Handle: THandle): HResult; stdcall;
   // Declare Error commands
   Function GetLastErrorMsg(OUT Msg: PChar): HResult; stdcall;
   // Declare Info system
   Function GetInfoCount(OUT InfoCount: Integer): HResult; stdcall;
   Function GetInfo(Index: Integer; OUT InfoName: PChar; OUT InfoVar: PChar): HResult; stdcall;
  // Declare "Event" types
   Function Init: HResult; stdcall;
   Function Terminating: HResult; stdcall;
   Function Setup: HResult; stdcall;
   // Plugin Speficic
   Function TagName(OUT Tag: PChar): HResult; stdcall;
   Function Perform(Attribute: PChar; Parameters: PChar; OUT ResultString: WideString; OUT ResultType: Byte): HResult; stdcall;
  End;

 ICM2CMLXPlug = Interface
  ['{2D6FBF95-EC3F-4138-BBBC-321463AD940E}']
   // Declare Basics
   Function Name(OUT Name: Pchar): HResult; stdcall;
   Function Version(OUT Version: word): HResult; stdcall; // Uses MMRB Notation
   Function RequiredCoreVersion(OUT RCV: Word): HResult; stdcall; // Uses MMRB Notation - Please refer to CM2Plugtypes for details
   Function SetParentHandle(Handle: THandle): HResult; stdcall;
   // Declare Error commands
   Function GetLastErrorMsg(OUT Msg: PChar): HResult; stdcall;
   // Declare Info system
   Function GetInfoCount(OUT InfoCount: Integer): HResult; stdcall;
   Function GetInfo(Index: Integer; OUT InfoName: PChar; OUT InfoVar: PChar): HResult; stdcall;
  // Declare "Event" types
   Function Init: HResult; stdcall;
   Function Terminating: HResult; stdcall;
   Function Setup: HResult; stdcall;
   // Plugin Speficic
   Function TagName(OUT Tag: PChar): HResult; stdcall;
   Function Perform(Attribute: PChar; Parameters: PChar; OUT ResultString: PChar; OUT ResultType: Byte): HResult; stdcall;
  End;

Const
 rtNone = 1;
 rtSensor = 2;
 rtCML = 3;

implementation

{

Result type declares how CM2 should handle/proceed the result provided

 rtNone = 1 // No result
 rtSensor = 2 // result will be handle like a normal sensor plugin, meaning that nothing will done with it, it will be left as is
 rtCML = 3 // Result will handle and processed like a CML expanding data

}

end.
 