//
//     Copyright 2008 Jim Bublitz <jbublitz@nwinternet.com>
//     Earlier copyrights 1998 - 2007 Jim Bublitz also apply

//                 Generated by twine

// This file is part of PyKDE4.

// PyKDE4 is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.

// PyKDE4 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.


%ModuleHeaderCode
//ctscc
#include <dom_doc.h>
#include <dom_element.h>
#include <dom_text.h>
#include <dom_xml.h>
#include <html_base.h>
#include <html_block.h>
#include <html_document.h>
#include <html_element.h>
#include <html_form.h>
#include <html_head.h>
#include <html_image.h>
#include <html_inline.h>
#include <html_list.h>
#include <html_misc.h>
#include <html_object.h>
#include <html_table.h>
%End

namespace DOM
{

class Attr : DOM::Node
{
%TypeHeaderCode
#include <dom_element.h>
%End


public:
                            Attr ();
                            Attr (const DOM::Node& other);
                            Attr (const DOM::Attr& other);
    DOM::DOMString          name () const;
    bool                    specified () const;
    DOM::DOMString          value () const;
    void                    setValue (const DOM::DOMString&);
    DOM::Element            ownerElement () const;

protected:
//ig                        Attr (AttrImpl* _impl);

public:

//  Subclasses of DOM::Node

%ConvertToSubClassCode

    sipClass = NULL;

