|
object.h00001 /* 00002 Copyright (C) 2000 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 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 00135 // @@@ temporary fix 00136 virtual void ObjReleaseOld (iObject *obj) = 0; 00137 }; 00138 00139 00140 SCF_VERSION (iObjectIterator, 0, 0, 1); 00141 00149 struct iObjectIterator : public iBase 00150 { 00152 virtual bool Next() = 0; 00153 00155 virtual void Reset() = 0; 00156 00158 virtual iObject *GetObject () const = 0; 00159 00161 virtual iObject* GetParentObj() const = 0; 00162 00164 virtual bool IsFinished () const = 0; 00165 00172 virtual bool FindName (const char* name) = 0; 00173 }; 00174 00175 00176 SCF_VERSION (iDataObject, 0, 0, 1); 00177 00179 struct iDataObject : public iBase 00180 { 00182 virtual iObject *QueryObject () = 0; 00183 00185 virtual void* GetData () = 0; 00186 }; 00187 00188 #endif Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000 |