unit RegexBuddy_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 : 1.2 // File generated on 2004-05-04 8:34:15 from Type Library described below. // ************************************************************************ // // Type Lib: C:\JGsoft\RegexBuddy.exe (1) // LIBID: {59F6DADD-72F7-4770-A852-1F04D5A8DBD8} // LCID: 0 // Helpfile: // HelpString: RegexBuddy API // DepndLst: // (1) v2.0 stdole, (E:\WINDOWS\System32\stdole2.tlb) // ************************************************************************ // // *************************************************************************// // NOTE: // Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties // which return objects that may need to be explicitly created via a function // call prior to any access via the property. These items have been disabled // in order to prevent accidental use from within the object inspector. You // may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively // removing them from the $IFDEF blocks. However, such items must still be // programmatically created via a method of the appropriate CoClass before // they can be used. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. {$WARN SYMBOL_PLATFORM OFF} {$WRITEABLECONST ON} {$VARPROPSETTER ON} interface uses Windows, ActiveX, Classes, Graphics, 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 RegexBuddyMajorVersion = 1; RegexBuddyMinorVersion = 0; LIBID_RegexBuddy: TGUID = '{59F6DADD-72F7-4770-A852-1F04D5A8DBD8}'; IID_IRegexBuddyIntf: TGUID = '{ED209426-5EB6-4A27-ADED-01CBCB981A41}'; DIID_IRegexBuddyIntfEvents: TGUID = '{345ED6ED-199C-4647-9409-2B9A2173447C}'; CLASS_RegexBuddyIntf: TGUID = '{15732743-D77B-4301-A10F-AA000859388A}'; type // *********************************************************************// // Forward declaration of types defined in TypeLibrary // *********************************************************************// IRegexBuddyIntf = interface; IRegexBuddyIntfDisp = dispinterface; IRegexBuddyIntfEvents = dispinterface; // *********************************************************************// // Declaration of CoClasses defined in Type Library // (NOTE: Here we map each CoClass to its Default Interface) // *********************************************************************// RegexBuddyIntf = IRegexBuddyIntf; // *********************************************************************// // Interface: IRegexBuddyIntf // Flags: (4416) Dual OleAutomation Dispatchable // GUID: {ED209426-5EB6-4A27-ADED-01CBCB981A41} // *********************************************************************// IRegexBuddyIntf = interface(IDispatch) ['{ED209426-5EB6-4A27-ADED-01CBCB981A41}'] procedure IndicateApp(const AppName: WideString; Wnd: LongWord); safecall; procedure InitRegex(const Regex: WideString; StringType: LongWord); safecall; procedure InitAction(Action: OleVariant); safecall; function CheckActionVersion(Version: LongWord): WordBool; safecall; function GetWindowHandle: LongWord; safecall; end; // *********************************************************************// // DispIntf: IRegexBuddyIntfDisp // Flags: (4416) Dual OleAutomation Dispatchable // GUID: {ED209426-5EB6-4A27-ADED-01CBCB981A41} // *********************************************************************// IRegexBuddyIntfDisp = dispinterface ['{ED209426-5EB6-4A27-ADED-01CBCB981A41}'] procedure IndicateApp(const AppName: WideString; Wnd: LongWord); dispid 201; procedure InitRegex(const Regex: WideString; StringType: LongWord); dispid 202; procedure InitAction(Action: OleVariant); dispid 203; function CheckActionVersion(Version: LongWord): WordBool; dispid 204; function GetWindowHandle: LongWord; dispid 205; end; // *********************************************************************// // DispIntf: IRegexBuddyIntfEvents // Flags: (4096) Dispatchable // GUID: {345ED6ED-199C-4647-9409-2B9A2173447C} // *********************************************************************// IRegexBuddyIntfEvents = dispinterface ['{345ED6ED-199C-4647-9409-2B9A2173447C}'] procedure FinishRegex(const Regex: WideString; StringType: LongWord); dispid 201; procedure FinishAction(Action: OleVariant); dispid 202; end; // *********************************************************************// // The Class CoRegexBuddyIntf provides a Create and CreateRemote method to // create instances of the default interface IRegexBuddyIntf exposed by // the CoClass RegexBuddyIntf. The functions are intended to be used by // clients wishing to automate the CoClass objects exposed by the // server of this typelibrary. // *********************************************************************// CoRegexBuddyIntf = class class function Create: IRegexBuddyIntf; class function CreateRemote(const MachineName: string): IRegexBuddyIntf; end; TRegexBuddyIntfFinishRegex = procedure(ASender: TObject; const Regex: WideString; StringType: LongWord) of object; TRegexBuddyIntfFinishAction = procedure(ASender: TObject; Action: OleVariant) of object; // *********************************************************************// // OLE Server Proxy class declaration // Server Object : TRegexBuddyIntf // Help String : RegexBuddyIntf Object // Default Interface: IRegexBuddyIntf // Def. Intf. DISP? : No // Event Interface: IRegexBuddyIntfEvents // TypeFlags : (2) CanCreate // *********************************************************************// {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} TRegexBuddyIntfProperties= class; {$ENDIF} TRegexBuddyIntf = class(TOleServer) private FOnFinishRegex: TRegexBuddyIntfFinishRegex; FOnFinishAction: TRegexBuddyIntfFinishAction; FIntf: IRegexBuddyIntf; {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} FProps: TRegexBuddyIntfProperties; function GetServerProperties: TRegexBuddyIntfProperties; {$ENDIF} function GetDefaultInterface: IRegexBuddyIntf; protected procedure InitServerData; override; procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure Connect; override; procedure ConnectTo(svrIntf: IRegexBuddyIntf); procedure Disconnect; override; procedure IndicateApp(const AppName: WideString; Wnd: LongWord); procedure InitRegex(const Regex: WideString; StringType: LongWord); procedure InitAction(Action: OleVariant); function CheckActionVersion(Version: LongWord): WordBool; function GetWindowHandle: LongWord; property DefaultInterface: IRegexBuddyIntf read GetDefaultInterface; published {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} property Server: TRegexBuddyIntfProperties read GetServerProperties; {$ENDIF} property OnFinishRegex: TRegexBuddyIntfFinishRegex read FOnFinishRegex write FOnFinishRegex; property OnFinishAction: TRegexBuddyIntfFinishAction read FOnFinishAction write FOnFinishAction; end; {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} // *********************************************************************// // OLE Server Properties Proxy Class // Server Object : TRegexBuddyIntf // (This object is used by the IDE's Property Inspector to allow editing // of the properties of this server) // *********************************************************************// TRegexBuddyIntfProperties = class(TPersistent) private FServer: TRegexBuddyIntf; function GetDefaultInterface: IRegexBuddyIntf; constructor Create(AServer: TRegexBuddyIntf); protected public property DefaultInterface: IRegexBuddyIntf read GetDefaultInterface; published end; {$ENDIF} procedure Register; resourcestring dtlServerPage = 'JGsoft'; dtlOcxPage = 'JGsoft'; implementation uses ComObj; class function CoRegexBuddyIntf.Create: IRegexBuddyIntf; begin Result := CreateComObject(CLASS_RegexBuddyIntf) as IRegexBuddyIntf; end; class function CoRegexBuddyIntf.CreateRemote(const MachineName: string): IRegexBuddyIntf; begin Result := CreateRemoteComObject(MachineName, CLASS_RegexBuddyIntf) as IRegexBuddyIntf; end; procedure TRegexBuddyIntf.InitServerData; const CServerData: TServerData = ( ClassID: '{15732743-D77B-4301-A10F-AA000859388A}'; IntfIID: '{ED209426-5EB6-4A27-ADED-01CBCB981A41}'; EventIID: '{345ED6ED-199C-4647-9409-2B9A2173447C}'; LicenseKey: nil; Version: 500); begin ServerData := @CServerData; end; procedure TRegexBuddyIntf.Connect; var punk: IUnknown; begin if FIntf = nil then begin punk := GetServer; ConnectEvents(punk); Fintf:= punk as IRegexBuddyIntf; end; end; procedure TRegexBuddyIntf.ConnectTo(svrIntf: IRegexBuddyIntf); begin Disconnect; FIntf := svrIntf; ConnectEvents(FIntf); end; procedure TRegexBuddyIntf.DisConnect; begin if Fintf <> nil then begin DisconnectEvents(FIntf); FIntf := nil; end; end; function TRegexBuddyIntf.GetDefaultInterface: IRegexBuddyIntf; begin if FIntf = nil then Connect; Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation'); Result := FIntf; end; constructor TRegexBuddyIntf.Create(AOwner: TComponent); begin inherited Create(AOwner); {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} FProps := TRegexBuddyIntfProperties.Create(Self); {$ENDIF} end; destructor TRegexBuddyIntf.Destroy; begin {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} FProps.Free; {$ENDIF} inherited Destroy; end; {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} function TRegexBuddyIntf.GetServerProperties: TRegexBuddyIntfProperties; begin Result := FProps; end; {$ENDIF} procedure TRegexBuddyIntf.InvokeEvent(DispID: TDispID; var Params: TVariantArray); begin case DispID of -1: Exit; // DISPID_UNKNOWN 201: if Assigned(FOnFinishRegex) then FOnFinishRegex(Self, Params[0] {const WideString}, Params[1] {LongWord}); 202: if Assigned(FOnFinishAction) then FOnFinishAction(Self, Params[0] {OleVariant}); end; {case DispID} end; procedure TRegexBuddyIntf.IndicateApp(const AppName: WideString; Wnd: LongWord); begin DefaultInterface.IndicateApp(AppName, Wnd); end; procedure TRegexBuddyIntf.InitRegex(const Regex: WideString; StringType: LongWord); begin DefaultInterface.InitRegex(Regex, StringType); end; procedure TRegexBuddyIntf.InitAction(Action: OleVariant); begin DefaultInterface.InitAction(Action); end; function TRegexBuddyIntf.CheckActionVersion(Version: LongWord): WordBool; begin Result := DefaultInterface.CheckActionVersion(Version); end; function TRegexBuddyIntf.GetWindowHandle: LongWord; begin Result := DefaultInterface.GetWindowHandle; end; {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} constructor TRegexBuddyIntfProperties.Create(AServer: TRegexBuddyIntf); begin inherited Create; FServer := AServer; end; function TRegexBuddyIntfProperties.GetDefaultInterface: IRegexBuddyIntf; begin Result := FServer.DefaultInterface; end; {$ENDIF} procedure Register; begin RegisterComponents(dtlServerPage, [TRegexBuddyIntf]); end; end.