    if (dynamic_cast<DOM::Attr*>(sipCpp))
        sipClass = sipClass_DOM_Attr;
    else if (dynamic_cast<DOM::CharacterData*>(sipCpp))
        {
            sipClass = sipClass_DOM_CharacterData;
            if (dynamic_cast<DOM::Comment*>(sipCpp))
                sipClass = sipClass_DOM_Comment;
            else if (dynamic_cast<DOM::Text*>(sipCpp))
                {
                    sipClass = sipClass_DOM_Text;
                    if (dynamic_cast<DOM::CDATASection*>(sipCpp))
                        sipClass = sipClass_DOM_CDATASection;
                }
        }
    else if (dynamic_cast<DOM::Document*>(sipCpp))
        {
            sipClass = sipClass_DOM_Document;
            if (dynamic_cast<DOM::HTMLDocument*>(sipCpp))
                sipClass = sipClass_DOM_HTMLDocument;
        }
    else if (dynamic_cast<DOM::DocumentFragment*>(sipCpp))
        sipClass = sipClass_DOM_DocumentFragment;
    else if (dynamic_cast<DOM::DocumentType*>(sipCpp))
        sipClass = sipClass_DOM_DocumentType;
    else if (dynamic_cast<DOM::Element*>(sipCpp))
        {
            sipClass = sipClass_DOM_Element;
            if (dynamic_cast<DOM::HTMLElement*>(sipCpp))
                {
                    sipClass = sipClass_DOM_HTMLElement;
                    if (dynamic_cast<DOM::HTMLAnchorElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLAnchorElement;
                    else if (dynamic_cast<DOM::HTMLAppletElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLAppletElement;
                    else if (dynamic_cast<DOM::HTMLAreaElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLAreaElement;
                    else if (dynamic_cast<DOM::HTMLBRElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLBRElement;
                    else if (dynamic_cast<DOM::HTMLBaseElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLBaseElement;
                    else if (dynamic_cast<DOM::HTMLBaseFontElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLBaseFontElement;
                    else if (dynamic_cast<DOM::HTMLBlockquoteElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLBlockquoteElement;
                    else if (dynamic_cast<DOM::HTMLBodyElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLBodyElement;
                    else if (dynamic_cast<DOM::HTMLButtonElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLButtonElement;
                    else if (dynamic_cast<DOM::HTMLDListElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLDListElement;
                    else if (dynamic_cast<DOM::HTMLDirectoryElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLDirectoryElement;
                    else if (dynamic_cast<DOM::HTMLDivElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLDivElement;
                    else if (dynamic_cast<DOM::HTMLFieldSetElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLFieldSetElement;
                    else if (dynamic_cast<DOM::HTMLFontElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLFontElement;
                    else if (dynamic_cast<DOM::HTMLFormElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLFormElement;
                    else if (dynamic_cast<DOM::HTMLFrameElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLFrameElement;
                    else if (dynamic_cast<DOM::HTMLFrameSetElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLFrameSetElement;
                    else if (dynamic_cast<DOM::HTMLHRElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLHRElement;
                    else if (dynamic_cast<DOM::HTMLHeadElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLHeadElement;
                    else if (dynamic_cast<DOM::HTMLHeadingElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLHeadingElement;
                    else if (dynamic_cast<DOM::HTMLHtmlElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLHtmlElement;
                    else if (dynamic_cast<DOM::HTMLIFrameElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLIFrameElement;
                    else if (dynamic_cast<DOM::HTMLImageElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLImageElement;
                    else if (dynamic_cast<DOM::HTMLInputElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLInputElement;
                    else if (dynamic_cast<DOM::HTMLIsIndexElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLIsIndexElement;
                    else if (dynamic_cast<DOM::HTMLLIElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLLIElement;
                    else if (dynamic_cast<DOM::HTMLLabelElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLLabelElement;
                    else if (dynamic_cast<DOM::HTMLLayerElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLLayerElement;
                    else if (dynamic_cast<DOM::HTMLLegendElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLLegendElement;
                    else if (dynamic_cast<DOM::HTMLLinkElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLLinkElement;
                    else if (dynamic_cast<DOM::HTMLMapElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLMapElement;
                    else if (dynamic_cast<DOM::HTMLMenuElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLMenuElement;
                    else if (dynamic_cast<DOM::HTMLMetaElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLMetaElement;
                    else if (dynamic_cast<DOM::HTMLModElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLModElement;
                    else if (dynamic_cast<DOM::HTMLOListElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLOListElement;
                    else if (dynamic_cast<DOM::HTMLObjectElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLObjectElement;
                    else if (dynamic_cast<DOM::HTMLOptGroupElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLOptGroupElement;
                    else if (dynamic_cast<DOM::HTMLOptionElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLOptionElement;
                    else if (dynamic_cast<DOM::HTMLParagraphElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLParagraphElement;
                    else if (dynamic_cast<DOM::HTMLParamElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLParamElement;
                    else if (dynamic_cast<DOM::HTMLPreElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLPreElement;
                    else if (dynamic_cast<DOM::HTMLQuoteElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLQuoteElement;
                    else if (dynamic_cast<DOM::HTMLScriptElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLScriptElement;
                    else if (dynamic_cast<DOM::HTMLSelectElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLSelectElement;
                    else if (dynamic_cast<DOM::HTMLStyleElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLStyleElement;
                    else if (dynamic_cast<DOM::HTMLTableCaptionElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLTableCaptionElement;
                    else if (dynamic_cast<DOM::HTMLTableCellElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLTableCellElement;
                    else if (dynamic_cast<DOM::HTMLTableColElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLTableColElement;
                    else if (dynamic_cast<DOM::HTMLTableElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLTableElement;
                    else if (dynamic_cast<DOM::HTMLTableRowElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLTableRowElement;
                    else if (dynamic_cast<DOM::HTMLTableSectionElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLTableSectionElement;
                    else if (dynamic_cast<DOM::HTMLTextAreaElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLTextAreaElement;
                    else if (dynamic_cast<DOM::HTMLTitleElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLTitleElement;
                    else if (dynamic_cast<DOM::HTMLUListElement*>(sipCpp))
                        sipClass = sipClass_DOM_HTMLUListElement;
                }
        }
    else if (dynamic_cast<DOM::Entity*>(sipCpp))
        sipClass = sipClass_DOM_Entity;
    else if (dynamic_cast<DOM::EntityReference*>(sipCpp))
        sipClass = sipClass_DOM_EntityReference;
    else if (dynamic_cast<DOM::Notation*>(sipCpp))
        sipClass = sipClass_DOM_Notation;
    else if (dynamic_cast<DOM::ProcessingInstruction*>(sipCpp))
        sipClass = sipClass_DOM_ProcessingInstruction;
%End

};   // Attr


class Element : DOM::Node
{
%TypeHeaderCode
#include <dom_element.h>
%End


public:
                            Element ();
                            Element (const DOM::Node& other);
                            Element (const DOM::Element& other);
    DOM::DOMString          tagName () const;
    DOM::DOMString          getAttribute (const DOM::DOMString& name);
    void                    setAttribute (const DOM::DOMString& name, const DOM::DOMString& value);
    void                    removeAttribute (const DOM::DOMString& name);
    DOM::Attr               getAttributeNode (const DOM::DOMString& name);
    DOM::Attr               setAttributeNode (const DOM::Attr& newAttr);
    DOM::Attr               removeAttributeNode (const DOM::Attr& oldAttr);
    DOM::NodeList           getElementsByTagName (const DOM::DOMString& name);
    DOM::NodeList           getElementsByTagNameNS (const DOM::DOMString& namespaceURI, const DOM::DOMString& localName);
    DOM::NodeList           getElementsByClassName (const DOM::DOMString& className);
    DOM::DOMString          getAttributeNS (const DOM::DOMString& namespaceURI, const DOM::DOMString& localName);
    void                    setAttributeNS (const DOM::DOMString& namespaceURI, const DOM::DOMString& qualifiedName, const DOM::DOMString& value);
    void                    removeAttributeNS (const DOM::DOMString& namespaceURI, const DOM::DOMString& localName);
    DOM::Attr               getAttributeNodeNS (const DOM::DOMString& namespaceURI, const DOM::DOMString& localName);
    DOM::Attr               setAttributeNodeNS (const DOM::Attr& newAttr);
    bool                    hasAttribute (const DOM::DOMString& name);
    bool                    hasAttributeNS (const DOM::DOMString& namespaceURI, const DOM::DOMString& localName);
    DOM::CSSStyleDeclaration  style ();
    DOM::Element            firstElementChild () const;
    DOM::Element            lastElementChild () const;
    DOM::Element            previousElementSibling () const;
    DOM::Element            nextElementSibling () const;
    unsigned long           childElementCount () const;
// FIXME no implementation???
//ig    bool                    contentEditable () const;
// FIXME no implementation???
//ig    void                    setContentEditable (bool enabled);
    bool                    isHTMLElement () const;
    DOM::Element            form () const;
    static bool             khtmlValidAttrName (const DOM::DOMString& name);
    static bool             khtmlValidPrefix (const DOM::DOMString& name);
    static bool             khtmlValidQualifiedName (const DOM::DOMString& name);
    static bool             khtmlMalformedQualifiedName (const DOM::DOMString& name);
    static bool             khtmlMalformedPrefix (const DOM::DOMString& name);

protected:
//ig                        Element (ElementImpl* _impl);
};   // Element

};   // DOM


