2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
6 // $Header: r:/t2repos/thief2/src/object/linkman.h,v 1.4 2000/01/29 13:23:26 adurant Exp $
15 #define INTERFACE ILinkManager
17 DECLARE_INTERFACE_(ILinkManager
, IUnknown
)
20 DECLARE_UNKNOWN_PURE();
25 STDMETHOD_(IRelation
*,GetRelation
)(THIS_ RelationID id
) PURE
;
26 STDMETHOD_(IRelation
*,GetRelationNamed
)(THIS_
const char* name
) PURE
;
28 #define ILinkManager_GetRelation(p, a) COMCall1(p, GetRelation, a)
29 #define ILinkManager_GetRelationNamed(p, a) COMCall1(p, GetRelationNamed, a)
32 // Notify the link manager (and thereby all relations) of a system event
34 STDMETHOD(Notify
)(THIS_ eRelationNotifyMsg msg
, RelationNotifyData data
) PURE
;
36 #define ILinkManager_Notify(p, a, b) COMCall2(p, Notify, a, b)
39 // Iterate across all relations
41 STDMETHOD(IterStart
)(THIS_ sRelationIter
* iter
) PURE
;
42 STDMETHOD_(BOOL
,IterNext
)(THIS_ sRelationIter
* iter
, RelationID
* rel
) PURE
;
43 STDMETHOD(IterStop
)(THIS_ sRelationIter
* iter
) PURE
;
45 #define ILinkManager_IterStart(p, a) COMCall1(p, IterStart, a)
46 #define ILinkManager_IterNext(p, a, b) COMCall2(p, IterNext, a, b)
47 #define ILinkManager_IterStop(p, a) COMCall1(p, IterStop, a)
50 // Add/Remove/Access Links
52 STDMETHOD_(LinkID
, Add
)(THIS_ ObjID source
, ObjID dest
, RelationID id
) PURE
;
53 STDMETHOD_(LinkID
, AddFull
)(THIS_ ObjID source
, ObjID desc
, RelationID id
, void* data
) PURE
;
54 STDMETHOD(Remove
)(THIS_ LinkID id
) PURE
;
55 STDMETHOD_(BOOL
,Get
)(THIS_ LinkID id
, sLink
* out
) CONSTFUNC PURE
;
56 STDMETHOD(SetData
)(THIS_ LinkID id
, void* data
) PURE
;
57 STDMETHOD_(void*,GetData
)(THIS_ LinkID id
) PURE
;
59 #define ILinkManager_Add(p, a, b, c) COMCall3(p, Add, a, b, c)
60 #define ILinkManager_AddFull(p, a, b, c, d) COMCall4(p, AddFull, a, b, c, d)
61 #define ILinkManager_Remove(p, a) COMCall1(p, Remove, a)
62 #define ILinkManager_Get(p, a, b) COMCall2(p, Get, a, b)
63 #define ILinkManager_SetData(p, a, b) COMCall2(p, SetData, a, b)
64 #define ILinkManager_GetData(p, a, b) COMCall2(p, GetData, a, b)
67 // Query links, objects can be OBJID_WILDCARD, relation can be RELID_WILDCARD
69 STDMETHOD_(ILinkQuery
*,Query
)(THIS_ ObjID source
, ObjID dest
, RelationID flavor
) PURE
;
72 // Remap a link id after it has been loaded, in order to account for differences in the relation IDs
73 // Call this from any code that loads link IDs from disk
75 STDMETHOD_(LinkID
,RemapOnLoad
)(THIS_ LinkID id
) PURE
;
77 #define ILinkManager_Query(p, a, b, c) COMCall3(p, Query, a, b, c)
80 // Look for a singleton link
82 STDMETHOD_(LinkID
, GetSingleLink
)(THIS_ RelationID id
, ObjID source
, ObjID dest
) PURE
;
85 // Check for any links at all
87 STDMETHOD_(BOOL
, AnyLinks
)(THIS_ RelationID id
, ObjID source
, ObjID dest
) PURE
;
90 EXTERN tResult LGAPI
LinkManagerCreate(void);