unit VERGENCECONTEXTORLib_TLB;

// ************************************************************************ //
// WARNING                                                                    
// -------                                                                    
// The types declared in this file were generated from data read from a       
// Type Library. If this type library is explicitly or indirectly (via        
// another type library referring to this type library) re-imported, or the   
// 'Refresh' command of the Type Library Editor activated while editing the   
// Type Library, the contents of this file will be regenerated and all        
// manual modifications will be lost.                                         
// ************************************************************************ //

// PASTLWTR : $Revision:   1.130.1.0.1.0.1.6  $
// File generated on 2/20/2003 12:37:40 PM from Type Library described below.

// ************************************************************************  //
// Type Lib: C:\Program Files\Sentillion\Sdk\WindowsComponents\VergenceContextor.dll (1)
// LIBID: {30AFBABD-5FD3-11D3-8727-0060B0B5E137}
// LCID: 0
// Helpfile: 
// DepndLst: 
//   (1) v2.0 stdole, (C:\WINNT\System32\stdole2.tlb)
//   (2) v4.0 StdVCL, (C:\WINNT\System32\STDVCL40.DLL)
// Errors:
//   Hint: Member 'Set' of 'IResponseDialogAccessor' changed to 'Set_'
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface

uses Windows, ActiveX, Classes, Graphics, OleCtrls, OleServer, StdVCL, Variants;
  


// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:        
//   Type Libraries     : LIBID_xxxx                                      
//   CoClasses          : CLASS_xxxx                                      
//   DISPInterfaces     : DIID_xxxx                                       
//   Non-DISP interfaces: IID_xxxx                                        
// *********************************************************************//
const
  // TypeLibrary Major and minor versions
  VERGENCECONTEXTORLibMajorVersion = 1;
  VERGENCECONTEXTORLibMinorVersion = 0;

  LIBID_VERGENCECONTEXTORLib: TGUID = '{30AFBABD-5FD3-11D3-8727-0060B0B5E137}';

  DIID__IContextChangesSink: TGUID = '{6BED8971-B3DD-11D3-8736-0060B0B5E137}';
  IID_IContextor: TGUID = '{8D879F5D-5FE6-11D3-8727-0060B0B5E137}';
  IID_IContextParticipant: TGUID = '{3E3DD272-998E-11D0-808D-00A0240943E4}';
  IID_IContextItemCollection: TGUID = '{AC4C0271-615A-11D3-84B5-0000861FDD4F}';
  IID_IContextItem: TGUID = '{AC4C0273-615A-11D3-84B5-0000861FDD4F}';
  IID_IResponseContextChange: TGUID = '{CBC6D968-9F6D-416A-8AA7-99172E588DF0}';
  IID_IResponseDialogAccessor: TGUID = '{86592071-F3BA-11D3-8181-005004A0F801}';
  IID_IContextChangesSink: TGUID = '{0B437E31-620E-11D3-84B6-0000861FDD4F}';
  IID_IResponseDialog: TGUID = '{9D33ECF1-8277-11D3-8525-0000861FDD4F}';
  CLASS_Contextor: TGUID = '{D5C9CC98-5FDB-11D3-8727-0060B0B5E137}';
  CLASS_ContextorControl: TGUID = '{8778ACF7-5CA9-11D3-8727-0060B0B5E137}';
  CLASS_ContextItemCollection: TGUID = '{AC4C0272-615A-11D3-84B5-0000861FDD4F}';
  CLASS_ContextItem: TGUID = '{AC4C0274-615A-11D3-84B5-0000861FDD4F}';
  CLASS_ResponseDialog: TGUID = '{9D33ECF2-8277-11D3-8525-0000861FDD4F}';
  IID_ISetHook: TGUID = '{8D879FDD-5FE6-11D3-8727-0060B0B5E137}';
  CLASS_ContextorParticipant: TGUID = '{4BA034A2-D0FA-11D3-818B-0050049598B2}';

