~ubuntu-branches/ubuntu/utopic/psi/utopic

« back to all changes in this revision

Viewing changes to iris/include/xmpp_message.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2009-09-25 17:49:51 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090925174951-lvm7kdap82o8xhn3
Tags: 0.13-1
* Updated to upstream version 0.13
* Set Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2003  Justin Karneges
3
 
 *
4
 
 * This library is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU Lesser General Public
6
 
 * License as published by the Free Software Foundation; either
7
 
 * version 2.1 of the License, or (at your option) any later version.
8
 
 *
9
 
 * This library is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 
 * Lesser General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU Lesser General Public
15
 
 * License along with this library; if not, write to the Free Software
16
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 
 *
18
 
 */
19
 
 
20
 
#ifndef XMPP_MESSAGE_H
21
 
#define XMPP_MESSAGE_H
22
 
 
23
 
#include "xmpp_stanza.h"
24
 
#include "xmpp_url.h"
25
 
#include "xmpp_chatstate.h"
26
 
#include "xmpp_receipts.h"
27
 
#include "xmpp_address.h"
28
 
#include "xmpp_rosterx.h"
29
 
#include "xmpp_muc.h"
30
 
 
31
 
class QString;
32
 
class QDateTime;
33
 
 
34
 
namespace XMPP {
35
 
        class Jid;
36
 
        class PubSubItem;
37
 
        class PubSubRetraction;
38
 
        class HTMLElement;
39
 
        class HttpAuthRequest;
40
 
        class XData;
41
 
 
42
 
        typedef enum { OfflineEvent, DeliveredEvent, DisplayedEvent,
43
 
                        ComposingEvent, CancelEvent } MsgEvent;
44
 
 
45
 
        class Message
46
 
        {
47
 
        public:
48
 
                Message(const Jid &to="");
49
 
                Message(const Message &from);
50
 
                Message & operator=(const Message &from);
51
 
                ~Message();
52
 
 
53
 
                Jid to() const;
54
 
                Jid from() const;
55
 
                QString id() const;
56
 
                QString type() const;
57
 
                QString lang() const;
58
 
                QString subject(const QString &lang="") const;
59
 
                QString body(const QString &lang="") const;
60
 
                QString thread() const;
61
 
                Stanza::Error error() const;
62
 
 
63
 
                void setTo(const Jid &j);
64
 
                void setFrom(const Jid &j);
65
 
                void setId(const QString &s);
66
 
                void setType(const QString &s);
67
 
                void setLang(const QString &s);
68
 
                void setSubject(const QString &s, const QString &lang="");
69
 
                void setBody(const QString &s, const QString &lang="");
70
 
                void setThread(const QString &s, bool send = false);
71
 
                void setError(const Stanza::Error &err);
72
 
 
73
 
                // JEP-0060
74
 
                const QString& pubsubNode() const;
75
 
                const QList<PubSubItem>& pubsubItems() const;
76
 
                const QList<PubSubRetraction>& pubsubRetractions() const;
77
 
 
78
 
                // JEP-0091
79
 
                QDateTime timeStamp() const;
80
 
                void setTimeStamp(const QDateTime &ts, bool send = false);
81
 
 
82
 
                // JEP-0071
83
 
                HTMLElement html(const QString &lang="") const;
84
 
                void setHTML(const HTMLElement &s, const QString &lang="");
85
 
                bool containsHTML() const;
86
 
 
87
 
                // JEP-0066
88
 
                UrlList urlList() const;
89
 
                void urlAdd(const Url &u);
90
 
                void urlsClear();
91
 
                void setUrlList(const UrlList &list);
92
 
 
93
 
                // JEP-0022
94
 
                QString eventId() const;
95
 
                void setEventId(const QString& id);
96
 
                bool containsEvents() const;
97
 
                bool containsEvent(MsgEvent e) const;
98
 
                void addEvent(MsgEvent e);
99
 
 
100
 
                // JEP-0085
101
 
                ChatState chatState() const;
102
 
                void setChatState(ChatState);
103
 
 
104
 
                // XEP-0184
105
 
                MessageReceipt messageReceipt() const;
106
 
                void setMessageReceipt(MessageReceipt);
107
 
 
108
 
                // JEP-0027
109
 
                QString xencrypted() const;
110
 
                void setXEncrypted(const QString &s);
111
 
                
112
 
                // JEP-0033
113
 
                AddressList addresses() const;
114
 
                AddressList findAddresses(Address::Type t) const;
115
 
                void addAddress(const Address &a);
116
 
                void clearAddresses();
117
 
                void setAddresses(const AddressList &list);
118
 
 
119
 
                // JEP-144
120
 
                const RosterExchangeItems& rosterExchangeItems() const;
121
 
                void setRosterExchangeItems(const RosterExchangeItems&);
122
 
 
123
 
                // JEP-172
124
 
                void setNick(const QString&);
125
 
                const QString& nick() const;
126
 
 
127
 
                // JEP-0070
128
 
                void setHttpAuthRequest(const HttpAuthRequest&);
129
 
                HttpAuthRequest httpAuthRequest() const;
130
 
 
131
 
                // JEP-0004
132
 
                void setForm(const XData&);
133
 
                const XData& getForm() const;
134
 
 
135
 
                // JEP-xxxx SXE
136
 
                void setSxe(const QDomElement&);
137
 
                const QDomElement& sxe() const;
138
 
 
139
 
                // MUC
140
 
                void setMUCStatus(int);
141
 
                bool hasMUCStatus() const;
142
 
                int mucStatus() const;
143
 
                void addMUCInvite(const MUCInvite&);
144
 
                const QList<MUCInvite>& mucInvites() const;
145
 
                void setMUCDecline(const MUCDecline&);
146
 
                const MUCDecline& mucDecline() const;
147
 
                const QString& mucPassword() const;
148
 
                void setMUCPassword(const QString&);
149
 
 
150
 
                // Obsolete invitation
151
 
                QString invite() const;
152
 
                void setInvite(const QString &s);
153
 
 
154
 
                // for compatibility.  delete me later
155
 
                bool spooled() const;
156
 
                void setSpooled(bool);
157
 
                bool wasEncrypted() const;
158
 
                void setWasEncrypted(bool);
159
 
 
160
 
                Stanza toStanza(Stream *stream) const;
161
 
                bool fromStanza(const Stanza &s, int tzoffset);
162
 
 
163
 
        private:
164
 
                class Private;
165
 
                Private *d;
166
 
        };
167
 
}
168
 
 
169
 
#endif