| [453] | 1 | unit VERGENCECONTEXTORLib_TLB; | 
|---|
|  | 2 |  | 
|---|
|  | 3 | // ************************************************************************ // | 
|---|
|  | 4 | // WARNING | 
|---|
|  | 5 | // ------- | 
|---|
|  | 6 | // The types declared in this file were generated from data read from a | 
|---|
|  | 7 | // Type Library. If this type library is explicitly or indirectly (via | 
|---|
|  | 8 | // another type library referring to this type library) re-imported, or the | 
|---|
|  | 9 | // 'Refresh' command of the Type Library Editor activated while editing the | 
|---|
|  | 10 | // Type Library, the contents of this file will be regenerated and all | 
|---|
|  | 11 | // manual modifications will be lost. | 
|---|
|  | 12 | // ************************************************************************ // | 
|---|
|  | 13 |  | 
|---|
|  | 14 | // PASTLWTR : $Revision:   1.88.1.0.1.0  $ | 
|---|
|  | 15 | // File generated on 2/9/2004 9:12:53 AM from Type Library described below. | 
|---|
|  | 16 |  | 
|---|
|  | 17 | // *************************************************************************// | 
|---|
|  | 18 | // NOTE: | 
|---|
|  | 19 | // Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties | 
|---|
|  | 20 | // which return objects that may need to be explicitly created via a function | 
|---|
|  | 21 | // call prior to any access via the property. These items have been disabled | 
|---|
|  | 22 | // in order to prevent accidental use from within the object inspector. You | 
|---|
|  | 23 | // may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively | 
|---|
|  | 24 | // removing them from the $IFDEF blocks. However, such items must still be | 
|---|
|  | 25 | // programmatically created via a method of the appropriate CoClass before | 
|---|
|  | 26 | // they can be used. | 
|---|
|  | 27 | // ************************************************************************ // | 
|---|
|  | 28 | // Type Lib: D:\Development\BDK32_p40\Source\VergenceContextor.dll (1) | 
|---|
|  | 29 | // IID\LCID: {30AFBABD-5FD3-11D3-8727-0060B0B5E137}\0 | 
|---|
|  | 30 | // Helpfile: | 
|---|
|  | 31 | // DepndLst: | 
|---|
|  | 32 | //   (1) v2.0 stdole, (C:\WINNT\System32\stdole2.tlb) | 
|---|
|  | 33 | //   (2) v4.0 StdVCL, (C:\WINNT\System32\STDVCL40.DLL) | 
|---|
|  | 34 | // Errors: | 
|---|
|  | 35 | //   Hint: Member 'Set' of 'IResponseDialogAccessor' changed to 'Set_' | 
|---|
|  | 36 | //   Error creating palette bitmap of (TContextor) : Invalid GUID format | 
|---|
|  | 37 | //   Error creating palette bitmap of (TContextItemCollection) : Invalid GUID format | 
|---|
|  | 38 | //   Error creating palette bitmap of (TContextItem) : Invalid GUID format | 
|---|
|  | 39 | //   Error creating palette bitmap of (TResponseDialog) : Invalid GUID format | 
|---|
|  | 40 | //   Error creating palette bitmap of (TContextorParticipant) : Invalid GUID format | 
|---|
|  | 41 | // ************************************************************************ // | 
|---|
|  | 42 | {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. | 
|---|
|  | 43 | interface | 
|---|
|  | 44 |  | 
|---|
|  | 45 | uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL; | 
|---|
|  | 46 |  | 
|---|
|  | 47 | // *********************************************************************// | 
|---|
|  | 48 | // GUIDS declared in the TypeLibrary. Following prefixes are used: | 
|---|
|  | 49 | //   Type Libraries     : LIBID_xxxx | 
|---|
|  | 50 | //   CoClasses          : CLASS_xxxx | 
|---|
|  | 51 | //   DISPInterfaces     : DIID_xxxx | 
|---|
|  | 52 | //   Non-DISP interfaces: IID_xxxx | 
|---|
|  | 53 | // *********************************************************************// | 
|---|
|  | 54 | const | 
|---|
|  | 55 | // TypeLibrary Major and minor versions | 
|---|
|  | 56 | VERGENCECONTEXTORLibMajorVersion = 1; | 
|---|
|  | 57 | VERGENCECONTEXTORLibMinorVersion = 0; | 
|---|
|  | 58 |  | 
|---|
|  | 59 | LIBID_VERGENCECONTEXTORLib: TGUID = '{30AFBABD-5FD3-11D3-8727-0060B0B5E137}'; | 
|---|
|  | 60 |  | 
|---|
|  | 61 | DIID__IContextChangesSink: TGUID = '{6BED8971-B3DD-11D3-8736-0060B0B5E137}'; | 
|---|
|  | 62 | IID_IContextor: TGUID = '{8D879F5D-5FE6-11D3-8727-0060B0B5E137}'; | 
|---|
|  | 63 | IID_IContextParticipant: TGUID = '{3E3DD272-998E-11D0-808D-00A0240943E4}'; | 
|---|
|  | 64 | IID_IContextItemCollection: TGUID = '{AC4C0271-615A-11D3-84B5-0000861FDD4F}'; | 
|---|
|  | 65 | IID_IContextItem: TGUID = '{AC4C0273-615A-11D3-84B5-0000861FDD4F}'; | 
|---|
|  | 66 | IID_IResponseContextChange: TGUID = '{CBC6D968-9F6D-416A-8AA7-99172E588DF0}'; | 
|---|
|  | 67 | IID_IResponseDialogAccessor: TGUID = '{86592071-F3BA-11D3-8181-005004A0F801}'; | 
|---|
|  | 68 | IID_IContextChangesSink: TGUID = '{0B437E31-620E-11D3-84B6-0000861FDD4F}'; | 
|---|
|  | 69 | IID_IResponseDialog: TGUID = '{9D33ECF1-8277-11D3-8525-0000861FDD4F}'; | 
|---|
|  | 70 | CLASS_Contextor: TGUID = '{D5C9CC98-5FDB-11D3-8727-0060B0B5E137}'; | 
|---|
|  | 71 | CLASS_ContextorControl: TGUID = '{8778ACF7-5CA9-11D3-8727-0060B0B5E137}'; | 
|---|
|  | 72 | CLASS_ContextItemCollection: TGUID = '{AC4C0272-615A-11D3-84B5-0000861FDD4F}'; | 
|---|
|  | 73 | CLASS_ContextItem: TGUID = '{AC4C0274-615A-11D3-84B5-0000861FDD4F}'; | 
|---|
|  | 74 | CLASS_ResponseDialog: TGUID = '{9D33ECF2-8277-11D3-8525-0000861FDD4F}'; | 
|---|
|  | 75 | IID_ISetHook: TGUID = '{8D879FDD-5FE6-11D3-8727-0060B0B5E137}'; | 
|---|
|  | 76 | CLASS_ContextorParticipant: TGUID = '{4BA034A2-D0FA-11D3-818B-0050049598B2}'; | 
|---|
|  | 77 |  | 
|---|
|  | 78 | // *********************************************************************// | 
|---|
|  | 79 | // Declaration of Enumerations defined in Type Library | 
|---|
|  | 80 | // *********************************************************************// | 
|---|
|  | 81 | // Constants for enum __MIDL___MIDL_itf_VergenceContextor_0000_0002 | 
|---|
|  | 82 | type | 
|---|
|  | 83 | __MIDL___MIDL_itf_VergenceContextor_0000_0002 = TOleEnum; | 
|---|
|  | 84 | const | 
|---|
|  | 85 | CsNotRunning = $00000001; | 
|---|
|  | 86 | CsParticipating = $00000002; | 
|---|
|  | 87 | CsSuspended = $00000003; | 
|---|
|  | 88 |  | 
|---|
|  | 89 | // Constants for enum __MIDL___MIDL_itf_VergenceContextor_0000_0001 | 
|---|
|  | 90 | type | 
|---|
|  | 91 | __MIDL___MIDL_itf_VergenceContextor_0000_0001 = TOleEnum; | 
|---|
|  | 92 | const | 
|---|
|  | 93 | ApNone = $00000001; | 
|---|
|  | 94 | ApGet = $00000002; | 
|---|
|  | 95 | ApSet = $00000003; | 
|---|
|  | 96 |  | 
|---|
|  | 97 | // Constants for enum __MIDL___MIDL_itf_VergenceContextor_0000_0003 | 
|---|
|  | 98 | type | 
|---|
|  | 99 | __MIDL___MIDL_itf_VergenceContextor_0000_0003 = TOleEnum; | 
|---|
|  | 100 | const | 
|---|
|  | 101 | UrCommit = $00000001; | 
|---|
|  | 102 | UrCancel = $00000002; | 
|---|
|  | 103 | UrBreak = $00000003; | 
|---|
|  | 104 |  | 
|---|
|  | 105 | type | 
|---|
|  | 106 |  | 
|---|
|  | 107 | // *********************************************************************// | 
|---|
|  | 108 | // Forward declaration of types defined in TypeLibrary | 
|---|
|  | 109 | // *********************************************************************// | 
|---|
|  | 110 | _IContextChangesSink = dispinterface; | 
|---|
|  | 111 | IContextor = interface; | 
|---|
|  | 112 | IContextorDisp = dispinterface; | 
|---|
|  | 113 | IContextParticipant = interface; | 
|---|
|  | 114 | IContextParticipantDisp = dispinterface; | 
|---|
|  | 115 | IContextItemCollection = interface; | 
|---|
|  | 116 | IContextItemCollectionDisp = dispinterface; | 
|---|
|  | 117 | IContextItem = interface; | 
|---|
|  | 118 | IContextItemDisp = dispinterface; | 
|---|
|  | 119 | IResponseContextChange = interface; | 
|---|
|  | 120 | IResponseContextChangeDisp = dispinterface; | 
|---|
|  | 121 | IResponseDialogAccessor = interface; | 
|---|
|  | 122 | IResponseDialogAccessorDisp = dispinterface; | 
|---|
|  | 123 | IContextChangesSink = interface; | 
|---|
|  | 124 | IContextChangesSinkDisp = dispinterface; | 
|---|
|  | 125 | IResponseDialog = interface; | 
|---|
|  | 126 | IResponseDialogDisp = dispinterface; | 
|---|
|  | 127 | ISetHook = interface; | 
|---|
|  | 128 | ISetHookDisp = dispinterface; | 
|---|
|  | 129 |  | 
|---|
|  | 130 | // *********************************************************************// | 
|---|
|  | 131 | // Declaration of CoClasses defined in Type Library | 
|---|
|  | 132 | // (NOTE: Here we map each CoClass to its Default Interface) | 
|---|
|  | 133 | // *********************************************************************// | 
|---|
|  | 134 | Contextor = IContextor; | 
|---|
|  | 135 | ContextorControl = IContextor; | 
|---|
|  | 136 | ContextItemCollection = IContextItemCollection; | 
|---|
|  | 137 | ContextItem = IContextItem; | 
|---|
|  | 138 | ResponseDialog = IResponseDialog; | 
|---|
|  | 139 | ContextorParticipant = IContextParticipant; | 
|---|
|  | 140 |  | 
|---|
|  | 141 |  | 
|---|
|  | 142 | // *********************************************************************// | 
|---|
|  | 143 | // Declaration of structures, unions and aliases. | 
|---|
|  | 144 | // *********************************************************************// | 
|---|
|  | 145 |  | 
|---|
|  | 146 | ContextorState = __MIDL___MIDL_itf_VergenceContextor_0000_0002; | 
|---|
|  | 147 | AccessPrivilege = __MIDL___MIDL_itf_VergenceContextor_0000_0001; | 
|---|
|  | 148 | UserResponse = __MIDL___MIDL_itf_VergenceContextor_0000_0003; | 
|---|
|  | 149 |  | 
|---|
|  | 150 | // *********************************************************************// | 
|---|
|  | 151 | // DispIntf:  _IContextChangesSink | 
|---|
|  | 152 | // Flags:     (4096) Dispatchable | 
|---|
|  | 153 | // GUID:      {6BED8971-B3DD-11D3-8736-0060B0B5E137} | 
|---|
|  | 154 | // *********************************************************************// | 
|---|
|  | 155 | _IContextChangesSink = dispinterface | 
|---|
|  | 156 | ['{6BED8971-B3DD-11D3-8736-0060B0B5E137}'] | 
|---|
|  | 157 | procedure Pending(const aContextItemCollection: IDispatch); dispid 1; | 
|---|
|  | 158 | procedure Committed; dispid 2; | 
|---|
|  | 159 | procedure Canceled; dispid 3; | 
|---|
|  | 160 | end; | 
|---|
|  | 161 |  | 
|---|
|  | 162 | // *********************************************************************// | 
|---|
|  | 163 | // Interface: IContextor | 
|---|
|  | 164 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 165 | // GUID:      {8D879F5D-5FE6-11D3-8727-0060B0B5E137} | 
|---|
|  | 166 | // *********************************************************************// | 
|---|
|  | 167 | IContextor = interface(IDispatch) | 
|---|
|  | 168 | ['{8D879F5D-5FE6-11D3-8727-0060B0B5E137}'] | 
|---|
|  | 169 | procedure Run(const applicationLabel: WideString; const passcode: WideString; survey: WordBool; | 
|---|
|  | 170 | const initialNotificationFilter: WideString); safecall; | 
|---|
|  | 171 | procedure Suspend; safecall; | 
|---|
|  | 172 | procedure Resume; safecall; | 
|---|
|  | 173 | function  Get_State: ContextorState; safecall; | 
|---|
|  | 174 | function  GetPrivilege(const subj: WideString): AccessPrivilege; safecall; | 
|---|
|  | 175 | function  Get_CurrentContext: IContextItemCollection; safecall; | 
|---|
|  | 176 | procedure StartContextChange; safecall; | 
|---|
|  | 177 | function  EndContextChange(commit: WordBool; | 
|---|
|  | 178 | const aContextItemCollection: IContextItemCollection): UserResponse; safecall; | 
|---|
|  | 179 | procedure SetSurveyResponse(const reason: WideString); safecall; | 
|---|
|  | 180 | function  Get_NotificationFilter: WideString; safecall; | 
|---|
|  | 181 | procedure Set_NotificationFilter(const filter: WideString); safecall; | 
|---|
|  | 182 | function  Get_Name: WideString; safecall; | 
|---|
|  | 183 | property State: ContextorState read Get_State; | 
|---|
|  | 184 | property CurrentContext: IContextItemCollection read Get_CurrentContext; | 
|---|
|  | 185 | property NotificationFilter: WideString read Get_NotificationFilter write Set_NotificationFilter; | 
|---|
|  | 186 | property Name: WideString read Get_Name; | 
|---|
|  | 187 | end; | 
|---|
|  | 188 |  | 
|---|
|  | 189 | // *********************************************************************// | 
|---|
|  | 190 | // DispIntf:  IContextorDisp | 
|---|
|  | 191 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 192 | // GUID:      {8D879F5D-5FE6-11D3-8727-0060B0B5E137} | 
|---|
|  | 193 | // *********************************************************************// | 
|---|
|  | 194 | IContextorDisp = dispinterface | 
|---|
|  | 195 | ['{8D879F5D-5FE6-11D3-8727-0060B0B5E137}'] | 
|---|
|  | 196 | procedure Run(const applicationLabel: WideString; const passcode: WideString; survey: WordBool; | 
|---|
|  | 197 | const initialNotificationFilter: WideString); dispid 1; | 
|---|
|  | 198 | procedure Suspend; dispid 2; | 
|---|
|  | 199 | procedure Resume; dispid 3; | 
|---|
|  | 200 | property State: ContextorState readonly dispid 4; | 
|---|
|  | 201 | function  GetPrivilege(const subj: WideString): AccessPrivilege; dispid 5; | 
|---|
|  | 202 | property CurrentContext: IContextItemCollection readonly dispid 6; | 
|---|
|  | 203 | procedure StartContextChange; dispid 7; | 
|---|
|  | 204 | function  EndContextChange(commit: WordBool; | 
|---|
|  | 205 | const aContextItemCollection: IContextItemCollection): UserResponse; dispid 8; | 
|---|
|  | 206 | procedure SetSurveyResponse(const reason: WideString); dispid 9; | 
|---|
|  | 207 | property NotificationFilter: WideString dispid 10; | 
|---|
|  | 208 | property Name: WideString readonly dispid 11; | 
|---|
|  | 209 | end; | 
|---|
|  | 210 |  | 
|---|
|  | 211 | // *********************************************************************// | 
|---|
|  | 212 | // Interface: IContextParticipant | 
|---|
|  | 213 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 214 | // GUID:      {3E3DD272-998E-11D0-808D-00A0240943E4} | 
|---|
|  | 215 | // *********************************************************************// | 
|---|
|  | 216 | IContextParticipant = interface(IDispatch) | 
|---|
|  | 217 | ['{3E3DD272-998E-11D0-808D-00A0240943E4}'] | 
|---|
|  | 218 | function  ContextChangesPending(contextCoupon: Integer; var reason: WideString): WideString; safecall; | 
|---|
|  | 219 | procedure ContextChangesAccepted(contextCoupon: Integer); safecall; | 
|---|
|  | 220 | procedure ContextChangesCanceled(contextCoupon: Integer); safecall; | 
|---|
|  | 221 | procedure CommonContextTerminated; safecall; | 
|---|
|  | 222 | procedure Ping; safecall; | 
|---|
|  | 223 | end; | 
|---|
|  | 224 |  | 
|---|
|  | 225 | // *********************************************************************// | 
|---|
|  | 226 | // DispIntf:  IContextParticipantDisp | 
|---|
|  | 227 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 228 | // GUID:      {3E3DD272-998E-11D0-808D-00A0240943E4} | 
|---|
|  | 229 | // *********************************************************************// | 
|---|
|  | 230 | IContextParticipantDisp = dispinterface | 
|---|
|  | 231 | ['{3E3DD272-998E-11D0-808D-00A0240943E4}'] | 
|---|
|  | 232 | function  ContextChangesPending(contextCoupon: Integer; var reason: WideString): WideString; dispid 1610743808; | 
|---|
|  | 233 | procedure ContextChangesAccepted(contextCoupon: Integer); dispid 1610743809; | 
|---|
|  | 234 | procedure ContextChangesCanceled(contextCoupon: Integer); dispid 1610743810; | 
|---|
|  | 235 | procedure CommonContextTerminated; dispid 1610743811; | 
|---|
|  | 236 | procedure Ping; dispid 1610743812; | 
|---|
|  | 237 | end; | 
|---|
|  | 238 |  | 
|---|
|  | 239 | // *********************************************************************// | 
|---|
|  | 240 | // Interface: IContextItemCollection | 
|---|
|  | 241 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 242 | // GUID:      {AC4C0271-615A-11D3-84B5-0000861FDD4F} | 
|---|
|  | 243 | // *********************************************************************// | 
|---|
|  | 244 | IContextItemCollection = interface(IDispatch) | 
|---|
|  | 245 | ['{AC4C0271-615A-11D3-84B5-0000861FDD4F}'] | 
|---|
|  | 246 | function  Count: Integer; safecall; | 
|---|
|  | 247 | procedure Add(const aContextItem: IContextItem); safecall; | 
|---|
|  | 248 | procedure Remove(const contextItemName: WideString); safecall; | 
|---|
|  | 249 | procedure RemoveAll; safecall; | 
|---|
|  | 250 | function  Present(key: OleVariant): IContextItem; safecall; | 
|---|
|  | 251 | function  Get__NewEnum: IUnknown; safecall; | 
|---|
|  | 252 | function  Item(key: OleVariant): IContextItem; safecall; | 
|---|
|  | 253 | property _NewEnum: IUnknown read Get__NewEnum; | 
|---|
|  | 254 | end; | 
|---|
|  | 255 |  | 
|---|
|  | 256 | // *********************************************************************// | 
|---|
|  | 257 | // DispIntf:  IContextItemCollectionDisp | 
|---|
|  | 258 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 259 | // GUID:      {AC4C0271-615A-11D3-84B5-0000861FDD4F} | 
|---|
|  | 260 | // *********************************************************************// | 
|---|
|  | 261 | IContextItemCollectionDisp = dispinterface | 
|---|
|  | 262 | ['{AC4C0271-615A-11D3-84B5-0000861FDD4F}'] | 
|---|
|  | 263 | function  Count: Integer; dispid 1; | 
|---|
|  | 264 | procedure Add(const aContextItem: IContextItem); dispid 2; | 
|---|
|  | 265 | procedure Remove(const contextItemName: WideString); dispid 3; | 
|---|
|  | 266 | procedure RemoveAll; dispid 4; | 
|---|
|  | 267 | function  Present(key: OleVariant): IContextItem; dispid 5; | 
|---|
|  | 268 | property _NewEnum: IUnknown readonly dispid -4; | 
|---|
|  | 269 | function  Item(key: OleVariant): IContextItem; dispid 0; | 
|---|
|  | 270 | end; | 
|---|
|  | 271 |  | 
|---|
|  | 272 | // *********************************************************************// | 
|---|
|  | 273 | // Interface: IContextItem | 
|---|
|  | 274 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 275 | // GUID:      {AC4C0273-615A-11D3-84B5-0000861FDD4F} | 
|---|
|  | 276 | // *********************************************************************// | 
|---|
|  | 277 | IContextItem = interface(IDispatch) | 
|---|
|  | 278 | ['{AC4C0273-615A-11D3-84B5-0000861FDD4F}'] | 
|---|
|  | 279 | function  Get_Subject: WideString; safecall; | 
|---|
|  | 280 | procedure Set_Subject(const pVal: WideString); safecall; | 
|---|
|  | 281 | function  Get_Role: WideString; safecall; | 
|---|
|  | 282 | procedure Set_Role(const pVal: WideString); safecall; | 
|---|
|  | 283 | function  Get_Prefix: WideString; safecall; | 
|---|
|  | 284 | procedure Set_Prefix(const pVal: WideString); safecall; | 
|---|
|  | 285 | function  Get_Suffix: WideString; safecall; | 
|---|
|  | 286 | procedure Set_Suffix(const pVal: WideString); safecall; | 
|---|
|  | 287 | function  Get_Name: WideString; safecall; | 
|---|
|  | 288 | procedure Set_Name(const pVal: WideString); safecall; | 
|---|
|  | 289 | function  Get_Value: WideString; safecall; | 
|---|
|  | 290 | procedure Set_Value(const pVal: WideString); safecall; | 
|---|
|  | 291 | function  Clone: IContextItem; safecall; | 
|---|
|  | 292 | property Subject: WideString read Get_Subject write Set_Subject; | 
|---|
|  | 293 | property Role: WideString read Get_Role write Set_Role; | 
|---|
|  | 294 | property Prefix: WideString read Get_Prefix write Set_Prefix; | 
|---|
|  | 295 | property Suffix: WideString read Get_Suffix write Set_Suffix; | 
|---|
|  | 296 | property Name: WideString read Get_Name write Set_Name; | 
|---|
|  | 297 | property Value: WideString read Get_Value write Set_Value; | 
|---|
|  | 298 | end; | 
|---|
|  | 299 |  | 
|---|
|  | 300 | // *********************************************************************// | 
|---|
|  | 301 | // DispIntf:  IContextItemDisp | 
|---|
|  | 302 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 303 | // GUID:      {AC4C0273-615A-11D3-84B5-0000861FDD4F} | 
|---|
|  | 304 | // *********************************************************************// | 
|---|
|  | 305 | IContextItemDisp = dispinterface | 
|---|
|  | 306 | ['{AC4C0273-615A-11D3-84B5-0000861FDD4F}'] | 
|---|
|  | 307 | property Subject: WideString dispid 1; | 
|---|
|  | 308 | property Role: WideString dispid 2; | 
|---|
|  | 309 | property Prefix: WideString dispid 3; | 
|---|
|  | 310 | property Suffix: WideString dispid 4; | 
|---|
|  | 311 | property Name: WideString dispid 5; | 
|---|
|  | 312 | property Value: WideString dispid 6; | 
|---|
|  | 313 | function  Clone: IContextItem; dispid 7; | 
|---|
|  | 314 | end; | 
|---|
|  | 315 |  | 
|---|
|  | 316 | // *********************************************************************// | 
|---|
|  | 317 | // Interface: IResponseContextChange | 
|---|
|  | 318 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 319 | // GUID:      {CBC6D968-9F6D-416A-8AA7-99172E588DF0} | 
|---|
|  | 320 | // *********************************************************************// | 
|---|
|  | 321 | IResponseContextChange = interface(IDispatch) | 
|---|
|  | 322 | ['{CBC6D968-9F6D-416A-8AA7-99172E588DF0}'] | 
|---|
|  | 323 | procedure StartResponseContextChange; safecall; | 
|---|
|  | 324 | function  EndResponseContextChange(commit: WordBool; | 
|---|
|  | 325 | const aContextItemCollection: IContextItemCollection; | 
|---|
|  | 326 | var noContinue: WordBool): OleVariant; safecall; | 
|---|
|  | 327 | procedure CommitContextChange; safecall; | 
|---|
|  | 328 | procedure CancelContextChange; safecall; | 
|---|
|  | 329 | end; | 
|---|
|  | 330 |  | 
|---|
|  | 331 | // *********************************************************************// | 
|---|
|  | 332 | // DispIntf:  IResponseContextChangeDisp | 
|---|
|  | 333 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 334 | // GUID:      {CBC6D968-9F6D-416A-8AA7-99172E588DF0} | 
|---|
|  | 335 | // *********************************************************************// | 
|---|
|  | 336 | IResponseContextChangeDisp = dispinterface | 
|---|
|  | 337 | ['{CBC6D968-9F6D-416A-8AA7-99172E588DF0}'] | 
|---|
|  | 338 | procedure StartResponseContextChange; dispid 1; | 
|---|
|  | 339 | function  EndResponseContextChange(commit: WordBool; | 
|---|
|  | 340 | const aContextItemCollection: IContextItemCollection; | 
|---|
|  | 341 | var noContinue: WordBool): OleVariant; dispid 2; | 
|---|
|  | 342 | procedure CommitContextChange; dispid 3; | 
|---|
|  | 343 | procedure CancelContextChange; dispid 4; | 
|---|
|  | 344 | end; | 
|---|
|  | 345 |  | 
|---|
|  | 346 | // *********************************************************************// | 
|---|
|  | 347 | // Interface: IResponseDialogAccessor | 
|---|
|  | 348 | // Flags:     (4432) Hidden Dual OleAutomation Dispatchable | 
|---|
|  | 349 | // GUID:      {86592071-F3BA-11D3-8181-005004A0F801} | 
|---|
|  | 350 | // *********************************************************************// | 
|---|
|  | 351 | IResponseDialogAccessor = interface(IDispatch) | 
|---|
|  | 352 | ['{86592071-F3BA-11D3-8181-005004A0F801}'] | 
|---|
|  | 353 | procedure Reset; safecall; | 
|---|
|  | 354 | procedure Set_(const aResponseDialog: IResponseDialog); safecall; | 
|---|
|  | 355 | end; | 
|---|
|  | 356 |  | 
|---|
|  | 357 | // *********************************************************************// | 
|---|
|  | 358 | // DispIntf:  IResponseDialogAccessorDisp | 
|---|
|  | 359 | // Flags:     (4432) Hidden Dual OleAutomation Dispatchable | 
|---|
|  | 360 | // GUID:      {86592071-F3BA-11D3-8181-005004A0F801} | 
|---|
|  | 361 | // *********************************************************************// | 
|---|
|  | 362 | IResponseDialogAccessorDisp = dispinterface | 
|---|
|  | 363 | ['{86592071-F3BA-11D3-8181-005004A0F801}'] | 
|---|
|  | 364 | procedure Reset; dispid 1; | 
|---|
|  | 365 | procedure Set_(const aResponseDialog: IResponseDialog); dispid 2; | 
|---|
|  | 366 | end; | 
|---|
|  | 367 |  | 
|---|
|  | 368 | // *********************************************************************// | 
|---|
|  | 369 | // Interface: IContextChangesSink | 
|---|
|  | 370 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 371 | // GUID:      {0B437E31-620E-11D3-84B6-0000861FDD4F} | 
|---|
|  | 372 | // *********************************************************************// | 
|---|
|  | 373 | IContextChangesSink = interface(IDispatch) | 
|---|
|  | 374 | ['{0B437E31-620E-11D3-84B6-0000861FDD4F}'] | 
|---|
|  | 375 | procedure Pending(const aContextItemCollection: IDispatch); safecall; | 
|---|
|  | 376 | procedure Committed; safecall; | 
|---|
|  | 377 | procedure Canceled; safecall; | 
|---|
|  | 378 | end; | 
|---|
|  | 379 |  | 
|---|
|  | 380 | // *********************************************************************// | 
|---|
|  | 381 | // DispIntf:  IContextChangesSinkDisp | 
|---|
|  | 382 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 383 | // GUID:      {0B437E31-620E-11D3-84B6-0000861FDD4F} | 
|---|
|  | 384 | // *********************************************************************// | 
|---|
|  | 385 | IContextChangesSinkDisp = dispinterface | 
|---|
|  | 386 | ['{0B437E31-620E-11D3-84B6-0000861FDD4F}'] | 
|---|
|  | 387 | procedure Pending(const aContextItemCollection: IDispatch); dispid 1; | 
|---|
|  | 388 | procedure Committed; dispid 2; | 
|---|
|  | 389 | procedure Canceled; dispid 3; | 
|---|
|  | 390 | end; | 
|---|
|  | 391 |  | 
|---|
|  | 392 | // *********************************************************************// | 
|---|
|  | 393 | // Interface: IResponseDialog | 
|---|
|  | 394 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 395 | // GUID:      {9D33ECF1-8277-11D3-8525-0000861FDD4F} | 
|---|
|  | 396 | // *********************************************************************// | 
|---|
|  | 397 | IResponseDialog = interface(IDispatch) | 
|---|
|  | 398 | ['{9D33ECF1-8277-11D3-8525-0000861FDD4F}'] | 
|---|
|  | 399 | function  ProcessSurveyResults(responses: OleVariant; noContinue: WordBool): UserResponse; safecall; | 
|---|
|  | 400 | end; | 
|---|
|  | 401 |  | 
|---|
|  | 402 | // *********************************************************************// | 
|---|
|  | 403 | // DispIntf:  IResponseDialogDisp | 
|---|
|  | 404 | // Flags:     (4416) Dual OleAutomation Dispatchable | 
|---|
|  | 405 | // GUID:      {9D33ECF1-8277-11D3-8525-0000861FDD4F} | 
|---|
|  | 406 | // *********************************************************************// | 
|---|
|  | 407 | IResponseDialogDisp = dispinterface | 
|---|
|  | 408 | ['{9D33ECF1-8277-11D3-8525-0000861FDD4F}'] | 
|---|
|  | 409 | function  ProcessSurveyResults(responses: OleVariant; noContinue: WordBool): UserResponse; dispid 1; | 
|---|
|  | 410 | end; | 
|---|
|  | 411 |  | 
|---|
|  | 412 | // *********************************************************************// | 
|---|
|  | 413 | // Interface: ISetHook | 
|---|
|  | 414 | // Flags:     (4432) Hidden Dual OleAutomation Dispatchable | 
|---|
|  | 415 | // GUID:      {8D879FDD-5FE6-11D3-8727-0060B0B5E137} | 
|---|
|  | 416 | // *********************************************************************// | 
|---|
|  | 417 | ISetHook = interface(IDispatch) | 
|---|
|  | 418 | ['{8D879FDD-5FE6-11D3-8727-0060B0B5E137}'] | 
|---|
|  | 419 | procedure SetParticipant(const aContextParticipant: IContextParticipant); safecall; | 
|---|
|  | 420 | end; | 
|---|
|  | 421 |  | 
|---|
|  | 422 | // *********************************************************************// | 
|---|
|  | 423 | // DispIntf:  ISetHookDisp | 
|---|
|  | 424 | // Flags:     (4432) Hidden Dual OleAutomation Dispatchable | 
|---|
|  | 425 | // GUID:      {8D879FDD-5FE6-11D3-8727-0060B0B5E137} | 
|---|
|  | 426 | // *********************************************************************// | 
|---|
|  | 427 | ISetHookDisp = dispinterface | 
|---|
|  | 428 | ['{8D879FDD-5FE6-11D3-8727-0060B0B5E137}'] | 
|---|
|  | 429 | procedure SetParticipant(const aContextParticipant: IContextParticipant); dispid 1; | 
|---|
|  | 430 | end; | 
|---|
|  | 431 |  | 
|---|
|  | 432 | // *********************************************************************// | 
|---|
|  | 433 | // The Class CoContextor provides a Create and CreateRemote method to | 
|---|
|  | 434 | // create instances of the default interface IContextor exposed by | 
|---|
|  | 435 | // the CoClass Contextor. The functions are intended to be used by | 
|---|
|  | 436 | // clients wishing to automate the CoClass objects exposed by the | 
|---|
|  | 437 | // server of this typelibrary. | 
|---|
|  | 438 | // *********************************************************************// | 
|---|
|  | 439 | CoContextor = class | 
|---|
|  | 440 | class function Create: IContextor; | 
|---|
|  | 441 | class function CreateRemote(const MachineName: string): IContextor; | 
|---|
|  | 442 | end; | 
|---|
|  | 443 |  | 
|---|
|  | 444 | TContextorPending = procedure(Sender: TObject; var aContextItemCollection: OleVariant) of object; | 
|---|
|  | 445 |  | 
|---|
|  | 446 |  | 
|---|
|  | 447 | // *********************************************************************// | 
|---|
|  | 448 | // OLE Server Proxy class declaration | 
|---|
|  | 449 | // Server Object    : TContextor | 
|---|
|  | 450 | // Help String      : Vergence Contextor | 
|---|
|  | 451 | // Default Interface: IContextor | 
|---|
|  | 452 | // Def. Intf. DISP? : No | 
|---|
|  | 453 | // Event   Interface: _IContextChangesSink | 
|---|
|  | 454 | // TypeFlags        : (2) CanCreate | 
|---|
|  | 455 | // *********************************************************************// | 
|---|
|  | 456 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 457 | TContextorProperties= class; | 
|---|
|  | 458 | {$ENDIF} | 
|---|
|  | 459 | TContextor = class(TOleServer) | 
|---|
|  | 460 | private | 
|---|
|  | 461 | FOnPending: TContextorPending; | 
|---|
|  | 462 | FOnCommitted: TNotifyEvent; | 
|---|
|  | 463 | FOnCanceled: TNotifyEvent; | 
|---|
|  | 464 | FIntf:        IContextor; | 
|---|
|  | 465 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 466 | FProps:       TContextorProperties; | 
|---|
|  | 467 | function      GetServerProperties: TContextorProperties; | 
|---|
|  | 468 | {$ENDIF} | 
|---|
|  | 469 | function      GetDefaultInterface: IContextor; | 
|---|
|  | 470 | protected | 
|---|
|  | 471 | procedure InitServerData; override; | 
|---|
|  | 472 | procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override; | 
|---|
|  | 473 | function  Get_State: ContextorState; | 
|---|
|  | 474 | function  Get_CurrentContext: IContextItemCollection; | 
|---|
|  | 475 | function  Get_NotificationFilter: WideString; | 
|---|
|  | 476 | procedure Set_NotificationFilter(const filter: WideString); | 
|---|
|  | 477 | function  Get_Name: WideString; | 
|---|
|  | 478 | public | 
|---|
|  | 479 | constructor Create(AOwner: TComponent); override; | 
|---|
|  | 480 | destructor  Destroy; override; | 
|---|
|  | 481 | procedure Connect; override; | 
|---|
|  | 482 | procedure ConnectTo(svrIntf: IContextor); | 
|---|
|  | 483 | procedure Disconnect; override; | 
|---|
|  | 484 | procedure Run(const applicationLabel: WideString; const passcode: WideString; survey: WordBool; | 
|---|
|  | 485 | const initialNotificationFilter: WideString); | 
|---|
|  | 486 | procedure Suspend; | 
|---|
|  | 487 | procedure Resume; | 
|---|
|  | 488 | function  GetPrivilege(const subj: WideString): AccessPrivilege; | 
|---|
|  | 489 | procedure StartContextChange; | 
|---|
|  | 490 | function  EndContextChange(commit: WordBool; | 
|---|
|  | 491 | const aContextItemCollection: IContextItemCollection): UserResponse; | 
|---|
|  | 492 | procedure SetSurveyResponse(const reason: WideString); | 
|---|
|  | 493 | property  DefaultInterface: IContextor read GetDefaultInterface; | 
|---|
|  | 494 | property State: ContextorState read Get_State; | 
|---|
|  | 495 | property CurrentContext: IContextItemCollection read Get_CurrentContext; | 
|---|
|  | 496 | property Name: WideString read Get_Name; | 
|---|
|  | 497 | property NotificationFilter: WideString read Get_NotificationFilter write Set_NotificationFilter; | 
|---|
|  | 498 | published | 
|---|
|  | 499 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 500 | property Server: TContextorProperties read GetServerProperties; | 
|---|
|  | 501 | {$ENDIF} | 
|---|
|  | 502 | property OnPending: TContextorPending read FOnPending write FOnPending; | 
|---|
|  | 503 | property OnCommitted: TNotifyEvent read FOnCommitted write FOnCommitted; | 
|---|
|  | 504 | property OnCanceled: TNotifyEvent read FOnCanceled write FOnCanceled; | 
|---|
|  | 505 | end; | 
|---|
|  | 506 |  | 
|---|
|  | 507 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 508 | // *********************************************************************// | 
|---|
|  | 509 | // OLE Server Properties Proxy Class | 
|---|
|  | 510 | // Server Object    : TContextor | 
|---|
|  | 511 | // (This object is used by the IDE's Property Inspector to allow editing | 
|---|
|  | 512 | //  of the properties of this server) | 
|---|
|  | 513 | // *********************************************************************// | 
|---|
|  | 514 | TContextorProperties = class(TPersistent) | 
|---|
|  | 515 | private | 
|---|
|  | 516 | FServer:    TContextor; | 
|---|
|  | 517 | function    GetDefaultInterface: IContextor; | 
|---|
|  | 518 | constructor Create(AServer: TContextor); | 
|---|
|  | 519 | protected | 
|---|
|  | 520 | function  Get_State: ContextorState; | 
|---|
|  | 521 | function  Get_CurrentContext: IContextItemCollection; | 
|---|
|  | 522 | function  Get_NotificationFilter: WideString; | 
|---|
|  | 523 | procedure Set_NotificationFilter(const filter: WideString); | 
|---|
|  | 524 | function  Get_Name: WideString; | 
|---|
|  | 525 | public | 
|---|
|  | 526 | property DefaultInterface: IContextor read GetDefaultInterface; | 
|---|
|  | 527 | published | 
|---|
|  | 528 | property NotificationFilter: WideString read Get_NotificationFilter write Set_NotificationFilter; | 
|---|
|  | 529 | end; | 
|---|
|  | 530 | {$ENDIF} | 
|---|
|  | 531 |  | 
|---|
|  | 532 |  | 
|---|
|  | 533 |  | 
|---|
|  | 534 | // *********************************************************************// | 
|---|
|  | 535 | // OLE Control Proxy class declaration | 
|---|
|  | 536 | // Control Name     : TContextorControl | 
|---|
|  | 537 | // Help String      : Vergence ContextorControl | 
|---|
|  | 538 | // Default Interface: IContextor | 
|---|
|  | 539 | // Def. Intf. DISP? : No | 
|---|
|  | 540 | // Event   Interface: _IContextChangesSink | 
|---|
|  | 541 | // TypeFlags        : (2) CanCreate | 
|---|
|  | 542 | // *********************************************************************// | 
|---|
|  | 543 | TContextorControlPending = procedure(Sender: TObject; const aContextItemCollection: IDispatch) of object; | 
|---|
|  | 544 |  | 
|---|
|  | 545 | TContextorControl = class(TOleControl) | 
|---|
|  | 546 | private | 
|---|
|  | 547 | FOnPending: TContextorControlPending; | 
|---|
|  | 548 | FOnCommitted: TNotifyEvent; | 
|---|
|  | 549 | FOnCanceled: TNotifyEvent; | 
|---|
|  | 550 | FIntf: IContextor; | 
|---|
|  | 551 | function  GetControlInterface: IContextor; | 
|---|
|  | 552 | protected | 
|---|
|  | 553 | procedure CreateControl; | 
|---|
|  | 554 | procedure InitControlData; override; | 
|---|
|  | 555 | function  Get_CurrentContext: IContextItemCollection; | 
|---|
|  | 556 | public | 
|---|
|  | 557 | procedure Run(const applicationLabel: WideString; const passcode: WideString; survey: WordBool; | 
|---|
|  | 558 | const initialNotificationFilter: WideString); | 
|---|
|  | 559 | procedure Suspend; | 
|---|
|  | 560 | procedure Resume; | 
|---|
|  | 561 | function  GetPrivilege(const subj: WideString): AccessPrivilege; | 
|---|
|  | 562 | procedure StartContextChange; | 
|---|
|  | 563 | function  EndContextChange(commit: WordBool; | 
|---|
|  | 564 | const aContextItemCollection: IContextItemCollection): UserResponse; | 
|---|
|  | 565 | procedure SetSurveyResponse(const reason: WideString); | 
|---|
|  | 566 | property  ControlInterface: IContextor read GetControlInterface; | 
|---|
|  | 567 | property  DefaultInterface: IContextor read GetControlInterface; | 
|---|
|  | 568 | property State: TOleEnum index 4 read GetTOleEnumProp; | 
|---|
|  | 569 | property CurrentContext: IContextItemCollection read Get_CurrentContext; | 
|---|
|  | 570 | property Name: WideString index 11 read GetWideStringProp; | 
|---|
|  | 571 | published | 
|---|
|  | 572 | property NotificationFilter: WideString index 10 read GetWideStringProp write SetWideStringProp stored False; | 
|---|
|  | 573 | property OnPending: TContextorControlPending read FOnPending write FOnPending; | 
|---|
|  | 574 | property OnCommitted: TNotifyEvent read FOnCommitted write FOnCommitted; | 
|---|
|  | 575 | property OnCanceled: TNotifyEvent read FOnCanceled write FOnCanceled; | 
|---|
|  | 576 | end; | 
|---|
|  | 577 |  | 
|---|
|  | 578 | // *********************************************************************// | 
|---|
|  | 579 | // The Class CoContextItemCollection provides a Create and CreateRemote method to | 
|---|
|  | 580 | // create instances of the default interface IContextItemCollection exposed by | 
|---|
|  | 581 | // the CoClass ContextItemCollection. The functions are intended to be used by | 
|---|
|  | 582 | // clients wishing to automate the CoClass objects exposed by the | 
|---|
|  | 583 | // server of this typelibrary. | 
|---|
|  | 584 | // *********************************************************************// | 
|---|
|  | 585 | CoContextItemCollection = class | 
|---|
|  | 586 | class function Create: IContextItemCollection; | 
|---|
|  | 587 | class function CreateRemote(const MachineName: string): IContextItemCollection; | 
|---|
|  | 588 | end; | 
|---|
|  | 589 |  | 
|---|
|  | 590 |  | 
|---|
|  | 591 | // *********************************************************************// | 
|---|
|  | 592 | // OLE Server Proxy class declaration | 
|---|
|  | 593 | // Server Object    : TContextItemCollection | 
|---|
|  | 594 | // Help String      : Vergence ContextItemCollection | 
|---|
|  | 595 | // Default Interface: IContextItemCollection | 
|---|
|  | 596 | // Def. Intf. DISP? : No | 
|---|
|  | 597 | // Event   Interface: | 
|---|
|  | 598 | // TypeFlags        : (2) CanCreate | 
|---|
|  | 599 | // *********************************************************************// | 
|---|
|  | 600 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 601 | TContextItemCollectionProperties= class; | 
|---|
|  | 602 | {$ENDIF} | 
|---|
|  | 603 | TContextItemCollection = class(TOleServer) | 
|---|
|  | 604 | private | 
|---|
|  | 605 | FIntf:        IContextItemCollection; | 
|---|
|  | 606 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 607 | FProps:       TContextItemCollectionProperties; | 
|---|
|  | 608 | function      GetServerProperties: TContextItemCollectionProperties; | 
|---|
|  | 609 | {$ENDIF} | 
|---|
|  | 610 | function      GetDefaultInterface: IContextItemCollection; | 
|---|
|  | 611 | protected | 
|---|
|  | 612 | procedure InitServerData; override; | 
|---|
|  | 613 | function  Get__NewEnum: IUnknown; | 
|---|
|  | 614 | public | 
|---|
|  | 615 | constructor Create(AOwner: TComponent); override; | 
|---|
|  | 616 | destructor  Destroy; override; | 
|---|
|  | 617 | procedure Connect; override; | 
|---|
|  | 618 | procedure ConnectTo(svrIntf: IContextItemCollection); | 
|---|
|  | 619 | procedure Disconnect; override; | 
|---|
|  | 620 | function  Count: Integer; | 
|---|
|  | 621 | procedure Add(const aContextItem: IContextItem); | 
|---|
|  | 622 | procedure Remove(const contextItemName: WideString); | 
|---|
|  | 623 | procedure RemoveAll; | 
|---|
|  | 624 | function  Present(key: OleVariant): IContextItem; | 
|---|
|  | 625 | function  Item(key: OleVariant): IContextItem; | 
|---|
|  | 626 | property  DefaultInterface: IContextItemCollection read GetDefaultInterface; | 
|---|
|  | 627 | property _NewEnum: IUnknown read Get__NewEnum; | 
|---|
|  | 628 | published | 
|---|
|  | 629 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 630 | property Server: TContextItemCollectionProperties read GetServerProperties; | 
|---|
|  | 631 | {$ENDIF} | 
|---|
|  | 632 | end; | 
|---|
|  | 633 |  | 
|---|
|  | 634 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 635 | // *********************************************************************// | 
|---|
|  | 636 | // OLE Server Properties Proxy Class | 
|---|
|  | 637 | // Server Object    : TContextItemCollection | 
|---|
|  | 638 | // (This object is used by the IDE's Property Inspector to allow editing | 
|---|
|  | 639 | //  of the properties of this server) | 
|---|
|  | 640 | // *********************************************************************// | 
|---|
|  | 641 | TContextItemCollectionProperties = class(TPersistent) | 
|---|
|  | 642 | private | 
|---|
|  | 643 | FServer:    TContextItemCollection; | 
|---|
|  | 644 | function    GetDefaultInterface: IContextItemCollection; | 
|---|
|  | 645 | constructor Create(AServer: TContextItemCollection); | 
|---|
|  | 646 | protected | 
|---|
|  | 647 | function  Get__NewEnum: IUnknown; | 
|---|
|  | 648 | public | 
|---|
|  | 649 | property DefaultInterface: IContextItemCollection read GetDefaultInterface; | 
|---|
|  | 650 | published | 
|---|
|  | 651 | end; | 
|---|
|  | 652 | {$ENDIF} | 
|---|
|  | 653 |  | 
|---|
|  | 654 |  | 
|---|
|  | 655 | // *********************************************************************// | 
|---|
|  | 656 | // The Class CoContextItem provides a Create and CreateRemote method to | 
|---|
|  | 657 | // create instances of the default interface IContextItem exposed by | 
|---|
|  | 658 | // the CoClass ContextItem. The functions are intended to be used by | 
|---|
|  | 659 | // clients wishing to automate the CoClass objects exposed by the | 
|---|
|  | 660 | // server of this typelibrary. | 
|---|
|  | 661 | // *********************************************************************// | 
|---|
|  | 662 | CoContextItem = class | 
|---|
|  | 663 | class function Create: IContextItem; | 
|---|
|  | 664 | class function CreateRemote(const MachineName: string): IContextItem; | 
|---|
|  | 665 | end; | 
|---|
|  | 666 |  | 
|---|
|  | 667 |  | 
|---|
|  | 668 | // *********************************************************************// | 
|---|
|  | 669 | // OLE Server Proxy class declaration | 
|---|
|  | 670 | // Server Object    : TContextItem | 
|---|
|  | 671 | // Help String      : Vergence ContextItem | 
|---|
|  | 672 | // Default Interface: IContextItem | 
|---|
|  | 673 | // Def. Intf. DISP? : No | 
|---|
|  | 674 | // Event   Interface: | 
|---|
|  | 675 | // TypeFlags        : (2) CanCreate | 
|---|
|  | 676 | // *********************************************************************// | 
|---|
|  | 677 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 678 | TContextItemProperties= class; | 
|---|
|  | 679 | {$ENDIF} | 
|---|
|  | 680 | TContextItem = class(TOleServer) | 
|---|
|  | 681 | private | 
|---|
|  | 682 | FIntf:        IContextItem; | 
|---|
|  | 683 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 684 | FProps:       TContextItemProperties; | 
|---|
|  | 685 | function      GetServerProperties: TContextItemProperties; | 
|---|
|  | 686 | {$ENDIF} | 
|---|
|  | 687 | function      GetDefaultInterface: IContextItem; | 
|---|
|  | 688 | protected | 
|---|
|  | 689 | procedure InitServerData; override; | 
|---|
|  | 690 | function  Get_Subject: WideString; | 
|---|
|  | 691 | procedure Set_Subject(const pVal: WideString); | 
|---|
|  | 692 | function  Get_Role: WideString; | 
|---|
|  | 693 | procedure Set_Role(const pVal: WideString); | 
|---|
|  | 694 | function  Get_Prefix: WideString; | 
|---|
|  | 695 | procedure Set_Prefix(const pVal: WideString); | 
|---|
|  | 696 | function  Get_Suffix: WideString; | 
|---|
|  | 697 | procedure Set_Suffix(const pVal: WideString); | 
|---|
|  | 698 | function  Get_Name: WideString; | 
|---|
|  | 699 | procedure Set_Name(const pVal: WideString); | 
|---|
|  | 700 | function  Get_Value: WideString; | 
|---|
|  | 701 | procedure Set_Value(const pVal: WideString); | 
|---|
|  | 702 | public | 
|---|
|  | 703 | constructor Create(AOwner: TComponent); override; | 
|---|
|  | 704 | destructor  Destroy; override; | 
|---|
|  | 705 | procedure Connect; override; | 
|---|
|  | 706 | procedure ConnectTo(svrIntf: IContextItem); | 
|---|
|  | 707 | procedure Disconnect; override; | 
|---|
|  | 708 | function  Clone: IContextItem; | 
|---|
|  | 709 | property  DefaultInterface: IContextItem read GetDefaultInterface; | 
|---|
|  | 710 | property Subject: WideString read Get_Subject write Set_Subject; | 
|---|
|  | 711 | property Role: WideString read Get_Role write Set_Role; | 
|---|
|  | 712 | property Prefix: WideString read Get_Prefix write Set_Prefix; | 
|---|
|  | 713 | property Suffix: WideString read Get_Suffix write Set_Suffix; | 
|---|
|  | 714 | property Name: WideString read Get_Name write Set_Name; | 
|---|
|  | 715 | property Value: WideString read Get_Value write Set_Value; | 
|---|
|  | 716 | published | 
|---|
|  | 717 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 718 | property Server: TContextItemProperties read GetServerProperties; | 
|---|
|  | 719 | {$ENDIF} | 
|---|
|  | 720 | end; | 
|---|
|  | 721 |  | 
|---|
|  | 722 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 723 | // *********************************************************************// | 
|---|
|  | 724 | // OLE Server Properties Proxy Class | 
|---|
|  | 725 | // Server Object    : TContextItem | 
|---|
|  | 726 | // (This object is used by the IDE's Property Inspector to allow editing | 
|---|
|  | 727 | //  of the properties of this server) | 
|---|
|  | 728 | // *********************************************************************// | 
|---|
|  | 729 | TContextItemProperties = class(TPersistent) | 
|---|
|  | 730 | private | 
|---|
|  | 731 | FServer:    TContextItem; | 
|---|
|  | 732 | function    GetDefaultInterface: IContextItem; | 
|---|
|  | 733 | constructor Create(AServer: TContextItem); | 
|---|
|  | 734 | protected | 
|---|
|  | 735 | function  Get_Subject: WideString; | 
|---|
|  | 736 | procedure Set_Subject(const pVal: WideString); | 
|---|
|  | 737 | function  Get_Role: WideString; | 
|---|
|  | 738 | procedure Set_Role(const pVal: WideString); | 
|---|
|  | 739 | function  Get_Prefix: WideString; | 
|---|
|  | 740 | procedure Set_Prefix(const pVal: WideString); | 
|---|
|  | 741 | function  Get_Suffix: WideString; | 
|---|
|  | 742 | procedure Set_Suffix(const pVal: WideString); | 
|---|
|  | 743 | function  Get_Name: WideString; | 
|---|
|  | 744 | procedure Set_Name(const pVal: WideString); | 
|---|
|  | 745 | function  Get_Value: WideString; | 
|---|
|  | 746 | procedure Set_Value(const pVal: WideString); | 
|---|
|  | 747 | public | 
|---|
|  | 748 | property DefaultInterface: IContextItem read GetDefaultInterface; | 
|---|
|  | 749 | published | 
|---|
|  | 750 | property Subject: WideString read Get_Subject write Set_Subject; | 
|---|
|  | 751 | property Role: WideString read Get_Role write Set_Role; | 
|---|
|  | 752 | property Prefix: WideString read Get_Prefix write Set_Prefix; | 
|---|
|  | 753 | property Suffix: WideString read Get_Suffix write Set_Suffix; | 
|---|
|  | 754 | property Name: WideString read Get_Name write Set_Name; | 
|---|
|  | 755 | property Value: WideString read Get_Value write Set_Value; | 
|---|
|  | 756 | end; | 
|---|
|  | 757 | {$ENDIF} | 
|---|
|  | 758 |  | 
|---|
|  | 759 |  | 
|---|
|  | 760 | // *********************************************************************// | 
|---|
|  | 761 | // The Class CoResponseDialog provides a Create and CreateRemote method to | 
|---|
|  | 762 | // create instances of the default interface IResponseDialog exposed by | 
|---|
|  | 763 | // the CoClass ResponseDialog. The functions are intended to be used by | 
|---|
|  | 764 | // clients wishing to automate the CoClass objects exposed by the | 
|---|
|  | 765 | // server of this typelibrary. | 
|---|
|  | 766 | // *********************************************************************// | 
|---|
|  | 767 | CoResponseDialog = class | 
|---|
|  | 768 | class function Create: IResponseDialog; | 
|---|
|  | 769 | class function CreateRemote(const MachineName: string): IResponseDialog; | 
|---|
|  | 770 | end; | 
|---|
|  | 771 |  | 
|---|
|  | 772 |  | 
|---|
|  | 773 | // *********************************************************************// | 
|---|
|  | 774 | // OLE Server Proxy class declaration | 
|---|
|  | 775 | // Server Object    : TResponseDialog | 
|---|
|  | 776 | // Help String      : Vergence ResponseDialog | 
|---|
|  | 777 | // Default Interface: IResponseDialog | 
|---|
|  | 778 | // Def. Intf. DISP? : No | 
|---|
|  | 779 | // Event   Interface: | 
|---|
|  | 780 | // TypeFlags        : (2) CanCreate | 
|---|
|  | 781 | // *********************************************************************// | 
|---|
|  | 782 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 783 | TResponseDialogProperties= class; | 
|---|
|  | 784 | {$ENDIF} | 
|---|
|  | 785 | TResponseDialog = class(TOleServer) | 
|---|
|  | 786 | private | 
|---|
|  | 787 | FIntf:        IResponseDialog; | 
|---|
|  | 788 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 789 | FProps:       TResponseDialogProperties; | 
|---|
|  | 790 | function      GetServerProperties: TResponseDialogProperties; | 
|---|
|  | 791 | {$ENDIF} | 
|---|
|  | 792 | function      GetDefaultInterface: IResponseDialog; | 
|---|
|  | 793 | protected | 
|---|
|  | 794 | procedure InitServerData; override; | 
|---|
|  | 795 | public | 
|---|
|  | 796 | constructor Create(AOwner: TComponent); override; | 
|---|
|  | 797 | destructor  Destroy; override; | 
|---|
|  | 798 | procedure Connect; override; | 
|---|
|  | 799 | procedure ConnectTo(svrIntf: IResponseDialog); | 
|---|
|  | 800 | procedure Disconnect; override; | 
|---|
|  | 801 | function  ProcessSurveyResults(responses: OleVariant; noContinue: WordBool): UserResponse; | 
|---|
|  | 802 | property  DefaultInterface: IResponseDialog read GetDefaultInterface; | 
|---|
|  | 803 | published | 
|---|
|  | 804 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 805 | property Server: TResponseDialogProperties read GetServerProperties; | 
|---|
|  | 806 | {$ENDIF} | 
|---|
|  | 807 | end; | 
|---|
|  | 808 |  | 
|---|
|  | 809 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 810 | // *********************************************************************// | 
|---|
|  | 811 | // OLE Server Properties Proxy Class | 
|---|
|  | 812 | // Server Object    : TResponseDialog | 
|---|
|  | 813 | // (This object is used by the IDE's Property Inspector to allow editing | 
|---|
|  | 814 | //  of the properties of this server) | 
|---|
|  | 815 | // *********************************************************************// | 
|---|
|  | 816 | TResponseDialogProperties = class(TPersistent) | 
|---|
|  | 817 | private | 
|---|
|  | 818 | FServer:    TResponseDialog; | 
|---|
|  | 819 | function    GetDefaultInterface: IResponseDialog; | 
|---|
|  | 820 | constructor Create(AServer: TResponseDialog); | 
|---|
|  | 821 | protected | 
|---|
|  | 822 | public | 
|---|
|  | 823 | property DefaultInterface: IResponseDialog read GetDefaultInterface; | 
|---|
|  | 824 | published | 
|---|
|  | 825 | end; | 
|---|
|  | 826 | {$ENDIF} | 
|---|
|  | 827 |  | 
|---|
|  | 828 |  | 
|---|
|  | 829 | // *********************************************************************// | 
|---|
|  | 830 | // The Class CoContextorParticipant provides a Create and CreateRemote method to | 
|---|
|  | 831 | // create instances of the default interface IContextParticipant exposed by | 
|---|
|  | 832 | // the CoClass ContextorParticipant. The functions are intended to be used by | 
|---|
|  | 833 | // clients wishing to automate the CoClass objects exposed by the | 
|---|
|  | 834 | // server of this typelibrary. | 
|---|
|  | 835 | // *********************************************************************// | 
|---|
|  | 836 | CoContextorParticipant = class | 
|---|
|  | 837 | class function Create: IContextParticipant; | 
|---|
|  | 838 | class function CreateRemote(const MachineName: string): IContextParticipant; | 
|---|
|  | 839 | end; | 
|---|
|  | 840 |  | 
|---|
|  | 841 |  | 
|---|
|  | 842 | // *********************************************************************// | 
|---|
|  | 843 | // OLE Server Proxy class declaration | 
|---|
|  | 844 | // Server Object    : TContextorParticipant | 
|---|
|  | 845 | // Help String      : ContextorParticipant Class | 
|---|
|  | 846 | // Default Interface: IContextParticipant | 
|---|
|  | 847 | // Def. Intf. DISP? : No | 
|---|
|  | 848 | // Event   Interface: | 
|---|
|  | 849 | // TypeFlags        : (2) CanCreate | 
|---|
|  | 850 | // *********************************************************************// | 
|---|
|  | 851 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 852 | TContextorParticipantProperties= class; | 
|---|
|  | 853 | {$ENDIF} | 
|---|
|  | 854 | TContextorParticipant = class(TOleServer) | 
|---|
|  | 855 | private | 
|---|
|  | 856 | FIntf:        IContextParticipant; | 
|---|
|  | 857 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 858 | FProps:       TContextorParticipantProperties; | 
|---|
|  | 859 | function      GetServerProperties: TContextorParticipantProperties; | 
|---|
|  | 860 | {$ENDIF} | 
|---|
|  | 861 | function      GetDefaultInterface: IContextParticipant; | 
|---|
|  | 862 | protected | 
|---|
|  | 863 | procedure InitServerData; override; | 
|---|
|  | 864 | public | 
|---|
|  | 865 | constructor Create(AOwner: TComponent); override; | 
|---|
|  | 866 | destructor  Destroy; override; | 
|---|
|  | 867 | procedure Connect; override; | 
|---|
|  | 868 | procedure ConnectTo(svrIntf: IContextParticipant); | 
|---|
|  | 869 | procedure Disconnect; override; | 
|---|
|  | 870 | function  ContextChangesPending(contextCoupon: Integer; var reason: WideString): WideString; | 
|---|
|  | 871 | procedure ContextChangesAccepted(contextCoupon: Integer); | 
|---|
|  | 872 | procedure ContextChangesCanceled(contextCoupon: Integer); | 
|---|
|  | 873 | procedure CommonContextTerminated; | 
|---|
|  | 874 | procedure Ping; | 
|---|
|  | 875 | property  DefaultInterface: IContextParticipant read GetDefaultInterface; | 
|---|
|  | 876 | published | 
|---|
|  | 877 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 878 | property Server: TContextorParticipantProperties read GetServerProperties; | 
|---|
|  | 879 | {$ENDIF} | 
|---|
|  | 880 | end; | 
|---|
|  | 881 |  | 
|---|
|  | 882 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 883 | // *********************************************************************// | 
|---|
|  | 884 | // OLE Server Properties Proxy Class | 
|---|
|  | 885 | // Server Object    : TContextorParticipant | 
|---|
|  | 886 | // (This object is used by the IDE's Property Inspector to allow editing | 
|---|
|  | 887 | //  of the properties of this server) | 
|---|
|  | 888 | // *********************************************************************// | 
|---|
|  | 889 | TContextorParticipantProperties = class(TPersistent) | 
|---|
|  | 890 | private | 
|---|
|  | 891 | FServer:    TContextorParticipant; | 
|---|
|  | 892 | function    GetDefaultInterface: IContextParticipant; | 
|---|
|  | 893 | constructor Create(AServer: TContextorParticipant); | 
|---|
|  | 894 | protected | 
|---|
|  | 895 | public | 
|---|
|  | 896 | property DefaultInterface: IContextParticipant read GetDefaultInterface; | 
|---|
|  | 897 | published | 
|---|
|  | 898 | end; | 
|---|
|  | 899 | {$ENDIF} | 
|---|
|  | 900 |  | 
|---|
|  | 901 | { | 
|---|
|  | 902 | procedure Register; | 
|---|
|  | 903 | } | 
|---|
|  | 904 | implementation | 
|---|
|  | 905 |  | 
|---|
|  | 906 | uses ComObj; | 
|---|
|  | 907 |  | 
|---|
|  | 908 | class function CoContextor.Create: IContextor; | 
|---|
|  | 909 | begin | 
|---|
|  | 910 | Result := CreateComObject(CLASS_Contextor) as IContextor; | 
|---|
|  | 911 | end; | 
|---|
|  | 912 |  | 
|---|
|  | 913 | class function CoContextor.CreateRemote(const MachineName: string): IContextor; | 
|---|
|  | 914 | begin | 
|---|
|  | 915 | Result := CreateRemoteComObject(MachineName, CLASS_Contextor) as IContextor; | 
|---|
|  | 916 | end; | 
|---|
|  | 917 |  | 
|---|
|  | 918 | procedure TContextor.InitServerData; | 
|---|
|  | 919 | const | 
|---|
|  | 920 | CServerData: TServerData = ( | 
|---|
|  | 921 | ClassID:   '{D5C9CC98-5FDB-11D3-8727-0060B0B5E137}'; | 
|---|
|  | 922 | IntfIID:   '{8D879F5D-5FE6-11D3-8727-0060B0B5E137}'; | 
|---|
|  | 923 | EventIID:  '{6BED8971-B3DD-11D3-8736-0060B0B5E137}'; | 
|---|
|  | 924 | LicenseKey: nil; | 
|---|
|  | 925 | Version: 500); | 
|---|
|  | 926 | begin | 
|---|
|  | 927 | ServerData := @CServerData; | 
|---|
|  | 928 | end; | 
|---|
|  | 929 |  | 
|---|
|  | 930 | procedure TContextor.Connect; | 
|---|
|  | 931 | var | 
|---|
|  | 932 | punk: IUnknown; | 
|---|
|  | 933 | begin | 
|---|
|  | 934 | if FIntf = nil then | 
|---|
|  | 935 | begin | 
|---|
|  | 936 | punk := GetServer; | 
|---|
|  | 937 | ConnectEvents(punk); | 
|---|
|  | 938 | Fintf:= punk as IContextor; | 
|---|
|  | 939 | end; | 
|---|
|  | 940 | end; | 
|---|
|  | 941 |  | 
|---|
|  | 942 | procedure TContextor.ConnectTo(svrIntf: IContextor); | 
|---|
|  | 943 | begin | 
|---|
|  | 944 | Disconnect; | 
|---|
|  | 945 | FIntf := svrIntf; | 
|---|
|  | 946 | ConnectEvents(FIntf); | 
|---|
|  | 947 | end; | 
|---|
|  | 948 |  | 
|---|
|  | 949 | procedure TContextor.DisConnect; | 
|---|
|  | 950 | begin | 
|---|
|  | 951 | if Fintf <> nil then | 
|---|
|  | 952 | begin | 
|---|
|  | 953 | DisconnectEvents(FIntf); | 
|---|
|  | 954 | FIntf := nil; | 
|---|
|  | 955 | end; | 
|---|
|  | 956 | end; | 
|---|
|  | 957 |  | 
|---|
|  | 958 | function TContextor.GetDefaultInterface: IContextor; | 
|---|
|  | 959 | begin | 
|---|
|  | 960 | if FIntf = nil then | 
|---|
|  | 961 | Connect; | 
|---|
|  | 962 | Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation'); | 
|---|
|  | 963 | Result := FIntf; | 
|---|
|  | 964 | end; | 
|---|
|  | 965 |  | 
|---|
|  | 966 | constructor TContextor.Create(AOwner: TComponent); | 
|---|
|  | 967 | begin | 
|---|
|  | 968 | inherited Create(AOwner); | 
|---|
|  | 969 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 970 | FProps := TContextorProperties.Create(Self); | 
|---|
|  | 971 | {$ENDIF} | 
|---|
|  | 972 | end; | 
|---|
|  | 973 |  | 
|---|
|  | 974 | destructor TContextor.Destroy; | 
|---|
|  | 975 | begin | 
|---|
|  | 976 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 977 | FProps.Free; | 
|---|
|  | 978 | {$ENDIF} | 
|---|
|  | 979 | inherited Destroy; | 
|---|
|  | 980 | end; | 
|---|
|  | 981 |  | 
|---|
|  | 982 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 983 | function TContextor.GetServerProperties: TContextorProperties; | 
|---|
|  | 984 | begin | 
|---|
|  | 985 | Result := FProps; | 
|---|
|  | 986 | end; | 
|---|
|  | 987 | {$ENDIF} | 
|---|
|  | 988 |  | 
|---|
|  | 989 | procedure TContextor.InvokeEvent(DispID: TDispID; var Params: TVariantArray); | 
|---|
|  | 990 | begin | 
|---|
|  | 991 | case DispID of | 
|---|
|  | 992 | -1: Exit;  // DISPID_UNKNOWN | 
|---|
|  | 993 | 1: if Assigned(FOnPending) then | 
|---|
|  | 994 | FOnPending(Self, Params[0] {const IDispatch}); | 
|---|
|  | 995 | 2: if Assigned(FOnCommitted) then | 
|---|
|  | 996 | FOnCommitted(Self); | 
|---|
|  | 997 | 3: if Assigned(FOnCanceled) then | 
|---|
|  | 998 | FOnCanceled(Self); | 
|---|
|  | 999 | end; {case DispID} | 
|---|
|  | 1000 | end; | 
|---|
|  | 1001 |  | 
|---|
|  | 1002 | function  TContextor.Get_State: ContextorState; | 
|---|
|  | 1003 | begin | 
|---|
|  | 1004 | Result := DefaultInterface.Get_State; | 
|---|
|  | 1005 | end; | 
|---|
|  | 1006 |  | 
|---|
|  | 1007 | function  TContextor.Get_CurrentContext: IContextItemCollection; | 
|---|
|  | 1008 | begin | 
|---|
|  | 1009 | Result := DefaultInterface.Get_CurrentContext; | 
|---|
|  | 1010 | end; | 
|---|
|  | 1011 |  | 
|---|
|  | 1012 | function  TContextor.Get_NotificationFilter: WideString; | 
|---|
|  | 1013 | begin | 
|---|
|  | 1014 | Result := DefaultInterface.Get_NotificationFilter; | 
|---|
|  | 1015 | end; | 
|---|
|  | 1016 |  | 
|---|
|  | 1017 | procedure TContextor.Set_NotificationFilter(const filter: WideString); | 
|---|
|  | 1018 | begin | 
|---|
|  | 1019 | DefaultInterface.Set_NotificationFilter(filter); | 
|---|
|  | 1020 | end; | 
|---|
|  | 1021 |  | 
|---|
|  | 1022 | function  TContextor.Get_Name: WideString; | 
|---|
|  | 1023 | begin | 
|---|
|  | 1024 | Result := DefaultInterface.Get_Name; | 
|---|
|  | 1025 | end; | 
|---|
|  | 1026 |  | 
|---|
|  | 1027 | procedure TContextor.Run(const applicationLabel: WideString; const passcode: WideString; | 
|---|
|  | 1028 | survey: WordBool; const initialNotificationFilter: WideString); | 
|---|
|  | 1029 | begin | 
|---|
|  | 1030 | DefaultInterface.Run(applicationLabel, passcode, survey, initialNotificationFilter); | 
|---|
|  | 1031 | end; | 
|---|
|  | 1032 |  | 
|---|
|  | 1033 | procedure TContextor.Suspend; | 
|---|
|  | 1034 | begin | 
|---|
|  | 1035 | DefaultInterface.Suspend; | 
|---|
|  | 1036 | end; | 
|---|
|  | 1037 |  | 
|---|
|  | 1038 | procedure TContextor.Resume; | 
|---|
|  | 1039 | begin | 
|---|
|  | 1040 | DefaultInterface.Resume; | 
|---|
|  | 1041 | end; | 
|---|
|  | 1042 |  | 
|---|
|  | 1043 | function  TContextor.GetPrivilege(const subj: WideString): AccessPrivilege; | 
|---|
|  | 1044 | begin | 
|---|
|  | 1045 | Result := DefaultInterface.GetPrivilege(subj); | 
|---|
|  | 1046 | end; | 
|---|
|  | 1047 |  | 
|---|
|  | 1048 | procedure TContextor.StartContextChange; | 
|---|
|  | 1049 | begin | 
|---|
|  | 1050 | DefaultInterface.StartContextChange; | 
|---|
|  | 1051 | end; | 
|---|
|  | 1052 |  | 
|---|
|  | 1053 | function  TContextor.EndContextChange(commit: WordBool; | 
|---|
|  | 1054 | const aContextItemCollection: IContextItemCollection): UserResponse; | 
|---|
|  | 1055 | begin | 
|---|
|  | 1056 | Result := DefaultInterface.EndContextChange(commit, aContextItemCollection); | 
|---|
|  | 1057 | end; | 
|---|
|  | 1058 |  | 
|---|
|  | 1059 | procedure TContextor.SetSurveyResponse(const reason: WideString); | 
|---|
|  | 1060 | begin | 
|---|
|  | 1061 | DefaultInterface.SetSurveyResponse(reason); | 
|---|
|  | 1062 | end; | 
|---|
|  | 1063 |  | 
|---|
|  | 1064 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1065 | constructor TContextorProperties.Create(AServer: TContextor); | 
|---|
|  | 1066 | begin | 
|---|
|  | 1067 | inherited Create; | 
|---|
|  | 1068 | FServer := AServer; | 
|---|
|  | 1069 | end; | 
|---|
|  | 1070 |  | 
|---|
|  | 1071 | function TContextorProperties.GetDefaultInterface: IContextor; | 
|---|
|  | 1072 | begin | 
|---|
|  | 1073 | Result := FServer.DefaultInterface; | 
|---|
|  | 1074 | end; | 
|---|
|  | 1075 |  | 
|---|
|  | 1076 | function  TContextorProperties.Get_State: ContextorState; | 
|---|
|  | 1077 | begin | 
|---|
|  | 1078 | Result := DefaultInterface.Get_State; | 
|---|
|  | 1079 | end; | 
|---|
|  | 1080 |  | 
|---|
|  | 1081 | function  TContextorProperties.Get_CurrentContext: IContextItemCollection; | 
|---|
|  | 1082 | begin | 
|---|
|  | 1083 | Result := DefaultInterface.Get_CurrentContext; | 
|---|
|  | 1084 | end; | 
|---|
|  | 1085 |  | 
|---|
|  | 1086 | function  TContextorProperties.Get_NotificationFilter: WideString; | 
|---|
|  | 1087 | begin | 
|---|
|  | 1088 | Result := DefaultInterface.Get_NotificationFilter; | 
|---|
|  | 1089 | end; | 
|---|
|  | 1090 |  | 
|---|
|  | 1091 | procedure TContextorProperties.Set_NotificationFilter(const filter: WideString); | 
|---|
|  | 1092 | begin | 
|---|
|  | 1093 | DefaultInterface.Set_NotificationFilter(filter); | 
|---|
|  | 1094 | end; | 
|---|
|  | 1095 |  | 
|---|
|  | 1096 | function  TContextorProperties.Get_Name: WideString; | 
|---|
|  | 1097 | begin | 
|---|
|  | 1098 | Result := DefaultInterface.Get_Name; | 
|---|
|  | 1099 | end; | 
|---|
|  | 1100 |  | 
|---|
|  | 1101 | {$ENDIF} | 
|---|
|  | 1102 |  | 
|---|
|  | 1103 | procedure TContextorControl.InitControlData; | 
|---|
|  | 1104 | const | 
|---|
|  | 1105 | CEventDispIDs: array [0..2] of DWORD = ( | 
|---|
|  | 1106 | $00000001, $00000002, $00000003); | 
|---|
|  | 1107 | CControlData: TControlData2 = ( | 
|---|
|  | 1108 | ClassID: '{8778ACF7-5CA9-11D3-8727-0060B0B5E137}'; | 
|---|
|  | 1109 | EventIID: '{6BED8971-B3DD-11D3-8736-0060B0B5E137}'; | 
|---|
|  | 1110 | EventCount: 3; | 
|---|
|  | 1111 | EventDispIDs: @CEventDispIDs; | 
|---|
|  | 1112 | LicenseKey: nil (*HR:$80004002*); | 
|---|
|  | 1113 | Flags: $00000000; | 
|---|
|  | 1114 | Version: 401); | 
|---|
|  | 1115 | begin | 
|---|
|  | 1116 | ControlData := @CControlData; | 
|---|
|  | 1117 | TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnPending) - Cardinal(Self); | 
|---|
|  | 1118 | end; | 
|---|
|  | 1119 |  | 
|---|
|  | 1120 | procedure TContextorControl.CreateControl; | 
|---|
|  | 1121 |  | 
|---|
|  | 1122 | procedure DoCreate; | 
|---|
|  | 1123 | begin | 
|---|
|  | 1124 | FIntf := IUnknown(OleObject) as IContextor; | 
|---|
|  | 1125 | end; | 
|---|
|  | 1126 |  | 
|---|
|  | 1127 | begin | 
|---|
|  | 1128 | if FIntf = nil then DoCreate; | 
|---|
|  | 1129 | end; | 
|---|
|  | 1130 |  | 
|---|
|  | 1131 | function TContextorControl.GetControlInterface: IContextor; | 
|---|
|  | 1132 | begin | 
|---|
|  | 1133 | CreateControl; | 
|---|
|  | 1134 | Result := FIntf; | 
|---|
|  | 1135 | end; | 
|---|
|  | 1136 |  | 
|---|
|  | 1137 | function  TContextorControl.Get_CurrentContext: IContextItemCollection; | 
|---|
|  | 1138 | begin | 
|---|
|  | 1139 | Result := DefaultInterface.Get_CurrentContext; | 
|---|
|  | 1140 | end; | 
|---|
|  | 1141 |  | 
|---|
|  | 1142 | procedure TContextorControl.Run(const applicationLabel: WideString; const passcode: WideString; | 
|---|
|  | 1143 | survey: WordBool; const initialNotificationFilter: WideString); | 
|---|
|  | 1144 | begin | 
|---|
|  | 1145 | DefaultInterface.Run(applicationLabel, passcode, survey, initialNotificationFilter); | 
|---|
|  | 1146 | end; | 
|---|
|  | 1147 |  | 
|---|
|  | 1148 | procedure TContextorControl.Suspend; | 
|---|
|  | 1149 | begin | 
|---|
|  | 1150 | DefaultInterface.Suspend; | 
|---|
|  | 1151 | end; | 
|---|
|  | 1152 |  | 
|---|
|  | 1153 | procedure TContextorControl.Resume; | 
|---|
|  | 1154 | begin | 
|---|
|  | 1155 | DefaultInterface.Resume; | 
|---|
|  | 1156 | end; | 
|---|
|  | 1157 |  | 
|---|
|  | 1158 | function  TContextorControl.GetPrivilege(const subj: WideString): AccessPrivilege; | 
|---|
|  | 1159 | begin | 
|---|
|  | 1160 | Result := DefaultInterface.GetPrivilege(subj); | 
|---|
|  | 1161 | end; | 
|---|
|  | 1162 |  | 
|---|
|  | 1163 | procedure TContextorControl.StartContextChange; | 
|---|
|  | 1164 | begin | 
|---|
|  | 1165 | DefaultInterface.StartContextChange; | 
|---|
|  | 1166 | end; | 
|---|
|  | 1167 |  | 
|---|
|  | 1168 | function  TContextorControl.EndContextChange(commit: WordBool; | 
|---|
|  | 1169 | const aContextItemCollection: IContextItemCollection): UserResponse; | 
|---|
|  | 1170 | begin | 
|---|
|  | 1171 | Result := DefaultInterface.EndContextChange(commit, aContextItemCollection); | 
|---|
|  | 1172 | end; | 
|---|
|  | 1173 |  | 
|---|
|  | 1174 | procedure TContextorControl.SetSurveyResponse(const reason: WideString); | 
|---|
|  | 1175 | begin | 
|---|
|  | 1176 | DefaultInterface.SetSurveyResponse(reason); | 
|---|
|  | 1177 | end; | 
|---|
|  | 1178 |  | 
|---|
|  | 1179 | class function CoContextItemCollection.Create: IContextItemCollection; | 
|---|
|  | 1180 | begin | 
|---|
|  | 1181 | Result := CreateComObject(CLASS_ContextItemCollection) as IContextItemCollection; | 
|---|
|  | 1182 | end; | 
|---|
|  | 1183 |  | 
|---|
|  | 1184 | class function CoContextItemCollection.CreateRemote(const MachineName: string): IContextItemCollection; | 
|---|
|  | 1185 | begin | 
|---|
|  | 1186 | Result := CreateRemoteComObject(MachineName, CLASS_ContextItemCollection) as IContextItemCollection; | 
|---|
|  | 1187 | end; | 
|---|
|  | 1188 |  | 
|---|
|  | 1189 | procedure TContextItemCollection.InitServerData; | 
|---|
|  | 1190 | const | 
|---|
|  | 1191 | CServerData: TServerData = ( | 
|---|
|  | 1192 | ClassID:   '{AC4C0272-615A-11D3-84B5-0000861FDD4F}'; | 
|---|
|  | 1193 | IntfIID:   '{AC4C0271-615A-11D3-84B5-0000861FDD4F}'; | 
|---|
|  | 1194 | EventIID:  ''; | 
|---|
|  | 1195 | LicenseKey: nil; | 
|---|
|  | 1196 | Version: 500); | 
|---|
|  | 1197 | begin | 
|---|
|  | 1198 | ServerData := @CServerData; | 
|---|
|  | 1199 | end; | 
|---|
|  | 1200 |  | 
|---|
|  | 1201 | procedure TContextItemCollection.Connect; | 
|---|
|  | 1202 | var | 
|---|
|  | 1203 | punk: IUnknown; | 
|---|
|  | 1204 | begin | 
|---|
|  | 1205 | if FIntf = nil then | 
|---|
|  | 1206 | begin | 
|---|
|  | 1207 | punk := GetServer; | 
|---|
|  | 1208 | Fintf:= punk as IContextItemCollection; | 
|---|
|  | 1209 | end; | 
|---|
|  | 1210 | end; | 
|---|
|  | 1211 |  | 
|---|
|  | 1212 | procedure TContextItemCollection.ConnectTo(svrIntf: IContextItemCollection); | 
|---|
|  | 1213 | begin | 
|---|
|  | 1214 | Disconnect; | 
|---|
|  | 1215 | FIntf := svrIntf; | 
|---|
|  | 1216 | end; | 
|---|
|  | 1217 |  | 
|---|
|  | 1218 | procedure TContextItemCollection.DisConnect; | 
|---|
|  | 1219 | begin | 
|---|
|  | 1220 | if Fintf <> nil then | 
|---|
|  | 1221 | begin | 
|---|
|  | 1222 | FIntf := nil; | 
|---|
|  | 1223 | end; | 
|---|
|  | 1224 | end; | 
|---|
|  | 1225 |  | 
|---|
|  | 1226 | function TContextItemCollection.GetDefaultInterface: IContextItemCollection; | 
|---|
|  | 1227 | begin | 
|---|
|  | 1228 | if FIntf = nil then | 
|---|
|  | 1229 | Connect; | 
|---|
|  | 1230 | Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation'); | 
|---|
|  | 1231 | Result := FIntf; | 
|---|
|  | 1232 | end; | 
|---|
|  | 1233 |  | 
|---|
|  | 1234 | constructor TContextItemCollection.Create(AOwner: TComponent); | 
|---|
|  | 1235 | begin | 
|---|
|  | 1236 | inherited Create(AOwner); | 
|---|
|  | 1237 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1238 | FProps := TContextItemCollectionProperties.Create(Self); | 
|---|
|  | 1239 | {$ENDIF} | 
|---|
|  | 1240 | end; | 
|---|
|  | 1241 |  | 
|---|
|  | 1242 | destructor TContextItemCollection.Destroy; | 
|---|
|  | 1243 | begin | 
|---|
|  | 1244 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1245 | FProps.Free; | 
|---|
|  | 1246 | {$ENDIF} | 
|---|
|  | 1247 | inherited Destroy; | 
|---|
|  | 1248 | end; | 
|---|
|  | 1249 |  | 
|---|
|  | 1250 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1251 | function TContextItemCollection.GetServerProperties: TContextItemCollectionProperties; | 
|---|
|  | 1252 | begin | 
|---|
|  | 1253 | Result := FProps; | 
|---|
|  | 1254 | end; | 
|---|
|  | 1255 | {$ENDIF} | 
|---|
|  | 1256 |  | 
|---|
|  | 1257 | function  TContextItemCollection.Get__NewEnum: IUnknown; | 
|---|
|  | 1258 | begin | 
|---|
|  | 1259 | Result := DefaultInterface.Get__NewEnum; | 
|---|
|  | 1260 | end; | 
|---|
|  | 1261 |  | 
|---|
|  | 1262 | function  TContextItemCollection.Count: Integer; | 
|---|
|  | 1263 | begin | 
|---|
|  | 1264 | Result := DefaultInterface.Count; | 
|---|
|  | 1265 | end; | 
|---|
|  | 1266 |  | 
|---|
|  | 1267 | procedure TContextItemCollection.Add(const aContextItem: IContextItem); | 
|---|
|  | 1268 | begin | 
|---|
|  | 1269 | DefaultInterface.Add(aContextItem); | 
|---|
|  | 1270 | end; | 
|---|
|  | 1271 |  | 
|---|
|  | 1272 | procedure TContextItemCollection.Remove(const contextItemName: WideString); | 
|---|
|  | 1273 | begin | 
|---|
|  | 1274 | DefaultInterface.Remove(contextItemName); | 
|---|
|  | 1275 | end; | 
|---|
|  | 1276 |  | 
|---|
|  | 1277 | procedure TContextItemCollection.RemoveAll; | 
|---|
|  | 1278 | begin | 
|---|
|  | 1279 | DefaultInterface.RemoveAll; | 
|---|
|  | 1280 | end; | 
|---|
|  | 1281 |  | 
|---|
|  | 1282 | function  TContextItemCollection.Present(key: OleVariant): IContextItem; | 
|---|
|  | 1283 | begin | 
|---|
|  | 1284 | Result := DefaultInterface.Present(key); | 
|---|
|  | 1285 | end; | 
|---|
|  | 1286 |  | 
|---|
|  | 1287 | function  TContextItemCollection.Item(key: OleVariant): IContextItem; | 
|---|
|  | 1288 | begin | 
|---|
|  | 1289 | Result := DefaultInterface.Item(key); | 
|---|
|  | 1290 | end; | 
|---|
|  | 1291 |  | 
|---|
|  | 1292 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1293 | constructor TContextItemCollectionProperties.Create(AServer: TContextItemCollection); | 
|---|
|  | 1294 | begin | 
|---|
|  | 1295 | inherited Create; | 
|---|
|  | 1296 | FServer := AServer; | 
|---|
|  | 1297 | end; | 
|---|
|  | 1298 |  | 
|---|
|  | 1299 | function TContextItemCollectionProperties.GetDefaultInterface: IContextItemCollection; | 
|---|
|  | 1300 | begin | 
|---|
|  | 1301 | Result := FServer.DefaultInterface; | 
|---|
|  | 1302 | end; | 
|---|
|  | 1303 |  | 
|---|
|  | 1304 | function  TContextItemCollectionProperties.Get__NewEnum: IUnknown; | 
|---|
|  | 1305 | begin | 
|---|
|  | 1306 | Result := DefaultInterface.Get__NewEnum; | 
|---|
|  | 1307 | end; | 
|---|
|  | 1308 |  | 
|---|
|  | 1309 | {$ENDIF} | 
|---|
|  | 1310 |  | 
|---|
|  | 1311 | class function CoContextItem.Create: IContextItem; | 
|---|
|  | 1312 | begin | 
|---|
|  | 1313 | Result := CreateComObject(CLASS_ContextItem) as IContextItem; | 
|---|
|  | 1314 | end; | 
|---|
|  | 1315 |  | 
|---|
|  | 1316 | class function CoContextItem.CreateRemote(const MachineName: string): IContextItem; | 
|---|
|  | 1317 | begin | 
|---|
|  | 1318 | Result := CreateRemoteComObject(MachineName, CLASS_ContextItem) as IContextItem; | 
|---|
|  | 1319 | end; | 
|---|
|  | 1320 |  | 
|---|
|  | 1321 | procedure TContextItem.InitServerData; | 
|---|
|  | 1322 | const | 
|---|
|  | 1323 | CServerData: TServerData = ( | 
|---|
|  | 1324 | ClassID:   '{AC4C0274-615A-11D3-84B5-0000861FDD4F}'; | 
|---|
|  | 1325 | IntfIID:   '{AC4C0273-615A-11D3-84B5-0000861FDD4F}'; | 
|---|
|  | 1326 | EventIID:  ''; | 
|---|
|  | 1327 | LicenseKey: nil; | 
|---|
|  | 1328 | Version: 500); | 
|---|
|  | 1329 | begin | 
|---|
|  | 1330 | ServerData := @CServerData; | 
|---|
|  | 1331 | end; | 
|---|
|  | 1332 |  | 
|---|
|  | 1333 | procedure TContextItem.Connect; | 
|---|
|  | 1334 | var | 
|---|
|  | 1335 | punk: IUnknown; | 
|---|
|  | 1336 | begin | 
|---|
|  | 1337 | if FIntf = nil then | 
|---|
|  | 1338 | begin | 
|---|
|  | 1339 | punk := GetServer; | 
|---|
|  | 1340 | Fintf:= punk as IContextItem; | 
|---|
|  | 1341 | end; | 
|---|
|  | 1342 | end; | 
|---|
|  | 1343 |  | 
|---|
|  | 1344 | procedure TContextItem.ConnectTo(svrIntf: IContextItem); | 
|---|
|  | 1345 | begin | 
|---|
|  | 1346 | Disconnect; | 
|---|
|  | 1347 | FIntf := svrIntf; | 
|---|
|  | 1348 | end; | 
|---|
|  | 1349 |  | 
|---|
|  | 1350 | procedure TContextItem.DisConnect; | 
|---|
|  | 1351 | begin | 
|---|
|  | 1352 | if Fintf <> nil then | 
|---|
|  | 1353 | begin | 
|---|
|  | 1354 | FIntf := nil; | 
|---|
|  | 1355 | end; | 
|---|
|  | 1356 | end; | 
|---|
|  | 1357 |  | 
|---|
|  | 1358 | function TContextItem.GetDefaultInterface: IContextItem; | 
|---|
|  | 1359 | begin | 
|---|
|  | 1360 | if FIntf = nil then | 
|---|
|  | 1361 | Connect; | 
|---|
|  | 1362 | Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation'); | 
|---|
|  | 1363 | Result := FIntf; | 
|---|
|  | 1364 | end; | 
|---|
|  | 1365 |  | 
|---|
|  | 1366 | constructor TContextItem.Create(AOwner: TComponent); | 
|---|
|  | 1367 | begin | 
|---|
|  | 1368 | inherited Create(AOwner); | 
|---|
|  | 1369 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1370 | FProps := TContextItemProperties.Create(Self); | 
|---|
|  | 1371 | {$ENDIF} | 
|---|
|  | 1372 | end; | 
|---|
|  | 1373 |  | 
|---|
|  | 1374 | destructor TContextItem.Destroy; | 
|---|
|  | 1375 | begin | 
|---|
|  | 1376 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1377 | FProps.Free; | 
|---|
|  | 1378 | {$ENDIF} | 
|---|
|  | 1379 | inherited Destroy; | 
|---|
|  | 1380 | end; | 
|---|
|  | 1381 |  | 
|---|
|  | 1382 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1383 | function TContextItem.GetServerProperties: TContextItemProperties; | 
|---|
|  | 1384 | begin | 
|---|
|  | 1385 | Result := FProps; | 
|---|
|  | 1386 | end; | 
|---|
|  | 1387 | {$ENDIF} | 
|---|
|  | 1388 |  | 
|---|
|  | 1389 | function  TContextItem.Get_Subject: WideString; | 
|---|
|  | 1390 | begin | 
|---|
|  | 1391 | Result := DefaultInterface.Get_Subject; | 
|---|
|  | 1392 | end; | 
|---|
|  | 1393 |  | 
|---|
|  | 1394 | procedure TContextItem.Set_Subject(const pVal: WideString); | 
|---|
|  | 1395 | begin | 
|---|
|  | 1396 | DefaultInterface.Set_Subject(pVal); | 
|---|
|  | 1397 | end; | 
|---|
|  | 1398 |  | 
|---|
|  | 1399 | function  TContextItem.Get_Role: WideString; | 
|---|
|  | 1400 | begin | 
|---|
|  | 1401 | Result := DefaultInterface.Get_Role; | 
|---|
|  | 1402 | end; | 
|---|
|  | 1403 |  | 
|---|
|  | 1404 | procedure TContextItem.Set_Role(const pVal: WideString); | 
|---|
|  | 1405 | begin | 
|---|
|  | 1406 | DefaultInterface.Set_Role(pVal); | 
|---|
|  | 1407 | end; | 
|---|
|  | 1408 |  | 
|---|
|  | 1409 | function  TContextItem.Get_Prefix: WideString; | 
|---|
|  | 1410 | begin | 
|---|
|  | 1411 | Result := DefaultInterface.Get_Prefix; | 
|---|
|  | 1412 | end; | 
|---|
|  | 1413 |  | 
|---|
|  | 1414 | procedure TContextItem.Set_Prefix(const pVal: WideString); | 
|---|
|  | 1415 | begin | 
|---|
|  | 1416 | DefaultInterface.Set_Prefix(pVal); | 
|---|
|  | 1417 | end; | 
|---|
|  | 1418 |  | 
|---|
|  | 1419 | function  TContextItem.Get_Suffix: WideString; | 
|---|
|  | 1420 | begin | 
|---|
|  | 1421 | Result := DefaultInterface.Get_Suffix; | 
|---|
|  | 1422 | end; | 
|---|
|  | 1423 |  | 
|---|
|  | 1424 | procedure TContextItem.Set_Suffix(const pVal: WideString); | 
|---|
|  | 1425 | begin | 
|---|
|  | 1426 | DefaultInterface.Set_Suffix(pVal); | 
|---|
|  | 1427 | end; | 
|---|
|  | 1428 |  | 
|---|
|  | 1429 | function  TContextItem.Get_Name: WideString; | 
|---|
|  | 1430 | begin | 
|---|
|  | 1431 | Result := DefaultInterface.Get_Name; | 
|---|
|  | 1432 | end; | 
|---|
|  | 1433 |  | 
|---|
|  | 1434 | procedure TContextItem.Set_Name(const pVal: WideString); | 
|---|
|  | 1435 | begin | 
|---|
|  | 1436 | DefaultInterface.Set_Name(pVal); | 
|---|
|  | 1437 | end; | 
|---|
|  | 1438 |  | 
|---|
|  | 1439 | function  TContextItem.Get_Value: WideString; | 
|---|
|  | 1440 | begin | 
|---|
|  | 1441 | Result := DefaultInterface.Get_Value; | 
|---|
|  | 1442 | end; | 
|---|
|  | 1443 |  | 
|---|
|  | 1444 | procedure TContextItem.Set_Value(const pVal: WideString); | 
|---|
|  | 1445 | begin | 
|---|
|  | 1446 | DefaultInterface.Set_Value(pVal); | 
|---|
|  | 1447 | end; | 
|---|
|  | 1448 |  | 
|---|
|  | 1449 | function  TContextItem.Clone: IContextItem; | 
|---|
|  | 1450 | begin | 
|---|
|  | 1451 | Result := DefaultInterface.Clone; | 
|---|
|  | 1452 | end; | 
|---|
|  | 1453 |  | 
|---|
|  | 1454 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1455 | constructor TContextItemProperties.Create(AServer: TContextItem); | 
|---|
|  | 1456 | begin | 
|---|
|  | 1457 | inherited Create; | 
|---|
|  | 1458 | FServer := AServer; | 
|---|
|  | 1459 | end; | 
|---|
|  | 1460 |  | 
|---|
|  | 1461 | function TContextItemProperties.GetDefaultInterface: IContextItem; | 
|---|
|  | 1462 | begin | 
|---|
|  | 1463 | Result := FServer.DefaultInterface; | 
|---|
|  | 1464 | end; | 
|---|
|  | 1465 |  | 
|---|
|  | 1466 | function  TContextItemProperties.Get_Subject: WideString; | 
|---|
|  | 1467 | begin | 
|---|
|  | 1468 | Result := DefaultInterface.Get_Subject; | 
|---|
|  | 1469 | end; | 
|---|
|  | 1470 |  | 
|---|
|  | 1471 | procedure TContextItemProperties.Set_Subject(const pVal: WideString); | 
|---|
|  | 1472 | begin | 
|---|
|  | 1473 | DefaultInterface.Set_Subject(pVal); | 
|---|
|  | 1474 | end; | 
|---|
|  | 1475 |  | 
|---|
|  | 1476 | function  TContextItemProperties.Get_Role: WideString; | 
|---|
|  | 1477 | begin | 
|---|
|  | 1478 | Result := DefaultInterface.Get_Role; | 
|---|
|  | 1479 | end; | 
|---|
|  | 1480 |  | 
|---|
|  | 1481 | procedure TContextItemProperties.Set_Role(const pVal: WideString); | 
|---|
|  | 1482 | begin | 
|---|
|  | 1483 | DefaultInterface.Set_Role(pVal); | 
|---|
|  | 1484 | end; | 
|---|
|  | 1485 |  | 
|---|
|  | 1486 | function  TContextItemProperties.Get_Prefix: WideString; | 
|---|
|  | 1487 | begin | 
|---|
|  | 1488 | Result := DefaultInterface.Get_Prefix; | 
|---|
|  | 1489 | end; | 
|---|
|  | 1490 |  | 
|---|
|  | 1491 | procedure TContextItemProperties.Set_Prefix(const pVal: WideString); | 
|---|
|  | 1492 | begin | 
|---|
|  | 1493 | DefaultInterface.Set_Prefix(pVal); | 
|---|
|  | 1494 | end; | 
|---|
|  | 1495 |  | 
|---|
|  | 1496 | function  TContextItemProperties.Get_Suffix: WideString; | 
|---|
|  | 1497 | begin | 
|---|
|  | 1498 | Result := DefaultInterface.Get_Suffix; | 
|---|
|  | 1499 | end; | 
|---|
|  | 1500 |  | 
|---|
|  | 1501 | procedure TContextItemProperties.Set_Suffix(const pVal: WideString); | 
|---|
|  | 1502 | begin | 
|---|
|  | 1503 | DefaultInterface.Set_Suffix(pVal); | 
|---|
|  | 1504 | end; | 
|---|
|  | 1505 |  | 
|---|
|  | 1506 | function  TContextItemProperties.Get_Name: WideString; | 
|---|
|  | 1507 | begin | 
|---|
|  | 1508 | Result := DefaultInterface.Get_Name; | 
|---|
|  | 1509 | end; | 
|---|
|  | 1510 |  | 
|---|
|  | 1511 | procedure TContextItemProperties.Set_Name(const pVal: WideString); | 
|---|
|  | 1512 | begin | 
|---|
|  | 1513 | DefaultInterface.Set_Name(pVal); | 
|---|
|  | 1514 | end; | 
|---|
|  | 1515 |  | 
|---|
|  | 1516 | function  TContextItemProperties.Get_Value: WideString; | 
|---|
|  | 1517 | begin | 
|---|
|  | 1518 | Result := DefaultInterface.Get_Value; | 
|---|
|  | 1519 | end; | 
|---|
|  | 1520 |  | 
|---|
|  | 1521 | procedure TContextItemProperties.Set_Value(const pVal: WideString); | 
|---|
|  | 1522 | begin | 
|---|
|  | 1523 | DefaultInterface.Set_Value(pVal); | 
|---|
|  | 1524 | end; | 
|---|
|  | 1525 |  | 
|---|
|  | 1526 | {$ENDIF} | 
|---|
|  | 1527 |  | 
|---|
|  | 1528 | class function CoResponseDialog.Create: IResponseDialog; | 
|---|
|  | 1529 | begin | 
|---|
|  | 1530 | Result := CreateComObject(CLASS_ResponseDialog) as IResponseDialog; | 
|---|
|  | 1531 | end; | 
|---|
|  | 1532 |  | 
|---|
|  | 1533 | class function CoResponseDialog.CreateRemote(const MachineName: string): IResponseDialog; | 
|---|
|  | 1534 | begin | 
|---|
|  | 1535 | Result := CreateRemoteComObject(MachineName, CLASS_ResponseDialog) as IResponseDialog; | 
|---|
|  | 1536 | end; | 
|---|
|  | 1537 |  | 
|---|
|  | 1538 | procedure TResponseDialog.InitServerData; | 
|---|
|  | 1539 | const | 
|---|
|  | 1540 | CServerData: TServerData = ( | 
|---|
|  | 1541 | ClassID:   '{9D33ECF2-8277-11D3-8525-0000861FDD4F}'; | 
|---|
|  | 1542 | IntfIID:   '{9D33ECF1-8277-11D3-8525-0000861FDD4F}'; | 
|---|
|  | 1543 | EventIID:  ''; | 
|---|
|  | 1544 | LicenseKey: nil; | 
|---|
|  | 1545 | Version: 500); | 
|---|
|  | 1546 | begin | 
|---|
|  | 1547 | ServerData := @CServerData; | 
|---|
|  | 1548 | end; | 
|---|
|  | 1549 |  | 
|---|
|  | 1550 | procedure TResponseDialog.Connect; | 
|---|
|  | 1551 | var | 
|---|
|  | 1552 | punk: IUnknown; | 
|---|
|  | 1553 | begin | 
|---|
|  | 1554 | if FIntf = nil then | 
|---|
|  | 1555 | begin | 
|---|
|  | 1556 | punk := GetServer; | 
|---|
|  | 1557 | Fintf:= punk as IResponseDialog; | 
|---|
|  | 1558 | end; | 
|---|
|  | 1559 | end; | 
|---|
|  | 1560 |  | 
|---|
|  | 1561 | procedure TResponseDialog.ConnectTo(svrIntf: IResponseDialog); | 
|---|
|  | 1562 | begin | 
|---|
|  | 1563 | Disconnect; | 
|---|
|  | 1564 | FIntf := svrIntf; | 
|---|
|  | 1565 | end; | 
|---|
|  | 1566 |  | 
|---|
|  | 1567 | procedure TResponseDialog.DisConnect; | 
|---|
|  | 1568 | begin | 
|---|
|  | 1569 | if Fintf <> nil then | 
|---|
|  | 1570 | begin | 
|---|
|  | 1571 | FIntf := nil; | 
|---|
|  | 1572 | end; | 
|---|
|  | 1573 | end; | 
|---|
|  | 1574 |  | 
|---|
|  | 1575 | function TResponseDialog.GetDefaultInterface: IResponseDialog; | 
|---|
|  | 1576 | begin | 
|---|
|  | 1577 | if FIntf = nil then | 
|---|
|  | 1578 | Connect; | 
|---|
|  | 1579 | Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation'); | 
|---|
|  | 1580 | Result := FIntf; | 
|---|
|  | 1581 | end; | 
|---|
|  | 1582 |  | 
|---|
|  | 1583 | constructor TResponseDialog.Create(AOwner: TComponent); | 
|---|
|  | 1584 | begin | 
|---|
|  | 1585 | inherited Create(AOwner); | 
|---|
|  | 1586 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1587 | FProps := TResponseDialogProperties.Create(Self); | 
|---|
|  | 1588 | {$ENDIF} | 
|---|
|  | 1589 | end; | 
|---|
|  | 1590 |  | 
|---|
|  | 1591 | destructor TResponseDialog.Destroy; | 
|---|
|  | 1592 | begin | 
|---|
|  | 1593 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1594 | FProps.Free; | 
|---|
|  | 1595 | {$ENDIF} | 
|---|
|  | 1596 | inherited Destroy; | 
|---|
|  | 1597 | end; | 
|---|
|  | 1598 |  | 
|---|
|  | 1599 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1600 | function TResponseDialog.GetServerProperties: TResponseDialogProperties; | 
|---|
|  | 1601 | begin | 
|---|
|  | 1602 | Result := FProps; | 
|---|
|  | 1603 | end; | 
|---|
|  | 1604 | {$ENDIF} | 
|---|
|  | 1605 |  | 
|---|
|  | 1606 | function  TResponseDialog.ProcessSurveyResults(responses: OleVariant; noContinue: WordBool): UserResponse; | 
|---|
|  | 1607 | begin | 
|---|
|  | 1608 | Result := DefaultInterface.ProcessSurveyResults(responses, noContinue); | 
|---|
|  | 1609 | end; | 
|---|
|  | 1610 |  | 
|---|
|  | 1611 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1612 | constructor TResponseDialogProperties.Create(AServer: TResponseDialog); | 
|---|
|  | 1613 | begin | 
|---|
|  | 1614 | inherited Create; | 
|---|
|  | 1615 | FServer := AServer; | 
|---|
|  | 1616 | end; | 
|---|
|  | 1617 |  | 
|---|
|  | 1618 | function TResponseDialogProperties.GetDefaultInterface: IResponseDialog; | 
|---|
|  | 1619 | begin | 
|---|
|  | 1620 | Result := FServer.DefaultInterface; | 
|---|
|  | 1621 | end; | 
|---|
|  | 1622 |  | 
|---|
|  | 1623 | {$ENDIF} | 
|---|
|  | 1624 |  | 
|---|
|  | 1625 | class function CoContextorParticipant.Create: IContextParticipant; | 
|---|
|  | 1626 | begin | 
|---|
|  | 1627 | Result := CreateComObject(CLASS_ContextorParticipant) as IContextParticipant; | 
|---|
|  | 1628 | end; | 
|---|
|  | 1629 |  | 
|---|
|  | 1630 | class function CoContextorParticipant.CreateRemote(const MachineName: string): IContextParticipant; | 
|---|
|  | 1631 | begin | 
|---|
|  | 1632 | Result := CreateRemoteComObject(MachineName, CLASS_ContextorParticipant) as IContextParticipant; | 
|---|
|  | 1633 | end; | 
|---|
|  | 1634 |  | 
|---|
|  | 1635 | procedure TContextorParticipant.InitServerData; | 
|---|
|  | 1636 | const | 
|---|
|  | 1637 | CServerData: TServerData = ( | 
|---|
|  | 1638 | ClassID:   '{4BA034A2-D0FA-11D3-818B-0050049598B2}'; | 
|---|
|  | 1639 | IntfIID:   '{3E3DD272-998E-11D0-808D-00A0240943E4}'; | 
|---|
|  | 1640 | EventIID:  ''; | 
|---|
|  | 1641 | LicenseKey: nil; | 
|---|
|  | 1642 | Version: 500); | 
|---|
|  | 1643 | begin | 
|---|
|  | 1644 | ServerData := @CServerData; | 
|---|
|  | 1645 | end; | 
|---|
|  | 1646 |  | 
|---|
|  | 1647 | procedure TContextorParticipant.Connect; | 
|---|
|  | 1648 | var | 
|---|
|  | 1649 | punk: IUnknown; | 
|---|
|  | 1650 | begin | 
|---|
|  | 1651 | if FIntf = nil then | 
|---|
|  | 1652 | begin | 
|---|
|  | 1653 | punk := GetServer; | 
|---|
|  | 1654 | Fintf:= punk as IContextParticipant; | 
|---|
|  | 1655 | end; | 
|---|
|  | 1656 | end; | 
|---|
|  | 1657 |  | 
|---|
|  | 1658 | procedure TContextorParticipant.ConnectTo(svrIntf: IContextParticipant); | 
|---|
|  | 1659 | begin | 
|---|
|  | 1660 | Disconnect; | 
|---|
|  | 1661 | FIntf := svrIntf; | 
|---|
|  | 1662 | end; | 
|---|
|  | 1663 |  | 
|---|
|  | 1664 | procedure TContextorParticipant.DisConnect; | 
|---|
|  | 1665 | begin | 
|---|
|  | 1666 | if Fintf <> nil then | 
|---|
|  | 1667 | begin | 
|---|
|  | 1668 | FIntf := nil; | 
|---|
|  | 1669 | end; | 
|---|
|  | 1670 | end; | 
|---|
|  | 1671 |  | 
|---|
|  | 1672 | function TContextorParticipant.GetDefaultInterface: IContextParticipant; | 
|---|
|  | 1673 | begin | 
|---|
|  | 1674 | if FIntf = nil then | 
|---|
|  | 1675 | Connect; | 
|---|
|  | 1676 | Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation'); | 
|---|
|  | 1677 | Result := FIntf; | 
|---|
|  | 1678 | end; | 
|---|
|  | 1679 |  | 
|---|
|  | 1680 | constructor TContextorParticipant.Create(AOwner: TComponent); | 
|---|
|  | 1681 | begin | 
|---|
|  | 1682 | inherited Create(AOwner); | 
|---|
|  | 1683 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1684 | FProps := TContextorParticipantProperties.Create(Self); | 
|---|
|  | 1685 | {$ENDIF} | 
|---|
|  | 1686 | end; | 
|---|
|  | 1687 |  | 
|---|
|  | 1688 | destructor TContextorParticipant.Destroy; | 
|---|
|  | 1689 | begin | 
|---|
|  | 1690 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1691 | FProps.Free; | 
|---|
|  | 1692 | {$ENDIF} | 
|---|
|  | 1693 | inherited Destroy; | 
|---|
|  | 1694 | end; | 
|---|
|  | 1695 |  | 
|---|
|  | 1696 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1697 | function TContextorParticipant.GetServerProperties: TContextorParticipantProperties; | 
|---|
|  | 1698 | begin | 
|---|
|  | 1699 | Result := FProps; | 
|---|
|  | 1700 | end; | 
|---|
|  | 1701 | {$ENDIF} | 
|---|
|  | 1702 |  | 
|---|
|  | 1703 | function  TContextorParticipant.ContextChangesPending(contextCoupon: Integer; var reason: WideString): WideString; | 
|---|
|  | 1704 | begin | 
|---|
|  | 1705 | Result := DefaultInterface.ContextChangesPending(contextCoupon, reason); | 
|---|
|  | 1706 | end; | 
|---|
|  | 1707 |  | 
|---|
|  | 1708 | procedure TContextorParticipant.ContextChangesAccepted(contextCoupon: Integer); | 
|---|
|  | 1709 | begin | 
|---|
|  | 1710 | DefaultInterface.ContextChangesAccepted(contextCoupon); | 
|---|
|  | 1711 | end; | 
|---|
|  | 1712 |  | 
|---|
|  | 1713 | procedure TContextorParticipant.ContextChangesCanceled(contextCoupon: Integer); | 
|---|
|  | 1714 | begin | 
|---|
|  | 1715 | DefaultInterface.ContextChangesCanceled(contextCoupon); | 
|---|
|  | 1716 | end; | 
|---|
|  | 1717 |  | 
|---|
|  | 1718 | procedure TContextorParticipant.CommonContextTerminated; | 
|---|
|  | 1719 | begin | 
|---|
|  | 1720 | DefaultInterface.CommonContextTerminated; | 
|---|
|  | 1721 | end; | 
|---|
|  | 1722 |  | 
|---|
|  | 1723 | procedure TContextorParticipant.Ping; | 
|---|
|  | 1724 | begin | 
|---|
|  | 1725 | DefaultInterface.Ping; | 
|---|
|  | 1726 | end; | 
|---|
|  | 1727 |  | 
|---|
|  | 1728 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME} | 
|---|
|  | 1729 | constructor TContextorParticipantProperties.Create(AServer: TContextorParticipant); | 
|---|
|  | 1730 | begin | 
|---|
|  | 1731 | inherited Create; | 
|---|
|  | 1732 | FServer := AServer; | 
|---|
|  | 1733 | end; | 
|---|
|  | 1734 |  | 
|---|
|  | 1735 | function TContextorParticipantProperties.GetDefaultInterface: IContextParticipant; | 
|---|
|  | 1736 | begin | 
|---|
|  | 1737 | Result := FServer.DefaultInterface; | 
|---|
|  | 1738 | end; | 
|---|
|  | 1739 |  | 
|---|
|  | 1740 | {$ENDIF} | 
|---|
|  | 1741 | { | 
|---|
|  | 1742 | procedure Register; | 
|---|
|  | 1743 | begin | 
|---|
|  | 1744 | RegisterComponents('Kernel',[TContextorControl]); | 
|---|
|  | 1745 | RegisterComponents('Kernel',[TContextor, TContextItemCollection, TContextItem, TResponseDialog, | 
|---|
|  | 1746 | TContextorParticipant]); | 
|---|
|  | 1747 | end; | 
|---|
|  | 1748 | } | 
|---|
|  | 1749 | end. | 
|---|