/* -*- C++ -*- * Copyright (C) 2001-2003, Christof Meerwald * http://JabXPCOM.sunsite.dk */ /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License * as published by the Free Software Foundation; version 2 dated June, * 1991. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #ifndef HEADER__JUDOXPCOM_WRAPPER__INCLUDED #define HEADER__JUDOXPCOM_WRAPPER__INCLUDED #include "judoxpcom.h" #include #include class Judo_Node_Wrapper : public judoINode { public: NS_DECL_ISUPPORTS NS_DECL_JUDOINODE explicit Judo_Node_Wrapper(const judo::Node *node); virtual ~Judo_Node_Wrapper(); /* additional members */ protected: inline void detach(const judo::Node *node) { node_ = node; } private: const judo::Node *node_; }; class Judo_ConstElement_Wrapper : public judoIConstElement, public Judo_Node_Wrapper { public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_JUDOICONSTELEMENT NS_FORWARD_JUDOINODE(Judo_Node_Wrapper::) explicit Judo_ConstElement_Wrapper(const judo::Element *element); virtual ~Judo_ConstElement_Wrapper(); /* additional members */ void detach(); protected: inline void detach(const judo::Element *element) { element_ = element; Judo_Node_Wrapper::detach(element); } private: const judo::Element *element_; bool managed_object_; }; class Judo_Element_Wrapper : public judoIElement, public Judo_ConstElement_Wrapper { public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_JUDOIELEMENT NS_FORWARD_JUDOINODE(Judo_Node_Wrapper::) NS_FORWARD_JUDOICONSTELEMENT(Judo_ConstElement_Wrapper::) explicit Judo_Element_Wrapper(judo::Element *element); virtual ~Judo_Element_Wrapper(); /* additional members */ void detach(); protected: inline void detach(judo::Element *element) { element_ = element; Judo_ConstElement_Wrapper::detach(element); } private: judo::Element *element_; bool managed_object_; }; #endif