/* -*- 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__JABXPCOM_MESSAGE__INCLUDED #define HEADER__JABXPCOM_MESSAGE__INCLUDED #include "jabxpcom-packet.h" #include "jabxpcom.h" #include class Jabber_ConstMessage_Wrapper : public jabIConstMessage, public Jabber_ConstPacket_Wrapper { public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_JABICONSTMESSAGE NS_FORWARD_JABICONSTPACKET(Jabber_ConstPacket_Wrapper::) explicit Jabber_ConstMessage_Wrapper(const jabberoo::Message *message); virtual ~Jabber_ConstMessage_Wrapper(); /* additional members */ void detach(); protected: inline void detach(const jabberoo::Message *message) { message_ = message; Jabber_ConstPacket_Wrapper::detach(message); } private: const jabberoo::Message *message_; bool managed_object_; }; class Jabber_Message_Wrapper : public jabIMessage, public Jabber_ConstMessage_Wrapper { public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_JABIMESSAGE NS_FORWARD_JABICONSTPACKET(Jabber_ConstPacket_Wrapper::) NS_FORWARD_JABICONSTMESSAGE(Jabber_ConstMessage_Wrapper::) Jabber_Message_Wrapper(const char *jid, const char *body, MessageType mtype); virtual ~Jabber_Message_Wrapper(); /* additional members */ private: jabberoo::Message message_; Jabber_Packet_Wrapper packet_wrapper_; }; #endif