#ifndef JEZUK_DOM_SimpleDOM_MUTATIONEVENT_IMPL_H #define JEZUK_DOM_SimpleDOM_MUTATIONEVENT_IMPL_H //////////////////////////// // C++ MutationEvent implementation //////////////////////////// #include #include #include #include //#include namespace Arabica { namespace DOM { namespace Events { //////////////////////////////////////////////////////////////////// template class DocumentImpl; template class MutationEventImpl : virtual public DOM::Events::MutationEvent_impl, public DOM::Events::EventImpl { public: typedef DocumentImpl DocumentImplT; typedef DOM::Node_impl DOMNode_implT; typedef DOM::Text_impl DOMText_implT; typedef DOM::Document_impl DOMDocument_implT; typedef DOM::NamedNodeMap_impl DOMNamedNodeMap_implT; typedef DOM::NodeList_impl DOMNodeList_implT; typedef DOM::Events::Event EventT; typedef DOM::Events::EventImpl EventImplT; typedef DOM::Events::EventTarget EventTargetT; typedef DOM::Events::MutationEventImpl MutationEventImplT; MutationEventImpl() { //std::cout << std::endl << "born " << this << std::endl; } // MutationEventImpl virtual ~MutationEventImpl() { //std::cout << std::endl << "die " << this << std::endl; } virtual DOM::Node getRelatedNode() const { return relatedNode_; } virtual stringT getPrevValue() const { return prevValue_; } virtual stringT getNextValue() const { return nextValue_; } virtual stringT getAttrName() const { return attrName_; } virtual typename MutationEvent::AttrChange getAttrChange() const { return attrChange_; } virtual void initMutationEvent(const stringT& typeArg, bool canBubble, bool canCancel, DOM::Node relatedNode, const stringT& prevValueArg, const stringT& nextValueArg, const stringT& attrNameArg, typename MutationEvent::AttrChange attrChangeArg) { EventImplT::type_ = typeArg; EventImplT::canBubble_ = canBubble; EventImplT::canCancel_ = canCancel; relatedNode_ = relatedNode; prevValue_ = prevValueArg; nextValue_ = nextValueArg; attrName_ = attrNameArg; attrChange_ = attrChangeArg; } /////////////////////////////////////////////////////// // Ref counting virtual void addRef() {}; virtual void releaseRef() {}; protected: DOM::Node relatedNode_; stringT prevValue_; stringT nextValue_; stringT attrName_; typename MutationEvent::AttrChange attrChange_; }; // class MutationEventImpl } // namespace DOM } // namespace Events } // namespace Arabica #endif // JEZUK_DOM_SimpleDOM_EVENTTARGET_H // end of file