#import <WebCore/DOM.h>
namespace DOM {
class CSSStyleDeclarationImpl;
class CSSStyleSheetImpl;
class DocumentFragmentImpl;
class DocumentImpl;
class ElementImpl;
class NodeFilterImpl;
class NodeImpl;
class NodeIteratorImpl;
class NodeListImpl;
class RangeImpl;
class StyleSheetListImpl;
class TreeWalkerImpl;
}
@interface DOMNode (WebCoreInternal)
+ (DOMNode *)_nodeWithImpl:(DOM::NodeImpl *)impl;
- (DOM::NodeImpl *)_nodeImpl;
@end
@interface DOMNodeList (WebCoreInternal)
+ (DOMNodeList *)_nodeListWithImpl:(DOM::NodeListImpl *)impl;
@end
@interface DOMElement (WebCoreInternal)
+ (DOMElement *)_elementWithImpl:(DOM::ElementImpl *)impl;
- (DOM::ElementImpl *)_elementImpl;
@end
@interface DOMDocument (WebCoreInternal)
+ (DOMDocument *)_documentWithImpl:(DOM::DocumentImpl *)impl;
- (DOM::DocumentImpl *)_documentImpl;
- (DOMElement *)_ownerElement;
@end
@interface DOMDocumentFragment (WebCoreInternal)
+ (DOMDocumentFragment *)_documentFragmentWithImpl:(DOM::DocumentFragmentImpl *)impl;
- (DOM::DocumentFragmentImpl *)_fragmentImpl;
@end
@interface DOMRange (WebCoreInternal)
+ (DOMRange *)_rangeWithImpl:(DOM::RangeImpl *)impl;
- (DOM::RangeImpl *)_rangeImpl;
@end
@interface DOMNodeIterator (WebCoreInternal)
+ (DOMNodeIterator *)_nodeIteratorWithImpl:(DOM::NodeIteratorImpl *)impl filter:(id <DOMNodeFilter>)filter;
@end
@interface DOMTreeWalker (WebCoreInternal)
+ (DOMTreeWalker *)_treeWalkerWithImpl:(DOM::TreeWalkerImpl *)impl filter:(id <DOMNodeFilter>)filter;
@end
@interface DOMObject (WebCoreInternal)
- (id)_init;
@end
@interface DOMCSSStyleDeclaration (WebCoreInternal)
+ (DOMCSSStyleDeclaration *)_styleDeclarationWithImpl:(DOM::CSSStyleDeclarationImpl *)impl;
- (DOM::CSSStyleDeclarationImpl *)_styleDeclarationImpl;
@end
@interface DOMStyleSheetList (WebCoreInternal)
+ (DOMStyleSheetList *)_styleSheetListWithImpl:(DOM::StyleSheetListImpl *)impl;
@end
@interface DOMCSSStyleSheet (WebCoreInternal)
+ (DOMCSSStyleSheet *)_CSSStyleSheetWithImpl:(DOM::CSSStyleSheetImpl *)impl;
@end
@interface DOMNodeFilter : DOMObject <DOMNodeFilter>
+ (DOMNodeFilter *)_nodeFilterWithImpl:(DOM::NodeFilterImpl *)impl;
@end
template <class Target, class Source> Target DOM_cast(Source) { Source::failToCompile(); }
id getDOMWrapperImpl(DOMObjectInternal *impl);
void addDOMWrapperImpl(id wrapper, DOMObjectInternal *impl);
template <class Source> inline id getDOMWrapper(Source impl) { return getDOMWrapperImpl(DOM_cast<DOMObjectInternal *>(impl)); }
template <class Source> inline void addDOMWrapper(NSObject * wrapper, Source impl) { addDOMWrapperImpl(wrapper, DOM_cast<DOMObjectInternal *>(impl)); }
void removeDOMWrapper(DOMObjectInternal *impl);
void raiseDOMException(int code);
inline void raiseOnDOMError(int code)
{
if (code)
raiseDOMException(code);
}
#define ALLOW_DOM_CAST(type) \
namespace DOM { class type; } \
template <> inline DOMObjectInternal *DOM_cast<DOMObjectInternal *, DOM::type *>(DOM::type *p) \
{ return reinterpret_cast<DOMObjectInternal *>(p); } \
template <> inline DOM::type *DOM_cast<DOM::type *, DOMObjectInternal *>(DOMObjectInternal *p) \
{ return reinterpret_cast<DOM::type *>(p); }
ALLOW_DOM_CAST(CounterImpl)
ALLOW_DOM_CAST(CSSRuleImpl)
ALLOW_DOM_CAST(CSSRuleListImpl)
ALLOW_DOM_CAST(CSSStyleDeclarationImpl)
ALLOW_DOM_CAST(CSSStyleSheetImpl)
ALLOW_DOM_CAST(CSSValueImpl)
ALLOW_DOM_CAST(DOMImplementationImpl)
ALLOW_DOM_CAST(HTMLCollectionImpl)
ALLOW_DOM_CAST(HTMLOptionsCollectionImpl)
ALLOW_DOM_CAST(MediaListImpl)
ALLOW_DOM_CAST(NamedNodeMapImpl)
ALLOW_DOM_CAST(NodeFilterImpl)
ALLOW_DOM_CAST(NodeImpl)
ALLOW_DOM_CAST(NodeIteratorImpl)
ALLOW_DOM_CAST(NodeListImpl)
ALLOW_DOM_CAST(RangeImpl)
ALLOW_DOM_CAST(RectImpl)
ALLOW_DOM_CAST(StyleSheetImpl)
ALLOW_DOM_CAST(StyleSheetListImpl)
ALLOW_DOM_CAST(TreeWalkerImpl)