// *********************************************************************//
// Declaration of Enumerations defined in Type Library                    
// *********************************************************************//
// Constants for enum __MIDL___MIDL_itf_VergenceContextor_0000_0002
type
  __MIDL___MIDL_itf_VergenceContextor_0000_0002 = TOleEnum;
const
  CsNotRunning = $00000001;
  CsParticipating = $00000002;
  CsSuspended = $00000003;

// Constants for enum __MIDL___MIDL_itf_VergenceContextor_0000_0001
type
  __MIDL___MIDL_itf_VergenceContextor_0000_0001 = TOleEnum;
const
  ApNone = $00000001;
  ApGet = $00000002;
  ApSet = $00000003;

// Constants for enum __MIDL___MIDL_itf_VergenceContextor_0000_0003
type
  __MIDL___MIDL_itf_VergenceContextor_0000_0003 = TOleEnum;
const
  UrCommit = $00000001;
  UrCancel = $00000002;
  UrBreak = $00000003;

type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary                    
// *********************************************************************//
  _IContextChangesSink = dispinterface;
  IContextor = interface;
  IContextorDisp = dispinterface;
  IContextParticipant = interface;
  IContextParticipantDisp = dispinterface;
  IContextItemCollection = interface;
  IContextItemCollectionDisp = dispinterface;
  IContextItem = interface;
  IContextItemDisp = dispinterface;
  IResponseContextChange = interface;
  IResponseContextChangeDisp = dispinterface;
  IResponseDialogAccessor = interface;
  IResponseDialogAccessorDisp = dispinterface;
  IContextChangesSink = interface;
  IContextChangesSinkDisp = dispinterface;
  IResponseDialog = interface;
  IResponseDialogDisp = dispinterface;
  ISetHook = interface;
  ISetHookDisp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library                       
// (NOTE: Here we map each CoClass to its Default Interface)              
// *********************************************************************//
  Contextor = IContextor;
  ContextorControl = IContextor;
  ContextItemCollection = IContextItemCollection;
  ContextItem = IContextItem;
  ResponseDialog = IResponseDialog;
  ContextorParticipant = IContextParticipant;


// *********************************************************************//
// Declaration of structures, unions and aliases.                         
// *********************************************************************//

  ContextorState = __MIDL___MIDL_itf_VergenceContextor_0000_0002; 
  AccessPrivilege = __MIDL___MIDL_itf_VergenceContextor_0000_0001; 
  UserResponse = __MIDL___MIDL_itf_VergenceContextor_0000_0003; 

// *********************************************************************//
// DispIntf:  _IContextChangesSink
// Flags:     (4096) Dispatchable
// GUID:      {6BED8971-B3DD-11D3-8736-0060B0B5E137}
// *********************************************************************//
  _IContextChangesSink = dispinterface
    ['{6BED8971-B3DD-11D3-8736-0060B0B5E137}']
    procedure Pending(const aContextItemCollection: IDispatch); dispid 1;
    procedure Committed; dispid 2;
    procedure Canceled; dispid 3;
  end;

// *********************************************************************//
// Interface: IContextor
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {8D879F5D-5FE6-11D3-8727-0060B0B5E137}
// *********************************************************************//
  IContextor = interface(IDispatch)
    ['{8D879F5D-5FE6-11D3-8727-0060B0B5E137}']
    procedure Run(const applicationLabel: WideString; const passcode: WideString; survey: WordBool; 
                  const initialNotificationFilter: WideString); safecall;
    procedure Suspend; safecall;
    procedure Resume; safecall;
    function Get_State: ContextorState; safecall;
    function GetPrivilege(const subj: WideString): AccessPrivilege; safecall;
    function Get_CurrentContext: IContextItemCollection; safecall;
    procedure StartContextChange; safecall;
    function EndContextChange(commit: WordBool; const aContextItemCollection: IContextItemCollection): UserResponse; safecall;
    procedure SetSurveyResponse(const reason: WideString); safecall;
    function Get_NotificationFilter: WideString; safecall;
    procedure Set_NotificationFilter(const filter: WideString); safecall;
    function Get_Name: WideString; safecall;
    property State: ContextorState read Get_State;
    property CurrentContext: IContextItemCollection read Get_CurrentContext;
    property NotificationFilter: WideString read Get_NotificationFilter write Set_NotificationFilter;
    property Name: WideString read Get_Name;
  end;

