unit plugserv;

{$WARN SYMBOL_PLATFORM OFF}

interface

uses
  Windows, ActiveX, Classes, ComObj, CM2AutoUpdateInterface,
  CM2GenInterface, CM2EditorSupportInterface;

type
  TCartman = class(TComObject, ICM2AutoUpdate, ICM2GenPlug, ICM2EditorSupport10)
  protected
   // Declare Basics
   Function Name(OUT Name: Pchar): HResult; stdcall;
   Function Version(OUT Version: word): HResult; stdcall; // Using MMRB Notation
   Function RequiredCoreVersion(OUT RCV: Word): HResult; stdcall; // Using MMRB Notation - Please refer to CM2Plugtypes for details
   Function SetParentHandle(Handle: THandle): HResult; stdcall;
   // Declare Error commands
   Function GetLastErrorMsg(OUT ErrMsg: 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 Sensor system
   Function GetSensorCount(OUT SensorCount: Integer): HResult; stdcall;
   Function GetSensorNameOnly(Index: Integer; OUT SensorName: PChar; OUT SensorStyle: Byte): HResult; stdcall; // Designed for speed polling at startup
   Function GetSensor(Index: Integer; Parameters: PChar; OUT SensorName: PChar; OUT SensorStyle: byte; OUT SensorString: PChar; OUT SensorValue: Double): HResult; stdcall;
   // Declare "Event" functions
   Function Init: HResult; stdcall;
   Function Terminating: HResult; stdcall;
   Function Setup: HResult; stdcall;
   // Declare Support types
   // Default (Required)
   Function GetDefaultCount(SensorIndex: Integer; OUT DefaultCount: Integer): HResult; stdcall;
   Function GetDefault(SensorIndex: Integer; Index: Integer; OUT Name: Pchar; OUT Value: PChar; OUT Description: PChar): HResult; stdcall;
   // Optional
   Function GetOptionalCount(SensorIndex: Integer; OUT OptionalCount: Integer): HResult; stdcall;
   Function GetOptional(SensorIndex: Integer; Index: Integer; OUT Name: Pchar; OUT Value: PChar; OUT Description: PChar): HResult; stdcall;
   // AutoUPD
   Function UpdateFileURL(OUT URL: Pchar): HResult; stdcall;
   // Editor Support
   Function ObjIns(SensorIndex: Integer; ParameterName: PChar; OUT ValueType: Byte; OUT ValueRange: PChar): HResult; stdcall;
   Function OnEditor(SensorIndex: Integer; ParameterName: PChar; FullParameterValues: PChar; OUT Value: PChar): HResult; stdcall;
   Function GetMenuCount(SensorIndex: Integer; OUT MenuCount: Byte): HResult; stdcall;
   Function GetMenuItem(SensorIndex: Integer; Index: Byte; OUT MenuTitle: PChar; OUT MenuHint: PChar): HResult; stdcall;
   Function OnMenu(SensorIndex: Integer; Index: Byte; OUT ResultString: PChar): HResult; stdcall;
   Function ShowSensor(Index: Integer; OUT ShowAt: Byte): HResult; stdcall;
  end;

const
  Class_Cartman: TGUID = '{7BCE6A7E-498A-45EA-8A36-4ADC5C4507E5}';
  Ver = 100;
  RCVersion = 300;
  UpdateStr = 'http://www.coolmon.org/update/cartman.upd';

implementation

uses ComServ, Quotes;

{ TCartman }

function TCartman.GetDefault(SensorIndex, Index: Integer; out Name, Value,
  Description: PChar): HResult;
begin

end;

function TCartman.GetDefaultCount(SensorIndex: Integer;
  out DefaultCount: Integer): HResult;
begin

end;

function TCartman.GetInfo(Index: Integer; out InfoName,
  InfoVar: PChar): HResult;
begin

end;

function TCartman.GetInfoCount(out InfoCount: Integer): HResult;
begin

end;

function TCartman.GetLastErrorMsg(out ErrMsg: PChar): HResult;
begin

end;

function TCartman.GetMenuCount(SensorIndex: Integer;
  out MenuCount: Byte): HResult;
begin

end;

function TCartman.GetMenuItem(SensorIndex: Integer; Index: Byte;
  out MenuTitle, MenuHint: PChar): HResult;
begin

end;

function TCartman.GetOptional(SensorIndex, Index: Integer; out Name, Value,
  Description: PChar): HResult;
begin

end;

function TCartman.GetOptionalCount(SensorIndex: Integer;
  out OptionalCount: Integer): HResult;
begin

end;

function TCartman.GetSensor(Index: Integer; Parameters: PChar;
  out SensorName: PChar; out SensorStyle: byte; out SensorString: PChar;
  out SensorValue: Double): HResult;
begin

end;

function TCartman.GetSensorCount(out SensorCount: Integer): HResult;
begin

end;

function TCartman.GetSensorNameOnly(Index: Integer; out SensorName: PChar;
  out SensorStyle: Byte): HResult;
begin

end;

function TCartman.Init: HResult;
begin

end;

function TCartman.Name(out Name: Pchar): HResult;
begin

end;

function TCartman.ObjIns(SensorIndex: Integer; ParameterName: PChar;
  out ValueType: Byte; out ValueRange: PChar): HResult;
begin

end;

function TCartman.OnEditor(SensorIndex: Integer; ParameterName,
  FullParameterValues: PChar; out Value: PChar): HResult;
begin

end;

function TCartman.OnMenu(SensorIndex: Integer; Index: Byte;
  out ResultString: PChar): HResult;
begin

end;

function TCartman.RequiredCoreVersion(out RCV: Word): HResult;
begin

end;

function TCartman.SetParentHandle(Handle: THandle): HResult;
begin

end;

function TCartman.Setup: HResult;
begin

end;

function TCartman.ShowSensor(Index: Integer; out ShowAt: Byte): HResult;
begin

end;

function TCartman.Terminating: HResult;
begin

end;

function TCartman.UpdateFileURL(out URL: Pchar): HResult;
begin

end;

function TCartman.Version(out Version: word): HResult;
begin

end;

initialization
  TComObjectFactory.Create(ComServer, TCartman, Class_Cartman,
    'Cartman', '', ciMultiInstance, tmApartment);
end.
