#ifndef HTML_OBJECTIMPL_H
#define HTML_OBJECTIMPL_H
#include "html_imageimpl.h"
#include "xml/dom_stringimpl.h"
#include "java/kjavaappletcontext.h"
#include <qstringlist.h>
#if APPLE_CHANGES
#include <JavaScriptCore/runtime.h>
#endif
class KHTMLView;
namespace DOM {
class HTMLFormElementImpl;
class DOMStringImpl;
class HTMLAppletElementImpl : public HTMLElementImpl
{
public:
HTMLAppletElementImpl(DocumentImpl *doc);
~HTMLAppletElementImpl();
virtual Id id() const;
virtual bool mapToEntry(NodeImpl::Id attr, MappedAttributeEntry& result) const;
virtual void parseHTMLAttribute(HTMLAttributeImpl *token);
virtual bool rendererIsNeeded(khtml::RenderStyle *);
virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
virtual void closeRenderer();
virtual void detach();
bool getMember(const QString &, JType &, QString &);
bool callMember(const QString &, const QStringList &, JType &, QString &);
#if APPLE_CHANGES
virtual bool allParamsAvailable();
void setupApplet() const;
KJS::Bindings::Instance *getAppletInstance() const;
#endif
protected:
khtml::VAlign valign;
private:
#if APPLE_CHANGES
mutable SharedPtr<KJS::Bindings::Instance> m_appletInstance;
bool m_allParamsAvailable;
#endif
};
class HTMLEmbedElementImpl : public HTMLElementImpl
{
public:
HTMLEmbedElementImpl(DocumentImpl *doc);
~HTMLEmbedElementImpl();
virtual Id id() const;
virtual bool mapToEntry(NodeImpl::Id attr, MappedAttributeEntry& result) const;
virtual void parseHTMLAttribute(HTMLAttributeImpl *attr);
virtual void attach();
virtual void detach();
virtual bool rendererIsNeeded(khtml::RenderStyle *);
virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
virtual bool isURLAttribute(AttributeImpl *attr) const;
#if APPLE_CHANGES
KJS::Bindings::Instance *getEmbedInstance() const;
#endif
QString url;
QString pluginPage;
QString serviceType;
#if APPLE_CHANGES
private:
mutable SharedPtr<KJS::Bindings::Instance> m_embedInstance;
#endif
};
class HTMLObjectElementImpl : public HTMLElementImpl
{
public:
HTMLObjectElementImpl(DocumentImpl *doc);
~HTMLObjectElementImpl();
virtual Id id() const;
HTMLFormElementImpl *form() const;
virtual bool mapToEntry(NodeImpl::Id attr, MappedAttributeEntry& result) const;
virtual void parseHTMLAttribute(HTMLAttributeImpl *token);
virtual void attach();
virtual bool rendererIsNeeded(khtml::RenderStyle *);
virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
virtual void closeRenderer();
virtual void detach();
virtual void recalcStyle(StyleChange ch);
virtual void childrenChanged();
bool isComplete() const { return m_complete; }
void setComplete(bool complete);
DocumentImpl* contentDocument() const;
virtual bool isURLAttribute(AttributeImpl *attr) const;
bool isImageType();
void renderFallbackContent();
#if APPLE_CHANGES
KJS::Bindings::Instance *getObjectInstance() const;
#endif
QString serviceType;
QString url;
QString classId;
bool needWidgetUpdate : 1;
bool m_useFallbackContent : 1;
HTMLImageLoader* m_imageLoader;
#if APPLE_CHANGES
private:
mutable SharedPtr<KJS::Bindings::Instance> m_objectInstance;
#endif
bool m_complete;
};
class HTMLParamElementImpl : public HTMLElementImpl
{
friend class HTMLAppletElementImpl;
public:
HTMLParamElementImpl(DocumentImpl *doc);
~HTMLParamElementImpl();
virtual Id id() const;
virtual void parseHTMLAttribute(HTMLAttributeImpl *token);
QString name() const { return m_name.string(); }
QString value() const { return m_value.string(); }
virtual bool isURLAttribute(AttributeImpl *attr) const;
protected:
AtomicString m_name;
AtomicString m_value;
};
};
#endif