// *********************************************************************//
// DispIntf:  IContextorDisp
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {8D879F5D-5FE6-11D3-8727-0060B0B5E137}
// *********************************************************************//
  IContextorDisp = dispinterface
    ['{8D879F5D-5FE6-11D3-8727-0060B0B5E137}']
    procedure Run(const applicationLabel: WideString; const passcode: WideString; survey: WordBool; 
                  const initialNotificationFilter: WideString); dispid 1;
    procedure Suspend; dispid 2;
    procedure Resume; dispid 3;
    property State: ContextorState readonly dispid 4;
    function GetPrivilege(const subj: WideString): AccessPrivilege; dispid 5;
    property CurrentContext: IContextItemCollection readonly dispid 6;
    procedure StartContextChange; dispid 7;
    function EndContextChange(commit: WordBool; const aContextItemCollection: IContextItemCollection): UserResponse; dispid 8;
    procedure SetSurveyResponse(const reason: WideString); dispid 9;
    property NotificationFilter: WideString dispid 10;
    property Name: WideString readonly dispid 11;
  end;

// *********************************************************************//
// Interface: IContextParticipant
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {3E3DD272-998E-11D0-808D-00A0240943E4}
// *********************************************************************//
  IContextParticipant = interface(IDispatch)
    ['{3E3DD272-998E-11D0-808D-00A0240943E4}']
    function ContextChangesPending(contextCoupon: Integer; var reason: WideString): WideString; safecall;
    procedure ContextChangesAccepted(contextCoupon: Integer); safecall;
    procedure ContextChangesCanceled(contextCoupon: Integer); safecall;
    procedure CommonContextTerminated; safecall;
    procedure Ping; safecall;
  end;

// *********************************************************************//
// DispIntf:  IContextParticipantDisp
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {3E3DD272-998E-11D0-808D-00A0240943E4}
// *********************************************************************//
  IContextParticipantDisp = dispinterface
    ['{3E3DD272-998E-11D0-808D-00A0240943E4}']
    function ContextChangesPending(contextCoupon: Integer; var reason: WideString): WideString; dispid 1610743808;
    procedure ContextChangesAccepted(contextCoupon: Integer); dispid 1610743809;
    procedure ContextChangesCanceled(contextCoupon: Integer); dispid 1610743810;
    procedure CommonContextTerminated; dispid 1610743811;
    procedure Ping; dispid 1610743812;
  end;

// *********************************************************************//
// Interface: IContextItemCollection
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {AC4C0271-615A-11D3-84B5-0000861FDD4F}
// *********************************************************************//
  IContextItemCollection = interface(IDispatch)
    ['{AC4C0271-615A-11D3-84B5-0000861FDD4F}']
    function Count: Integer; safecall;
    procedure Add(const aContextItem: IContextItem); safecall;
    procedure Remove(const contextItemName: WideString); safecall;
    procedure RemoveAll; safecall;
    function Present(key: OleVariant): IContextItem; safecall;
    function Get__NewEnum: IUnknown; safecall;
    function Item(key: OleVariant): IContextItem; safecall;
    property _NewEnum: IUnknown read Get__NewEnum;
  end;

