File indexing completed on 2024-06-23 04:03:40

0001 /*
0002  * Copyright (C) 2006  Remko Troncon
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Lesser General Public
0006  * License as published by the Free Software Foundation; either
0007  * either version 2
0008    of the License, or (at your option) any later version.1 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Lesser General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Lesser General Public
0016  * License along with this library; if not, write to the Free Software
0017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
0018  *
0019  */
0020 
0021 #ifndef XMPP_ADDRESS_H
0022 #define XMPP_ADDRESS_H
0023 
0024 #include <QString>
0025 
0026 #include "xmpp/jid/jid.h"
0027 
0028 class QDomElement;
0029 
0030 namespace XMPP
0031 {
0032     class Address
0033     {
0034     public:
0035         typedef enum { Unknown, To, Cc, Bcc, ReplyTo, ReplyRoom, NoReply, OriginalFrom, OriginalTo } Type;
0036 
0037         Address(Type type = Unknown, const Jid& jid = Jid());
0038         Address(const QDomElement&);
0039 
0040         const Jid& jid() const;
0041         const QString& uri() const;
0042         const QString& node() const;
0043         const QString& desc() const;
0044         bool delivered() const;
0045         Type type() const;
0046         
0047         QDomElement toXml(Stanza&) const;
0048         void fromXml(const QDomElement& t);
0049 
0050         void setJid(const Jid &);
0051         void setUri(const QString &);
0052         void setNode(const QString &);
0053         void setDesc(const QString &);
0054         void setDelivered(bool);
0055         void setType(Type);
0056 
0057     private:
0058         Jid v_jid;
0059         QString v_uri, v_node, v_desc;
0060         bool v_delivered;
0061         Type v_type;
0062     };
0063 
0064     typedef QList<Address> AddressList;
0065 }
0066     
0067 #endif