source: cprs/branches/HealthSevak-CPRS/CPRS-Chart/VERGENCECONTEXTORLib_TLB.pas@ 1679

Last change on this file since 1679 was 841, checked in by Kevin Toppenberg, 14 years ago

Upgrading to version 27

File size: 61.7 KB
Line 
1unit 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.
43interface
44
45uses 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// *********************************************************************//
54const
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
82type
83 __MIDL___MIDL_itf_VergenceContextor_0000_0002 = TOleEnum;
84const
85 CsNotRunning = $00000001;
86 CsParticipating = $00000002;
87 CsSuspended = $00000003;
88
89// Constants for enum __MIDL___MIDL_itf_VergenceContextor_0000_0001
90type
91 __MIDL___MIDL_itf_VergenceContextor_0000_0001 = TOleEnum;
92const
93 ApNone = $00000001;
94 ApGet = $00000002;
95 ApSet = $00000003;
96
97// Constants for enum __MIDL___MIDL_itf_VergenceContextor_0000_0003
98type
99 __MIDL___MIDL_itf_VergenceContextor_0000_0003 = TOleEnum;
100const
101 UrCommit = $00000001;
102 UrCancel = $00000002;
103 UrBreak = $00000003;
104
105type
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{
902procedure Register;
903}
904implementation
905
906uses ComObj;
907
908class function CoContextor.Create: IContextor;
909begin
910 Result := CreateComObject(CLASS_Contextor) as IContextor;
911end;
912
913class function CoContextor.CreateRemote(const MachineName: string): IContextor;
914begin
915 Result := CreateRemoteComObject(MachineName, CLASS_Contextor) as IContextor;
916end;
917
918procedure TContextor.InitServerData;
919const
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);
926begin
927 ServerData := @CServerData;
928end;
929
930procedure TContextor.Connect;
931var
932 punk: IUnknown;
933begin
934 if FIntf = nil then
935 begin
936 punk := GetServer;
937 ConnectEvents(punk);
938 Fintf:= punk as IContextor;
939 end;
940end;
941
942procedure TContextor.ConnectTo(svrIntf: IContextor);
943begin
944 Disconnect;
945 FIntf := svrIntf;
946 ConnectEvents(FIntf);
947end;
948
949procedure TContextor.DisConnect;
950begin
951 if Fintf <> nil then
952 begin
953 DisconnectEvents(FIntf);
954 FIntf := nil;
955 end;
956end;
957
958function TContextor.GetDefaultInterface: IContextor;
959begin
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;
964end;
965
966constructor TContextor.Create(AOwner: TComponent);
967begin
968 inherited Create(AOwner);
969{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
970 FProps := TContextorProperties.Create(Self);
971{$ENDIF}
972end;
973
974destructor TContextor.Destroy;
975begin
976{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
977 FProps.Free;
978{$ENDIF}
979 inherited Destroy;
980end;
981
982{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
983function TContextor.GetServerProperties: TContextorProperties;
984begin
985 Result := FProps;
986end;
987{$ENDIF}
988
989procedure TContextor.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
990begin
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}
1000end;
1001
1002function TContextor.Get_State: ContextorState;
1003begin
1004 Result := DefaultInterface.Get_State;
1005end;
1006
1007function TContextor.Get_CurrentContext: IContextItemCollection;
1008begin
1009 Result := DefaultInterface.Get_CurrentContext;
1010end;
1011
1012function TContextor.Get_NotificationFilter: WideString;
1013begin
1014 Result := DefaultInterface.Get_NotificationFilter;
1015end;
1016
1017procedure TContextor.Set_NotificationFilter(const filter: WideString);
1018begin
1019 DefaultInterface.Set_NotificationFilter(filter);
1020end;
1021
1022function TContextor.Get_Name: WideString;
1023begin
1024 Result := DefaultInterface.Get_Name;
1025end;
1026
1027procedure TContextor.Run(const applicationLabel: WideString; const passcode: WideString;
1028 survey: WordBool; const initialNotificationFilter: WideString);
1029begin
1030 DefaultInterface.Run(applicationLabel, passcode, survey, initialNotificationFilter);
1031end;
1032
1033procedure TContextor.Suspend;
1034begin
1035 DefaultInterface.Suspend;
1036end;
1037
1038procedure TContextor.Resume;
1039begin
1040 DefaultInterface.Resume;
1041end;
1042
1043function TContextor.GetPrivilege(const subj: WideString): AccessPrivilege;
1044begin
1045 Result := DefaultInterface.GetPrivilege(subj);
1046end;
1047
1048procedure TContextor.StartContextChange;
1049begin
1050 DefaultInterface.StartContextChange;
1051end;
1052
1053function TContextor.EndContextChange(commit: WordBool;
1054 const aContextItemCollection: IContextItemCollection): UserResponse;
1055begin
1056 Result := DefaultInterface.EndContextChange(commit, aContextItemCollection);
1057end;
1058
1059procedure TContextor.SetSurveyResponse(const reason: WideString);
1060begin
1061 DefaultInterface.SetSurveyResponse(reason);
1062end;
1063
1064{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1065constructor TContextorProperties.Create(AServer: TContextor);
1066begin
1067 inherited Create;
1068 FServer := AServer;
1069end;
1070
1071function TContextorProperties.GetDefaultInterface: IContextor;
1072begin
1073 Result := FServer.DefaultInterface;
1074end;
1075
1076function TContextorProperties.Get_State: ContextorState;
1077begin
1078 Result := DefaultInterface.Get_State;
1079end;
1080
1081function TContextorProperties.Get_CurrentContext: IContextItemCollection;
1082begin
1083 Result := DefaultInterface.Get_CurrentContext;
1084end;
1085
1086function TContextorProperties.Get_NotificationFilter: WideString;
1087begin
1088 Result := DefaultInterface.Get_NotificationFilter;
1089end;
1090
1091procedure TContextorProperties.Set_NotificationFilter(const filter: WideString);
1092begin
1093 DefaultInterface.Set_NotificationFilter(filter);
1094end;
1095
1096function TContextorProperties.Get_Name: WideString;
1097begin
1098 Result := DefaultInterface.Get_Name;
1099end;
1100
1101{$ENDIF}
1102
1103procedure TContextorControl.InitControlData;
1104const
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);
1115begin
1116 ControlData := @CControlData;
1117 TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnPending) - Cardinal(Self);
1118end;
1119
1120procedure TContextorControl.CreateControl;
1121
1122 procedure DoCreate;
1123 begin
1124 FIntf := IUnknown(OleObject) as IContextor;
1125 end;
1126
1127begin
1128 if FIntf = nil then DoCreate;
1129end;
1130
1131function TContextorControl.GetControlInterface: IContextor;
1132begin
1133 CreateControl;
1134 Result := FIntf;
1135end;
1136
1137function TContextorControl.Get_CurrentContext: IContextItemCollection;
1138begin
1139 Result := DefaultInterface.Get_CurrentContext;
1140end;
1141
1142procedure TContextorControl.Run(const applicationLabel: WideString; const passcode: WideString;
1143 survey: WordBool; const initialNotificationFilter: WideString);
1144begin
1145 DefaultInterface.Run(applicationLabel, passcode, survey, initialNotificationFilter);
1146end;
1147
1148procedure TContextorControl.Suspend;
1149begin
1150 DefaultInterface.Suspend;
1151end;
1152
1153procedure TContextorControl.Resume;
1154begin
1155 DefaultInterface.Resume;
1156end;
1157
1158function TContextorControl.GetPrivilege(const subj: WideString): AccessPrivilege;
1159begin
1160 Result := DefaultInterface.GetPrivilege(subj);
1161end;
1162
1163procedure TContextorControl.StartContextChange;
1164begin
1165 DefaultInterface.StartContextChange;
1166end;
1167
1168function TContextorControl.EndContextChange(commit: WordBool;
1169 const aContextItemCollection: IContextItemCollection): UserResponse;
1170begin
1171 Result := DefaultInterface.EndContextChange(commit, aContextItemCollection);
1172end;
1173
1174procedure TContextorControl.SetSurveyResponse(const reason: WideString);
1175begin
1176 DefaultInterface.SetSurveyResponse(reason);
1177end;
1178
1179class function CoContextItemCollection.Create: IContextItemCollection;
1180begin
1181 Result := CreateComObject(CLASS_ContextItemCollection) as IContextItemCollection;
1182end;
1183
1184class function CoContextItemCollection.CreateRemote(const MachineName: string): IContextItemCollection;
1185begin
1186 Result := CreateRemoteComObject(MachineName, CLASS_ContextItemCollection) as IContextItemCollection;
1187end;
1188
1189procedure TContextItemCollection.InitServerData;
1190const
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);
1197begin
1198 ServerData := @CServerData;
1199end;
1200
1201procedure TContextItemCollection.Connect;
1202var
1203 punk: IUnknown;
1204begin
1205 if FIntf = nil then
1206 begin
1207 punk := GetServer;
1208 Fintf:= punk as IContextItemCollection;
1209 end;
1210end;
1211
1212procedure TContextItemCollection.ConnectTo(svrIntf: IContextItemCollection);
1213begin
1214 Disconnect;
1215 FIntf := svrIntf;
1216end;
1217
1218procedure TContextItemCollection.DisConnect;
1219begin
1220 if Fintf <> nil then
1221 begin
1222 FIntf := nil;
1223 end;
1224end;
1225
1226function TContextItemCollection.GetDefaultInterface: IContextItemCollection;
1227begin
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;
1232end;
1233
1234constructor TContextItemCollection.Create(AOwner: TComponent);
1235begin
1236 inherited Create(AOwner);
1237{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1238 FProps := TContextItemCollectionProperties.Create(Self);
1239{$ENDIF}
1240end;
1241
1242destructor TContextItemCollection.Destroy;
1243begin
1244{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1245 FProps.Free;
1246{$ENDIF}
1247 inherited Destroy;
1248end;
1249
1250{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1251function TContextItemCollection.GetServerProperties: TContextItemCollectionProperties;
1252begin
1253 Result := FProps;
1254end;
1255{$ENDIF}
1256
1257function TContextItemCollection.Get__NewEnum: IUnknown;
1258begin
1259 Result := DefaultInterface.Get__NewEnum;
1260end;
1261
1262function TContextItemCollection.Count: Integer;
1263begin
1264 Result := DefaultInterface.Count;
1265end;
1266
1267procedure TContextItemCollection.Add(const aContextItem: IContextItem);
1268begin
1269 DefaultInterface.Add(aContextItem);
1270end;
1271
1272procedure TContextItemCollection.Remove(const contextItemName: WideString);
1273begin
1274 DefaultInterface.Remove(contextItemName);
1275end;
1276
1277procedure TContextItemCollection.RemoveAll;
1278begin
1279 DefaultInterface.RemoveAll;
1280end;
1281
1282function TContextItemCollection.Present(key: OleVariant): IContextItem;
1283begin
1284 Result := DefaultInterface.Present(key);
1285end;
1286
1287function TContextItemCollection.Item(key: OleVariant): IContextItem;
1288begin
1289 Result := DefaultInterface.Item(key);
1290end;
1291
1292{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1293constructor TContextItemCollectionProperties.Create(AServer: TContextItemCollection);
1294begin
1295 inherited Create;
1296 FServer := AServer;
1297end;
1298
1299function TContextItemCollectionProperties.GetDefaultInterface: IContextItemCollection;
1300begin
1301 Result := FServer.DefaultInterface;
1302end;
1303
1304function TContextItemCollectionProperties.Get__NewEnum: IUnknown;
1305begin
1306 Result := DefaultInterface.Get__NewEnum;
1307end;
1308
1309{$ENDIF}
1310
1311class function CoContextItem.Create: IContextItem;
1312begin
1313 Result := CreateComObject(CLASS_ContextItem) as IContextItem;
1314end;
1315
1316class function CoContextItem.CreateRemote(const MachineName: string): IContextItem;
1317begin
1318 Result := CreateRemoteComObject(MachineName, CLASS_ContextItem) as IContextItem;
1319end;
1320
1321procedure TContextItem.InitServerData;
1322const
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);
1329begin
1330 ServerData := @CServerData;
1331end;
1332
1333procedure TContextItem.Connect;
1334var
1335 punk: IUnknown;
1336begin
1337 if FIntf = nil then
1338 begin
1339 punk := GetServer;
1340 Fintf:= punk as IContextItem;
1341 end;
1342end;
1343
1344procedure TContextItem.ConnectTo(svrIntf: IContextItem);
1345begin
1346 Disconnect;
1347 FIntf := svrIntf;
1348end;
1349
1350procedure TContextItem.DisConnect;
1351begin
1352 if Fintf <> nil then
1353 begin
1354 FIntf := nil;
1355 end;
1356end;
1357
1358function TContextItem.GetDefaultInterface: IContextItem;
1359begin
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;
1364end;
1365
1366constructor TContextItem.Create(AOwner: TComponent);
1367begin
1368 inherited Create(AOwner);
1369{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1370 FProps := TContextItemProperties.Create(Self);
1371{$ENDIF}
1372end;
1373
1374destructor TContextItem.Destroy;
1375begin
1376{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1377 FProps.Free;
1378{$ENDIF}
1379 inherited Destroy;
1380end;
1381
1382{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1383function TContextItem.GetServerProperties: TContextItemProperties;
1384begin
1385 Result := FProps;
1386end;
1387{$ENDIF}
1388
1389function TContextItem.Get_Subject: WideString;
1390begin
1391 Result := DefaultInterface.Get_Subject;
1392end;
1393
1394procedure TContextItem.Set_Subject(const pVal: WideString);
1395begin
1396 DefaultInterface.Set_Subject(pVal);
1397end;
1398
1399function TContextItem.Get_Role: WideString;
1400begin
1401 Result := DefaultInterface.Get_Role;
1402end;
1403
1404procedure TContextItem.Set_Role(const pVal: WideString);
1405begin
1406 DefaultInterface.Set_Role(pVal);
1407end;
1408
1409function TContextItem.Get_Prefix: WideString;
1410begin
1411 Result := DefaultInterface.Get_Prefix;
1412end;
1413
1414procedure TContextItem.Set_Prefix(const pVal: WideString);
1415begin
1416 DefaultInterface.Set_Prefix(pVal);
1417end;
1418
1419function TContextItem.Get_Suffix: WideString;
1420begin
1421 Result := DefaultInterface.Get_Suffix;
1422end;
1423
1424procedure TContextItem.Set_Suffix(const pVal: WideString);
1425begin
1426 DefaultInterface.Set_Suffix(pVal);
1427end;
1428
1429function TContextItem.Get_Name: WideString;
1430begin
1431 Result := DefaultInterface.Get_Name;
1432end;
1433
1434procedure TContextItem.Set_Name(const pVal: WideString);
1435begin
1436 DefaultInterface.Set_Name(pVal);
1437end;
1438
1439function TContextItem.Get_Value: WideString;
1440begin
1441 Result := DefaultInterface.Get_Value;
1442end;
1443
1444procedure TContextItem.Set_Value(const pVal: WideString);
1445begin
1446 DefaultInterface.Set_Value(pVal);
1447end;
1448
1449function TContextItem.Clone: IContextItem;
1450begin
1451 Result := DefaultInterface.Clone;
1452end;
1453
1454{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1455constructor TContextItemProperties.Create(AServer: TContextItem);
1456begin
1457 inherited Create;
1458 FServer := AServer;
1459end;
1460
1461function TContextItemProperties.GetDefaultInterface: IContextItem;
1462begin
1463 Result := FServer.DefaultInterface;
1464end;
1465
1466function TContextItemProperties.Get_Subject: WideString;
1467begin
1468 Result := DefaultInterface.Get_Subject;
1469end;
1470
1471procedure TContextItemProperties.Set_Subject(const pVal: WideString);
1472begin
1473 DefaultInterface.Set_Subject(pVal);
1474end;
1475
1476function TContextItemProperties.Get_Role: WideString;
1477begin
1478 Result := DefaultInterface.Get_Role;
1479end;
1480
1481procedure TContextItemProperties.Set_Role(const pVal: WideString);
1482begin
1483 DefaultInterface.Set_Role(pVal);
1484end;
1485
1486function TContextItemProperties.Get_Prefix: WideString;
1487begin
1488 Result := DefaultInterface.Get_Prefix;
1489end;
1490
1491procedure TContextItemProperties.Set_Prefix(const pVal: WideString);
1492begin
1493 DefaultInterface.Set_Prefix(pVal);
1494end;
1495
1496function TContextItemProperties.Get_Suffix: WideString;
1497begin
1498 Result := DefaultInterface.Get_Suffix;
1499end;
1500
1501procedure TContextItemProperties.Set_Suffix(const pVal: WideString);
1502begin
1503 DefaultInterface.Set_Suffix(pVal);
1504end;
1505
1506function TContextItemProperties.Get_Name: WideString;
1507begin
1508 Result := DefaultInterface.Get_Name;
1509end;
1510
1511procedure TContextItemProperties.Set_Name(const pVal: WideString);
1512begin
1513 DefaultInterface.Set_Name(pVal);
1514end;
1515
1516function TContextItemProperties.Get_Value: WideString;
1517begin
1518 Result := DefaultInterface.Get_Value;
1519end;
1520
1521procedure TContextItemProperties.Set_Value(const pVal: WideString);
1522begin
1523 DefaultInterface.Set_Value(pVal);
1524end;
1525
1526{$ENDIF}
1527
1528class function CoResponseDialog.Create: IResponseDialog;
1529begin
1530 Result := CreateComObject(CLASS_ResponseDialog) as IResponseDialog;
1531end;
1532
1533class function CoResponseDialog.CreateRemote(const MachineName: string): IResponseDialog;
1534begin
1535 Result := CreateRemoteComObject(MachineName, CLASS_ResponseDialog) as IResponseDialog;
1536end;
1537
1538procedure TResponseDialog.InitServerData;
1539const
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);
1546begin
1547 ServerData := @CServerData;
1548end;
1549
1550procedure TResponseDialog.Connect;
1551var
1552 punk: IUnknown;
1553begin
1554 if FIntf = nil then
1555 begin
1556 punk := GetServer;
1557 Fintf:= punk as IResponseDialog;
1558 end;
1559end;
1560
1561procedure TResponseDialog.ConnectTo(svrIntf: IResponseDialog);
1562begin
1563 Disconnect;
1564 FIntf := svrIntf;
1565end;
1566
1567procedure TResponseDialog.DisConnect;
1568begin
1569 if Fintf <> nil then
1570 begin
1571 FIntf := nil;
1572 end;
1573end;
1574
1575function TResponseDialog.GetDefaultInterface: IResponseDialog;
1576begin
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;
1581end;
1582
1583constructor TResponseDialog.Create(AOwner: TComponent);
1584begin
1585 inherited Create(AOwner);
1586{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1587 FProps := TResponseDialogProperties.Create(Self);
1588{$ENDIF}
1589end;
1590
1591destructor TResponseDialog.Destroy;
1592begin
1593{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1594 FProps.Free;
1595{$ENDIF}
1596 inherited Destroy;
1597end;
1598
1599{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1600function TResponseDialog.GetServerProperties: TResponseDialogProperties;
1601begin
1602 Result := FProps;
1603end;
1604{$ENDIF}
1605
1606function TResponseDialog.ProcessSurveyResults(responses: OleVariant; noContinue: WordBool): UserResponse;
1607begin
1608 Result := DefaultInterface.ProcessSurveyResults(responses, noContinue);
1609end;
1610
1611{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1612constructor TResponseDialogProperties.Create(AServer: TResponseDialog);
1613begin
1614 inherited Create;
1615 FServer := AServer;
1616end;
1617
1618function TResponseDialogProperties.GetDefaultInterface: IResponseDialog;
1619begin
1620 Result := FServer.DefaultInterface;
1621end;
1622
1623{$ENDIF}
1624
1625class function CoContextorParticipant.Create: IContextParticipant;
1626begin
1627 Result := CreateComObject(CLASS_ContextorParticipant) as IContextParticipant;
1628end;
1629
1630class function CoContextorParticipant.CreateRemote(const MachineName: string): IContextParticipant;
1631begin
1632 Result := CreateRemoteComObject(MachineName, CLASS_ContextorParticipant) as IContextParticipant;
1633end;
1634
1635procedure TContextorParticipant.InitServerData;
1636const
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);
1643begin
1644 ServerData := @CServerData;
1645end;
1646
1647procedure TContextorParticipant.Connect;
1648var
1649 punk: IUnknown;
1650begin
1651 if FIntf = nil then
1652 begin
1653 punk := GetServer;
1654 Fintf:= punk as IContextParticipant;
1655 end;
1656end;
1657
1658procedure TContextorParticipant.ConnectTo(svrIntf: IContextParticipant);
1659begin
1660 Disconnect;
1661 FIntf := svrIntf;
1662end;
1663
1664procedure TContextorParticipant.DisConnect;
1665begin
1666 if Fintf <> nil then
1667 begin
1668 FIntf := nil;
1669 end;
1670end;
1671
1672function TContextorParticipant.GetDefaultInterface: IContextParticipant;
1673begin
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;
1678end;
1679
1680constructor TContextorParticipant.Create(AOwner: TComponent);
1681begin
1682 inherited Create(AOwner);
1683{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1684 FProps := TContextorParticipantProperties.Create(Self);
1685{$ENDIF}
1686end;
1687
1688destructor TContextorParticipant.Destroy;
1689begin
1690{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1691 FProps.Free;
1692{$ENDIF}
1693 inherited Destroy;
1694end;
1695
1696{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1697function TContextorParticipant.GetServerProperties: TContextorParticipantProperties;
1698begin
1699 Result := FProps;
1700end;
1701{$ENDIF}
1702
1703function TContextorParticipant.ContextChangesPending(contextCoupon: Integer; var reason: WideString): WideString;
1704begin
1705 Result := DefaultInterface.ContextChangesPending(contextCoupon, reason);
1706end;
1707
1708procedure TContextorParticipant.ContextChangesAccepted(contextCoupon: Integer);
1709begin
1710 DefaultInterface.ContextChangesAccepted(contextCoupon);
1711end;
1712
1713procedure TContextorParticipant.ContextChangesCanceled(contextCoupon: Integer);
1714begin
1715 DefaultInterface.ContextChangesCanceled(contextCoupon);
1716end;
1717
1718procedure TContextorParticipant.CommonContextTerminated;
1719begin
1720 DefaultInterface.CommonContextTerminated;
1721end;
1722
1723procedure TContextorParticipant.Ping;
1724begin
1725 DefaultInterface.Ping;
1726end;
1727
1728{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
1729constructor TContextorParticipantProperties.Create(AServer: TContextorParticipant);
1730begin
1731 inherited Create;
1732 FServer := AServer;
1733end;
1734
1735function TContextorParticipantProperties.GetDefaultInterface: IContextParticipant;
1736begin
1737 Result := FServer.DefaultInterface;
1738end;
1739
1740{$ENDIF}
1741{
1742procedure Register;
1743begin
1744 RegisterComponents('Kernel',[TContextorControl]);
1745 RegisterComponents('Kernel',[TContextor, TContextItemCollection, TContextItem, TResponseDialog,
1746 TContextorParticipant]);
1747end;
1748}
1749end.
Note: See TracBrowser for help on using the repository browser.