// *********************************************************************//
// DispIntf:  IContextItemCollectionDisp
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {AC4C0271-615A-11D3-84B5-0000861FDD4F}
// *********************************************************************//
  IContextItemCollectionDisp = dispinterface
    ['{AC4C0271-615A-11D3-84B5-0000861FDD4F}']
    function Count: Integer; dispid 1;
    procedure Add(const aContextItem: IContextItem); dispid 2;
    procedure Remove(const contextItemName: WideString); dispid 3;
    procedure RemoveAll; dispid 4;
    function Present(key: OleVariant): IContextItem; dispid 5;
    property _NewEnum: IUnknown readonly dispid -4;
    function Item(key: OleVariant): IContextItem; dispid 0;
  end;

// *********************************************************************//
// Interface: IContextItem
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {AC4C0273-615A-11D3-84B5-0000861FDD4F}
// *********************************************************************//
  IContextItem = interface(IDispatch)
    ['{AC4C0273-615A-11D3-84B5-0000861FDD4F}']
    function Get_Subject: WideString; safecall;
    procedure Set_Subject(const pVal: WideString); safecall;
    function Get_Role: WideString; safecall;
    procedure Set_Role(const pVal: WideString); safecall;
    function Get_Prefix: WideString; safecall;
    procedure Set_Prefix(const pVal: WideString); safecall;
    function Get_Suffix: WideString; safecall;
    procedure Set_Suffix(const pVal: WideString); safecall;
    function Get_Name: WideString; safecall;
    procedure Set_Name(const pVal: WideString); safecall;
    function Get_Value: WideString; safecall;
    procedure Set_Value(const pVal: WideString); safecall;
    function Clone: IContextItem; safecall;
    property Subject: WideString read Get_Subject write Set_Subject;
    property Role: WideString read Get_Role write Set_Role;
    property Prefix: WideString read Get_Prefix write Set_Prefix;
    property Suffix: WideString read Get_Suffix write Set_Suffix;
    property Name: WideString read Get_Name write Set_Name;
    property Value: WideString read Get_Value write Set_Value;
  end;

// *********************************************************************//
// DispIntf:  IContextItemDisp
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {AC4C0273-615A-11D3-84B5-0000861FDD4F}
// *********************************************************************//
  IContextItemDisp = dispinterface
    ['{AC4C0273-615A-11D3-84B5-0000861FDD4F}']
    property Subject: WideString dispid 1;
    property Role: WideString dispid 2;
    property Prefix: WideString dispid 3;
    property Suffix: WideString dispid 4;
    property Name: WideString dispid 5;
    property Value: WideString dispid 6;
    function Clone: IContextItem; dispid 7;
  end;

// *********************************************************************//
// Interface: IResponseContextChange
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {CBC6D968-9F6D-416A-8AA7-99172E588DF0}
// *********************************************************************//
  IResponseContextChange = interface(IDispatch)
    ['{CBC6D968-9F6D-416A-8AA7-99172E588DF0}']
    procedure StartResponseContextChange; safecall;
    function EndResponseContextChange(commit: WordBool; 
                                      const aContextItemCollection: IContextItemCollection; 
                                      var noContinue: WordBool): OleVariant; safecall;
    procedure CommitContextChange; safecall;
    procedure CancelContextChange; safecall;
  end;

// *********************************************************************//
// DispIntf:  IResponseContextChangeDisp
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {CBC6D968-9F6D-416A-8AA7-99172E588DF0}
// *********************************************************************//
  IResponseContextChangeDisp = dispinterface
    ['{CBC6D968-9F6D-416A-8AA7-99172E588DF0}']
    procedure StartResponseContextChange; dispid 1;
    function EndResponseContextChange(commit: WordBool; 
                                      const aContextItemCollection: IContextItemCollection; 
                                      var noContinue: WordBool): OleVariant; dispid 2;
    procedure CommitContextChange; dispid 3;
    procedure CancelContextChange; dispid 4;
  end;

