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_8h-source.html,v 1.1 2003/04/14 15:53:25 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;
00082 #ifdef USE_FLOATING_POINT
00083 
00086   float floatValue() const;
00087 #endif
00088 
00091   bool boolValue() const;
00095   Char charValue() const;
00099   skString strValue() const;
00107   virtual bool setValue(const skString& name,const skString& attribute,const skRValue& return_value);
00115   virtual bool setValueAt(const skRValue& array_index,const skString& attribute,const skRValue& value); 
00125   virtual bool getValue(const skString& name,const skString& attribute,skRValue& value);
00134   virtual bool getValueAt(const skRValue& array_index,const skString& attribute,skRValue& value);
00147   virtual bool method(const skString& name,skRValueArray& args,skRValue& ret,skExecutableContext& ctxt);
00152   bool equals(const skiExecutable * o) const;
00157   void copyItemsInto(skElement * other);
00161   virtual void setAddIfNotPresent(bool enable);
00165   virtual bool getAddIfNotPresent();
00170   skElement * getElement();
00176   static skString getData(skElement * element);
00182   static void setData(skElement * element,const skString& data);
00189   static skElement * findChild(skElement * parent,const skString& tagname);
00196   static skElement * findChild(skElement * parent,int index);
00205   static skElement * findChild(skElement * parent,const skString& tagname,const skString& attribute,const skString& value);
00209   void setAttribute(skString name,const skString& value);
00214   skString getAttribute(const skString& name) const;
00218   skString getLocation() const;
00222   void setLocation(const skString& location) ;
00224   static int countChildren(skElement * parent);
00229   skExecutableIterator * createIterator(const skString& qualifier);
00233   skExecutableIterator * createIterator();
00237   virtual skString getSource(const skString& location);
00242   virtual void getInstanceVariables(skRValueTable& table);
00247   virtual void getAttributes(skRValueTable& table);
00248 protected:
00254   virtual void setElement(skElement * element,bool created=false);
00260   virtual skElementObject * createElementObject(const skString& location,skElement * element,bool created);
00264   skString m_ScriptLocation;
00265  protected:
00269   skElement * m_Element;
00273   skMethodTable * m_MethodCache;
00277   skElementObject(const skElementObject&);
00281   skElementObject& operator=(const skElementObject&);
00286   bool m_AddIfNotPresent;
00288   bool m_Created;
00289 };
00290 
00291 #endif

Generated on Mon Apr 14 16:49:22 2003 for Simkin C++ for Windows CE by doxygen1.3