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
00047 class skXMLElementObject : public skExecutable {
00048 public:
00052 skXMLElementObject();
00058 skXMLElementObject(const skString& location,DOM_Element elem);
00062 ~skXMLElementObject();
00067 int executableType() const;
00071 int intValue() const;
00075 float floatValue() const;
00079 bool boolValue() const;
00083 Char charValue() const;
00087 skString strValue() const;
00095 bool setValue(const skString& s,const skString& attribute,const skRValue& return_value);
00103 bool setValueAt(const skRValue& array_index,const skString& attribute,const skRValue& value);
00113 bool getValue(const skString& s,const skString& attribute,skRValue& return_value);
00118 bool getValueAt(const skRValue& array_index,const skString& attribute,skRValue& value);
00130 bool method(const skString& name,skRValueArray& args,skRValue& ret);
00135 00140 void copyItemsInto(DOM_Element other);
00145 DOM_Element getElement();
00151 static skString getData(DOM_Element element);
00157 static void setData(DOM_Element element,const skString& data);
00164 static DOM_Element findChild(DOM_Element parent,const skString& tagname);
00171 static DOM_Element findChild(DOM_Element parent,int index);
00180 static DOM_Element findChild(DOM_Element parent,const skString& tagname,const skString& attribute,const skString& value);
00184 void setAttribute(skString name,const skString& value);
00189 skString getAttribute(const skString& name);
00193 static skString toString(DOMString str);
00197 static DOMString fromString(const skString& str);
00201 skString getLocation() const;
00203 static int countChildren(DOM_Element parent);
00204 protected:
00209 virtual void setElement(DOM_Element element);
00215 virtual skXMLElementObject * createXMLElementObject(const skString& location,DOM_Element element);
00219 virtual void setAddIfNotPresent(bool enable);
00223 virtual bool getAddIfNotPresent();
00227 skString m_ScriptLocation;
00232 skExecutableIterator * createIterator(const skString& qualifier);
00236 skExecutableIterator * createIterator();
00237 private:
00241 DOM_Element m_Element;
00245 skMethodTable * m_MethodCache;
00249 skXMLElementObject(const skXMLElementObject&);
00253 skXMLElementObject& operator=(const skXMLElementObject&);
00258 bool m_AddIfNotPresent;
00259
00260 };
00261
00262 #endif