source: cprs/trunk/BDK50/BDK32_P50/Source/VERGENCECONTEXTORLib_TLB.pas@ 1742

Last change on this file since 1742 was 1678, checked in by healthsevak, 10 years ago

Added this new version of Broker component libraries while updating the working copy to CPRS version 28

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