// *********************************************************************//
// Interface: IResponseDialogAccessor
// Flags:     (4432) Hidden Dual OleAutomation Dispatchable
// GUID:      {86592071-F3BA-11D3-8181-005004A0F801}
// *********************************************************************//
  IResponseDialogAccessor = interface(IDispatch)
    ['{86592071-F3BA-11D3-8181-005004A0F801}']
    procedure Reset; safecall;
    procedure Set_(const aResponseDialog: IResponseDialog); safecall;
  end;

// *********************************************************************//
// DispIntf:  IResponseDialogAccessorDisp
// Flags:     (4432) Hidden Dual OleAutomation Dispatchable
// GUID:      {86592071-F3BA-11D3-8181-005004A0F801}
// *********************************************************************//
  IResponseDialogAccessorDisp = dispinterface
    ['{86592071-F3BA-11D3-8181-005004A0F801}']
    procedure Reset; dispid 1;
    procedure Set_(const aResponseDialog: IResponseDialog); dispid 2;
  end;

// *********************************************************************//
// Interface: IContextChangesSink
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {0B437E31-620E-11D3-84B6-0000861FDD4F}
// *********************************************************************//
  IContextChangesSink = interface(IDispatch)
    ['{0B437E31-620E-11D3-84B6-0000861FDD4F}']
    procedure Pending(const aContextItemCollection: IDispatch); safecall;
    procedure Committed; safecall;
    procedure Canceled; safecall;
  end;

// *********************************************************************//
// DispIntf:  IContextChangesSinkDisp
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {0B437E31-620E-11D3-84B6-0000861FDD4F}
// *********************************************************************//
  IContextChangesSinkDisp = dispinterface
    ['{0B437E31-620E-11D3-84B6-0000861FDD4F}']
    procedure Pending(const aContextItemCollection: IDispatch); dispid 1;
    procedure Committed; dispid 2;
    procedure Canceled; dispid 3;
  end;

// *********************************************************************//
// Interface: IResponseDialog
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {9D33ECF1-8277-11D3-8525-0000861FDD4F}
// *********************************************************************//
  IResponseDialog = interface(IDispatch)
    ['{9D33ECF1-8277-11D3-8525-0000861FDD4F}']
    function ProcessSurveyResults(responses: OleVariant; noContinue: WordBool): UserResponse; safecall;
  end;

// *********************************************************************//
// DispIntf:  IResponseDialogDisp
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {9D33ECF1-8277-11D3-8525-0000861FDD4F}
// *********************************************************************//
  IResponseDialogDisp = dispinterface
    ['{9D33ECF1-8277-11D3-8525-0000861FDD4F}']
    function ProcessSurveyResults(responses: OleVariant; noContinue: WordBool): UserResponse; dispid 1;
  end;

// *********************************************************************//
// Interface: ISetHook
// Flags:     (4432) Hidden Dual OleAutomation Dispatchable
// GUID:      {8D879FDD-5FE6-11D3-8727-0060B0B5E137}
// *********************************************************************//
  ISetHook = interface(IDispatch)
    ['{8D879FDD-5FE6-11D3-8727-0060B0B5E137}']
    procedure SetParticipant(const aContextParticipant: IContextParticipant); safecall;
  end;

// *********************************************************************//
// DispIntf:  ISetHookDisp
// Flags:     (4432) Hidden Dual OleAutomation Dispatchable
// GUID:      {8D879FDD-5FE6-11D3-8727-0060B0B5E137}
// *********************************************************************//
  ISetHookDisp = dispinterface
    ['{8D879FDD-5FE6-11D3-8727-0060B0B5E137}']
    procedure SetParticipant(const aContextParticipant: IContextParticipant); dispid 1;
  end;

// *********************************************************************//
// The Class CoContextor provides a Create and CreateRemote method to          
// create instances of the default interface IContextor exposed by              
// the CoClass Contextor. The functions are intended to be used by             
// clients wishing to automate the CoClass objects exposed by the         
// server of this typelibrary.                                            
// *********************************************************************//
  CoContextor = class
    class function Create: IContextor;
    class function CreateRemote(const MachineName: string): IContextor;
  end;


