| ## Public API Reference

- Main Page
- Classes
- Files

# propclass/prop.h

    00001 /*
    00002     Crystal Space Entity Layer
    00003     Copyright (C) 2001 by Jorrit Tyberghein
    00004
    00005     This library is free software; you can redistribute it and/or
    00006     modify it under the terms of the GNU Library General Public
    00007     License as published by the Free Software Foundation; either
    00008     version 2 of the License, or (at your option) any later version.
    00009
    00010     This library is distributed in the hope that it will be useful,
    00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013     Library General Public License for more details.
    00014
    00015     You should have received a copy of the GNU Library General Public
    00016     License along with this library; if not, write to the Free
    00017     Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00018 */
    00019
    00020 #ifndef __CEL_PF_PROP__
    00021 #define __CEL_PF_PROP__
    00022
    00023 #include "cstypes.h"
    00024 #include "csutil/scf.h"
    00025 #include "physicallayer/datatype.h"
    00026
    00027 struct iCelEntity;
    00028 struct iCelPropertyClass;
    00029 struct iPcProperties;
    00030 class csVector2;
    00031 class csVector3;
    00032 class csColor;
    00033
    00037 struct iPcPropertyListener : public virtual iBase
    00038 {
    00039   SCF_INTERFACE (iPcPropertyListener, 0, 0, 1);
    00040
    00044   virtual void PropertyChanged (iPcProperties* pcprop, size_t idx) = 0;
    00045 };
    00046
    00047 SCF_VERSION (iPcProperties, 0, 0, 1);
    00048
    00066 struct iPcProperties : public iBase
    00067 {
    00072   virtual void AddPropertyListener (iPcPropertyListener* listener) = 0;
    00076   virtual void RemovePropertyListener (iPcPropertyListener* listener) = 0;
    00077
    00081   virtual void SetProperty (const char* name, float value) = 0;
    00082
    00086   virtual void SetProperty (const char* name, long value) = 0;
    00087
    00091   virtual void SetProperty (const char* name, bool value) = 0;
    00092
    00096   virtual void SetProperty (const char* name, const char* value) = 0;
    00097
    00101   virtual void SetProperty (const char* name, const csVector2& value) = 0;
    00102
    00106   virtual void SetProperty (const char* name, const csVector3& value) = 0;
    00107
    00111   virtual void SetProperty (const char* name, const csColor& value) = 0;
    00112
    00116   virtual void SetProperty (const char* name, iCelPropertyClass* pclass) = 0;
    00117
    00121   virtual void SetProperty (const char* name, iCelEntity* entity) = 0;
    00122
    00126   virtual void SetProperty (const char* name, iBase* value) = 0;
    00127
    00132   virtual size_t GetPropertyIndex (const char* name) = 0;
    00133
    00137   virtual void SetPropertyIndex (size_t index, float value) = 0;
    00138
    00142   virtual void SetPropertyIndex (size_t index, long value) = 0;
    00143
    00147   virtual void SetPropertyIndex (size_t index, bool value) = 0;
    00148
    00152   virtual void SetPropertyIndex (size_t index, const csVector2& value) = 0;
    00153
    00157   virtual void SetPropertyIndex (size_t index, const csVector3& value) = 0;
    00158
    00162   virtual void SetPropertyIndex (size_t index, const csColor& value) = 0;
    00163
    00167   virtual void SetPropertyIndex (size_t index, const char* value) = 0;
    00168
    00172   virtual void SetPropertyIndex (size_t index, iCelPropertyClass* pc) = 0;
    00173
    00177   virtual void SetPropertyIndex (size_t index, iCelEntity* entity) = 0;
    00178
    00182   virtual void SetPropertyIndex (size_t index, iBase* value) = 0;
    00183
    00201   virtual celDataType GetPropertyType (size_t index) const = 0;
    00202
    00206   virtual float GetPropertyFloat (size_t index) const = 0;
    00207
    00211   virtual long GetPropertyLong (size_t index) const = 0;
    00212
    00216   virtual bool GetPropertyBool (size_t index) const = 0;
    00217
    00221   virtual bool GetPropertyVector (size_t index, csVector2& v) const = 0;
    00222
    00226   virtual bool GetPropertyVector (size_t index, csVector3& v) const = 0;
    00227
    00231   virtual bool GetPropertyColor (size_t index, csColor& v) const = 0;
    00232
    00236   virtual const char* GetPropertyString (size_t index) const = 0;
    00237
    00241   virtual iCelPropertyClass* GetPropertyPClass (size_t index) const = 0;
    00242
    00246   virtual iCelEntity* GetPropertyEntity (size_t index) const = 0;
    00247
    00251   virtual iBase* GetPropertyIBase (size_t index) const = 0;
    00252
    00256   virtual void ClearProperty (size_t index) = 0;
    00257
    00261   virtual void Clear () = 0;
    00262
    00266   virtual size_t GetPropertyCount () const = 0;
    00267
    00271   virtual const char* GetPropertyName (size_t idx) const = 0;
    00272
    00276   virtual void Dump () = 0;
    00277 };
    00278
    00279 #endif // __CEL_PF_PROP__
    00280