CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

iengine/sharevar.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2002 by Keith Fulton
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 __CS_IENGINE_SHAREVAR_H__
00020 #define __CS_IENGINE_SHAREVAR_H__
00021 
00028 #include "cstypes.h"
00029 #include "csutil/scf.h"
00030 #include "csutil/cscolor.h"
00031 #include "csgeom/vector3.h"
00032 
00033 struct iSharedVariableListener;
00034 
00035 SCF_VERSION (iSharedVariable, 0, 1, 0);
00036 
00041 struct iSharedVariable : public iBase
00042 {
00044   virtual iObject* QueryObject () = 0;
00045 
00047   virtual void SetName (const char *name) = 0;
00048 
00050   virtual const char *GetName () const = 0;
00051 
00053   virtual void Set(float val) = 0;
00054 
00056   virtual float Get () const = 0;
00057 
00059   virtual void SetColor (const csColor& col) = 0;
00060 
00062   virtual const csColor& GetColor () const = 0;
00063 
00065   virtual void SetVector (const csVector3& v) = 0;
00066 
00068   virtual const csVector3& GetVector () const = 0;
00069 
00071   enum SharedVariableType
00072   {
00073       SV_UNKNOWN = 0,
00074       SV_FLOAT   = 1,
00075       SV_COLOR   = 2,
00076       SV_VECTOR  = 3
00077   };
00078 
00080   virtual int GetType () const = 0;
00081 
00083   virtual void AddListener (iSharedVariableListener* listener) = 0;
00084 
00086   virtual void RemoveListener (iSharedVariableListener* listener) = 0;
00087 };
00088 
00089 SCF_VERSION (iSharedVariableListener, 0, 0, 1);
00090 
00095 struct iSharedVariableListener : public iBase
00096 {
00100   virtual void VariableChanged (iSharedVariable* var) = 0;
00101 };
00102 
00103 SCF_VERSION (iSharedVariableList, 0, 0, 2);
00104 
00108 struct iSharedVariableList : public iBase
00109 {
00111   virtual int GetCount () const = 0;
00112 
00114   virtual iSharedVariable *Get (int n) const = 0;
00115 
00117   virtual int Add (iSharedVariable *obj) = 0;
00118 
00120   virtual bool Remove (iSharedVariable *obj) = 0;
00121 
00123   virtual bool Remove (int n) = 0;
00124 
00126   virtual void RemoveAll () = 0;
00127 
00129   virtual int Find (iSharedVariable *obj) const = 0;
00130 
00132   virtual iSharedVariable *FindByName (const char *Name) const = 0;
00133 
00135   virtual csPtr<iSharedVariable> New() const = 0;
00136 };
00137 
00138 #endif // __CS_IENGINE_SHAREVAR_H__

Generated for Crystal Space by doxygen 1.2.18