// *********************************************************************//
// OLE Control Proxy class declaration
// Control Name     : TContextorControl
// Help String      : Vergence ContextorControl
// Default Interface: IContextor
// Def. Intf. DISP? : No
// Event   Interface: _IContextChangesSink
// TypeFlags        : (2) CanCreate
// *********************************************************************//
  TContextorControlPending = procedure(Sender: TObject; const aContextItemCollection: IDispatch) of object;

  TContextorControl = class(TOleControl)
  private
    FOnPending: TContextorControlPending;
    FOnCommitted: TNotifyEvent;
    FOnCanceled: TNotifyEvent;
    FIntf: IContextor;
    function  GetControlInterface: IContextor;
  protected
    procedure CreateControl;
    procedure InitControlData; override;
    function Get_CurrentContext: IContextItemCollection;
  public
    procedure Run(const applicationLabel: WideString; const passcode: WideString; survey: WordBool; 
                  const initialNotificationFilter: WideString);
    procedure Suspend;
    procedure Resume;
    function GetPrivilege(const subj: WideString): AccessPrivilege;
    procedure StartContextChange;
    function EndContextChange(commit: WordBool; const aContextItemCollection: IContextItemCollection): UserResponse;
    procedure SetSurveyResponse(const reason: WideString);
    property  ControlInterface: IContextor read GetControlInterface;
    property  DefaultInterface: IContextor read GetControlInterface;
    property State: TOleEnum index 4 read GetTOleEnumProp;
    property CurrentContext: IContextItemCollection read Get_CurrentContext;
    property Name: WideString index 11 read GetWideStringProp;
  published
    property NotificationFilter: WideString index 10 read GetWideStringProp write SetWideStringProp stored False;
    property OnPending: TContextorControlPending read FOnPending write FOnPending;
    property OnCommitted: TNotifyEvent read FOnCommitted write FOnCommitted;
    property OnCanceled: TNotifyEvent read FOnCanceled write FOnCanceled;
  end;

// *********************************************************************//
// The Class CoContextItemCollection provides a Create and CreateRemote method to          
// create instances of the default interface IContextItemCollection exposed by              
// the CoClass ContextItemCollection. The functions are intended to be used by             
// clients wishing to automate the CoClass objects exposed by the         
// server of this typelibrary.                                            
// *********************************************************************//
  CoContextItemCollection = class
    class function Create: IContextItemCollection;
    class function CreateRemote(const MachineName: string): IContextItemCollection;
  end;

// *********************************************************************//
// The Class CoContextItem provides a Create and CreateRemote method to          
// create instances of the default interface IContextItem exposed by              
// the CoClass ContextItem. The functions are intended to be used by             
// clients wishing to automate the CoClass objects exposed by the         
// server of this typelibrary.                                            
// *********************************************************************//
  CoContextItem = class
    class function Create: IContextItem;
    class function CreateRemote(const MachineName: string): IContextItem;
  end;

// *********************************************************************//
// The Class CoResponseDialog provides a Create and CreateRemote method to          
// create instances of the default interface IResponseDialog exposed by              
// the CoClass ResponseDialog. The functions are intended to be used by             
// clients wishing to automate the CoClass objects exposed by the         
// server of this typelibrary.                                            
// *********************************************************************//
  CoResponseDialog = class
    class function Create: IResponseDialog;
    class function CreateRemote(const MachineName: string): IResponseDialog;
  end;

// *********************************************************************//
// The Class CoContextorParticipant provides a Create and CreateRemote method to          
// create instances of the default interface IContextParticipant exposed by              
// the CoClass ContextorParticipant. The functions are intended to be used by             
// clients wishing to automate the CoClass objects exposed by the         
// server of this typelibrary.                                            
// *********************************************************************//
  CoContextorParticipant = class
    class function Create: IContextParticipant;
    class function CreateRemote(const MachineName: string): IContextParticipant;
  end;

