Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

skElementObject.h

00001 /*
00002   Copyright 1996-2003
00003   Simon Whiteside
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser 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     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 * $Id: skElementObject.h,v 1.15 2003/03/18 19:36:13 simkin_cvs Exp $
00020 */
00021 
00022 
00023 #ifndef skELEMENTOBJECT_H
00024 #define skELEMENTOBJECT_H
00025 
00026 #include "skExecutable.h"
00027 #include "skElement.h"
00028 
00029 #ifdef STREAMS_ENABLED
00030 #include <iostream.h>
00031 #endif
00032 
00033 class skMethodTable;
00034 
00035 // this is the value returned by executableType
00036 
00037 #define ELEMENT_TYPE 4
00038 
00039 
00056 class CLASSEXPORT skElementObject : public skExecutable {
00057  public:
00061   skElementObject();
00068   skElementObject(const skString& location,skElement * elem,bool created);
00072   ~skElementObject();
00077   int executableType() const;                   
00081   int intValue() const;
00085   float floatValue() const;
00089   bool boolValue() const;
00093   Char charValue() const;
00097   skString strValue() const;
00105   virtual bool setValue(const skString& name,const skString& attribute,const skRValue& return_value);
00113   virtual bool setValueAt(const skRValue& array_index,const skString& attribute,const skRValue& value); 
00123   virtual bool getValue(const skString& name,const skString& attribute,skRValue& value);
00132   virtual bool getValueAt(const skRValue& array_index,const skString& attribute,skRValue& value);
00145   virtual bool method(const skString& name,skRValueArray& args,skRValue& ret,skExecutableContext& ctxt);
00150   bool equals(skExecutable * o) const;
00155   void copyItemsInto(skElement * other);
00159   virtual void setAddIfNotPresent(bool enable);
00163   virtual bool getAddIfNotPresent();
00168   skElement * getElement();
00174   static skString getData(skElement * element);
00180   static void setData(skElement * element,const skString& data);
00187   static skElement * findChild(skElement * parent,const skString& tagname);
00194   static skElement * findChild(skElement * parent,int index);
00203   static skElement * findChild(skElement * parent,const skString& tagname,const skString& attribute,const skString& value);
00207   void setAttribute(skString name,const skString& value);
00212   skString getAttribute(const skString& name) const;
00216   skString getLocation() const;
00220   void setLocation(const skString& location) ;
00222   static int countChildren(skElement * parent);
00227   skExecutableIterator * createIterator(const skString& qualifier);
00231   skExecutableIterator * createIterator();
00235   virtual skString getSource(const skString& location);
00240   virtual void getInstanceVariables(skRValueTable& table);
00245   virtual void getAttributes(skRValueTable& table);
00246 protected:
00252   virtual void setElement(skElement * element,bool created=false);
00258   virtual skElementObject * createElementObject(const skString& location,skElement * element,bool created);
00262   skString m_ScriptLocation;
00263  protected:
00267   skElement * m_Element;
00271   skMethodTable * m_MethodCache;
00275   skElementObject(const skElementObject&);
00279   skElementObject& operator=(const skElementObject&);
00284   bool m_AddIfNotPresent;
00286   bool m_Created;
00287 };
00288 
00289 #endif

Generated on Tue Mar 18 19:46:18 2003 for Simkin by doxygen1.3-rc1