00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __IOBJECT_OBJECT_H__
00020 #define __IOBJECT_OBJECT_H__
00021
00022 #include "csutil/scf.h"
00023
00024 struct iObjectIterator;
00025
00030 #define CS_GET_CHILD_OBJECT(object,Interface) \
00031 ((Interface*)(object)->GetChild ( \
00032 iSCF::SCF->GetInterfaceID (#Interface), VERSION_##Interface))
00033
00039 #define CS_GET_CHILD_OBJECT_FAST(object,Interface) \
00040 ((Interface*)(object)->GetChild(scfGetID_##Interface(), VERSION_##Interface))
00041
00046 #define CS_GET_NAMED_CHILD_OBJECT(object,Interface,name) \
00047 ((Interface*)(object)->GetChild (iSCF::SCF->GetInterfaceID \
00048 (#Interface), VERSION_##Interface, name))
00049
00055 #define CS_GET_NAMED_CHILD_OBJECT_FAST(object,Interface,name) \
00056 ((Interface*)(object)->GetChild \
00057 (scfGetID_##Interface (), VERSION_##Interface, name))
00058
00063 #define CS_GET_FIRST_NAMED_CHILD_OBJECT(object,Interface,name) \
00064 ((Interface*)(object)->GetChild (iSCF::SCF->GetInterfaceID \
00065 (#Interface), VERSION_##Interface, name, true))
00066
00071 #define CS_GET_FIRST_NAMED_CHILD_OBJECT_FAST(object,Interface,name) \
00072 ((Interface*)(object)->GetChild \
00073 (scfGetID_##Interface (), VERSION_##Interface, name, true))
00074
00075
00076 SCF_VERSION (iObject, 0, 3, 0);
00077
00081 struct iObject : public iBase
00082 {
00084 virtual void SetName (const char *iName) = 0;
00085
00087 virtual const char *GetName () const = 0;
00088
00090 virtual CS_ID GetID () const = 0;
00091
00096 virtual void SetObjectParent (iObject *obj) = 0;
00097
00099 virtual iObject* GetObjectParent () const = 0;
00100
00102 virtual void ObjAdd (iObject *obj) = 0;
00103
00105 virtual void ObjRemove (iObject *obj) = 0;
00106
00108 virtual void ObjRemoveAll () = 0;
00109
00111 virtual void ObjAddChildren (iObject *Parent) = 0;
00112
00123 virtual void* GetChild (int iInterfaceID, int iVersion,
00124 const char *Name = NULL, bool FirstName = false) const = 0;
00125
00127 virtual iObject *GetChild (const char *Name) const = 0;
00128
00133 virtual iObjectIterator *GetIterator () = 0;
00134
00139 virtual void ObjReleaseOld (iObject *obj) = 0;
00140 };
00141
00142
00143 SCF_VERSION (iObjectIterator, 0, 0, 1);
00144
00152 struct iObjectIterator : public iBase
00153 {
00155 virtual bool Next() = 0;
00156
00158 virtual void Reset() = 0;
00159
00161 virtual iObject *GetObject () const = 0;
00162
00164 virtual iObject* GetParentObj() const = 0;
00165
00167 virtual bool IsFinished () const = 0;
00168
00175 virtual bool FindName (const char* name) = 0;
00176 };
00177
00178
00179 SCF_VERSION (iDataObject, 0, 0, 1);
00180
00182 struct iDataObject : public iBase
00183 {
00185 virtual iObject *QueryObject () = 0;
00186
00188 virtual void* GetData () = 0;
00189 };
00190
00191 #endif