procedure Register;

resourcestring
  dtlServerPage = 'ActiveX';

implementation

uses ComObj;

class function CoContextor.Create: IContextor;
begin
  Result := CreateComObject(CLASS_Contextor) as IContextor;
end;

class function CoContextor.CreateRemote(const MachineName: string): IContextor;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_Contextor) as IContextor;
end;

procedure TContextorControl.InitControlData;
const
  CEventDispIDs: array [0..2] of DWORD = (
    $00000001, $00000002, $00000003);
  CControlData: TControlData2 = (
    ClassID: '{8778ACF7-5CA9-11D3-8727-0060B0B5E137}';
    EventIID: '{6BED8971-B3DD-11D3-8736-0060B0B5E137}';
    EventCount: 3;
    EventDispIDs: @CEventDispIDs;
    LicenseKey: nil (*HR:$80004002*);
    Flags: $00000000;
    Version: 401);
begin
  ControlData := @CControlData;
  TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnPending) - Cardinal(Self);
end;

procedure TContextorControl.CreateControl;

  procedure DoCreate;
  begin
    FIntf := IUnknown(OleObject) as IContextor;
  end;

begin
  if FIntf = nil then DoCreate;
end;

function TContextorControl.GetControlInterface: IContextor;
begin
  CreateControl;
  Result := FIntf;
end;

function TContextorControl.Get_CurrentContext: IContextItemCollection;
begin
    Result := DefaultInterface.CurrentContext;
end;

procedure TContextorControl.Run(const applicationLabel: WideString; const passcode: WideString; 
                                survey: WordBool; const initialNotificationFilter: WideString);
begin
  DefaultInterface.Run(applicationLabel, passcode, survey, initialNotificationFilter);
end;

procedure TContextorControl.Suspend;
begin
  DefaultInterface.Suspend;
end;

procedure TContextorControl.Resume;
begin
  DefaultInterface.Resume;
end;

function TContextorControl.GetPrivilege(const subj: WideString): AccessPrivilege;
begin
  Result := DefaultInterface.GetPrivilege(subj);
end;

procedure TContextorControl.StartContextChange;
begin
  DefaultInterface.StartContextChange;
end;

function TContextorControl.EndContextChange(commit: WordBool; 
                                            const aContextItemCollection: IContextItemCollection): UserResponse;
begin
  Result := DefaultInterface.EndContextChange(commit, aContextItemCollection);
end;

procedure TContextorControl.SetSurveyResponse(const reason: WideString);
begin
  DefaultInterface.SetSurveyResponse(reason);
end;

class function CoContextItemCollection.Create: IContextItemCollection;
begin
  Result := CreateComObject(CLASS_ContextItemCollection) as IContextItemCollection;
end;

class function CoContextItemCollection.CreateRemote(const MachineName: string): IContextItemCollection;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_ContextItemCollection) as IContextItemCollection;
end;

class function CoContextItem.Create: IContextItem;
begin
  Result := CreateComObject(CLASS_ContextItem) as IContextItem;
end;

class function CoContextItem.CreateRemote(const MachineName: string): IContextItem;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_ContextItem) as IContextItem;
end;

class function CoResponseDialog.Create: IResponseDialog;
begin
  Result := CreateComObject(CLASS_ResponseDialog) as IResponseDialog;
end;

class function CoResponseDialog.CreateRemote(const MachineName: string): IResponseDialog;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_ResponseDialog) as IResponseDialog;
end;

class function CoContextorParticipant.Create: IContextParticipant;
begin
  Result := CreateComObject(CLASS_ContextorParticipant) as IContextParticipant;
end;

class function CoContextorParticipant.CreateRemote(const MachineName: string): IContextParticipant;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_ContextorParticipant) as IContextParticipant;
end;

procedure Register;
begin
  RegisterComponents('ActiveX',[TContextorControl]);
end;

end.
