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.5 2003/01/23 15:31:03 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& s,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& s,const skString& attribute,skRValue& value);
00128   virtual bool getValueAt(const skRValue& array_index,const skString& attribute,skRValue& value);
00141   virtual bool method(const skString& name,skRValueArray& args,skRValue& ret,skExecutableContext& ctxt);
00146   bool equals(skExecutable * o) const;
00151   void copyItemsInto(skElement * other);
00155   virtual void setAddIfNotPresent(bool enable);
00159   virtual bool getAddIfNotPresent();
00164   skElement * getElement();
00170   static skString getData(skElement * element);
00176   static void setData(skElement * element,const skString& data);
00183   static skElement * findChild(skElement * parent,const skString& tagname);
00190   static skElement * findChild(skElement * parent,int index);
00199   static skElement * findChild(skElement * parent,const skString& tagname,const skString& attribute,const skString& value);
00203   void setAttribute(skString name,const skString& value);
00208   skString getAttribute(const skString& name) const;
00212   skString getLocation() const;
00216   void setLocation(const skString& location) ;
00218   static int countChildren(skElement * parent);
00223   skExecutableIterator * createIterator(const skString& qualifier);
00227   skExecutableIterator * createIterator();
00231   virtual skString getSource(const skString& location);
00236   virtual void getInstanceVariables(skRValueTable& table);
00237  protected:
00243   virtual void setElement(skElement * element,bool created=false);
00249   virtual skElementObject * createElementObject(const skString& location,skElement * element,bool created);
00253   skString m_ScriptLocation;
00254  protected:
00258   skElement * m_Element;
00262   skMethodTable * m_MethodCache;
00266   skElementObject(const skElementObject&);
00270   skElementObject& operator=(const skElementObject&);
00275   bool m_AddIfNotPresent;
00277   bool m_Created;
00278 };
00279 
00280 #endif

Generated on Thu Jan 23 15:25:38 2003 for Simkin by doxygen1.3-rc1