00001 00002 00003 00004 00005 00006
00007
00008
00009 #ifndef skXMLELEMENTOBJECT_H
00010 #define skXMLELEMENTOBJECT_H
00011
00012 #include "skExecutable.h"
00013 #include "dom/DOM_Element.hpp"
00014 #include <iostream.h>
00015
00016 class skMethodTable;
00017
00018
00019
00020 #define XMLELEMENT_TYPE 2
00021
00022 00023 00024
00025 extern ostream& operator<<(ostream& target, DOM_Node& toWrite);
00026 00027 00028
00029 extern ostream& operator<< (ostream& target, const DOMString& s);
00030
00044 class skXMLElementObject : public skExecutable {
00045 public:
00049 skXMLElementObject();
00055 skXMLElementObject(const skString& location,DOM_Element elem);
00059 ~skXMLElementObject();
00064 int executableType() const;
00068 int intValue() const;
00072 float floatValue() const;
00076 bool boolValue() const;
00080 char charValue() const;
00084 skString strValue() const;
00092 bool setValue(const skString& s,const skString& attribute,const skRValue& return_value);
00100 bool setValueAt(const skRValue& array_index,const skString& attribute,const skRValue& value);
00109 bool getValue(const skString& s,const skString& attribute,skRValue& return_value);
00114 bool getValueAt(const skRValue& array_index,const skString& attribute,skRValue& value);
00126 bool method(const skString& name,skRValueArray& args,skRValue& ret);
00131 00136 void copyItemsInto(DOM_Element other);
00141 DOM_Element getElement();
00147 static skString getData(DOM_Element element);
00153 static void setData(DOM_Element element,const skString& data);
00160 static DOM_Element findChild(DOM_Element parent,const skString& tagname);
00167 static DOM_Element findChild(DOM_Element parent,int index);
00176 static DOM_Element findChild(DOM_Element parent,const skString& tagname,const skString& attribute,const skString& value);
00180 void setAttribute(skString name,const skString& value);
00185 skString getAttribute(const skString& name);
00189 static skString toString(DOMString str);
00193 static DOMString fromString(const skString& str);
00197 skString getLocation() const;
00199 static int countChildren(DOM_Element parent);
00200 protected:
00205 void setElement(DOM_Element element);
00206 protected:
00210 skString m_ScriptLocation;
00211 private:
00215 DOM_Element m_Element;
00219 skMethodTable * m_MethodCache;
00223 skXMLElementObject(const skXMLElementObject&);
00227 skXMLElementObject& operator=(const skXMLElementObject&);
00228 };
00229
00230 #endif