CrystalSpace

Public API Reference

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 "csutil/scf.h"
00029 
00030 
00031 struct iObject;
00032 struct iSharedVariableListener;
00033 
00034 class csColor;
00035 class csVector3;
00036 
00037 SCF_VERSION (iSharedVariable, 0, 1, 0);
00038 
00043 struct iSharedVariable : public iBase
00044 {
00046   virtual iObject* QueryObject () = 0;
00047 
00049   virtual void SetName (const char *name) = 0;
00050 
00052   virtual const char *GetName () const = 0;
00053 
00055   virtual void Set(float val) = 0;
00056 
00058   virtual float Get () const = 0;
00059 
00061   virtual void SetColor (const csColor& col) = 0;
00062 
00064   virtual const csColor& GetColor () const = 0;
00065 
00067   virtual void SetVector (const csVector3& v) = 0;
00068 
00070   virtual const csVector3& GetVector () const = 0;
00071 
00073   enum SharedVariableType
00074   {
00075       SV_UNKNOWN = 0,
00076       SV_FLOAT   = 1,
00077       SV_COLOR   = 2,
00078       SV_VECTOR  = 3
00079   };
00080 
00082   virtual int GetType () const = 0;
00083 
00085   virtual void AddListener (iSharedVariableListener* listener) = 0;
00086 
00088   virtual void RemoveListener (iSharedVariableListener* listener) = 0;
00089 };
00090 
00091 SCF_VERSION (iSharedVariableListener, 0, 0, 1);
00092 
00097 struct iSharedVariableListener : public iBase
00098 {
00102   virtual void VariableChanged (iSharedVariable* var) = 0;
00103 };
00104 
00105 SCF_VERSION (iSharedVariableList, 0, 0, 2);
00106 
00110 struct iSharedVariableList : public iBase
00111 {
00113   virtual int GetCount () const = 0;
00114 
00116   virtual iSharedVariable *Get (int n) const = 0;
00117 
00119   virtual int Add (iSharedVariable *obj) = 0;
00120 
00122   virtual bool Remove (iSharedVariable *obj) = 0;
00123 
00125   virtual bool Remove (int n) = 0;
00126 
00128   virtual void RemoveAll () = 0;
00129 
00131   virtual int Find (iSharedVariable *obj) const = 0;
00132 
00134   virtual iSharedVariable *FindByName (const char *Name) const = 0;
00135 
00137   virtual csPtr<iSharedVariable> New() const = 0;
00138 };
00139 
00142 #endif // __CS_IENGINE_SHAREVAR_H__

Generated for Crystal Space by doxygen 1.4.4