reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
MessageWaitingContents.hxx
Go to the documentation of this file.
1#if !defined(RESIP_MESSAGEWAITINGCONTENTS_HXX)
2#define RESIP_MESSAGEWAITINGCONTENTS_HXX
3
4#include <map>
5
7#include "rutil/Data.hxx"
8
9namespace resip
10{
11
12const char* skipSipLWS(ParseBuffer& pb);
13
19
27{
28 public:
30 MessageWaitingContents(const HeaderFieldValue& hfv, const Mime& contentType);
31 MessageWaitingContents(const Data& data, const Mime& contentType);
35
39 virtual Contents* clone() const;
40
41 static const Mime& getStaticType() ;
42
43 virtual EncodeStream& encodeParsed(EncodeStream& str) const;
44 virtual void parse(ParseBuffer& pb);
45
46 class Header;
47
53 const Header& header(HeaderType ht) const;
54
59 bool exists(HeaderType ht) const;
60
64 void remove(HeaderType ht);
65
77 class AccountHeader {};
78
83 const Uri& header(const AccountHeader& ht) const;
84 Uri& header(const AccountHeader& ht);
85
95 bool exists(const AccountHeader& ht) const;
96
100 void remove(const AccountHeader& ht);
101
109 const Data& header(const Data& hn) const;
110 Data& header(const Data& hn);
111
116 bool exists(const Data& hn) const;
117
121 void remove(const Data& hn);
122
126 bool& hasMessages() { checkParsed(); return mHasMessages; }
127
130 class Header
131 {
132 public:
138 Header(unsigned int numNew,
139 unsigned int numOld);
140
148 Header(unsigned int numNew,
149 unsigned int numOld,
150 unsigned int numUrgentNew,
151 unsigned int numUrgentOld);
152
156 const unsigned int& newCount() const {return mNew;}
157
161 unsigned int& newCount() {return mNew;}
162
166 const unsigned int& oldCount() const {return mOld;}
167
171 unsigned int& oldCount() {return mOld;}
172
177 const bool& urgent() const {return mHasUrgent;}
178
183 bool& urgent() {return mHasUrgent;}
184
188 const unsigned int& urgentNewCount() const {return mUrgentNew;}
189
193 unsigned int& urgentNewCount() {return mUrgentNew;}
194
198 const unsigned int& urgentOldCount() const {return mUrgentOld;}
199
203 unsigned int& urgentOldCount() {return mUrgentOld;}
204
205 private:
206 unsigned int mNew;
207 unsigned int mOld;
208 bool mHasUrgent;
209 unsigned int mUrgentNew;
210 unsigned int mUrgentOld;
211
213 };
214
215 static bool init();
216 private:
217 void clear();
218
219 bool mHasMessages;
220 Uri* mAccountUri;
221 Header* mHeaders[MW_MAX];
222 std::map<Data, Data> mExtensions;
223};
224
229
230}
231
232#endif
233
234/* ====================================================================
235 * The Vovida Software License, Version 1.0
236 *
237 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
238 *
239 * Redistribution and use in source and binary forms, with or without
240 * modification, are permitted provided that the following conditions
241 * are met:
242 *
243 * 1. Redistributions of source code must retain the above copyright
244 * notice, this list of conditions and the following disclaimer.
245 *
246 * 2. Redistributions in binary form must reproduce the above copyright
247 * notice, this list of conditions and the following disclaimer in
248 * the documentation and/or other materials provided with the
249 * distribution.
250 *
251 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
252 * and "Vovida Open Communication Application Library (VOCAL)" must
253 * not be used to endorse or promote products derived from this
254 * software without prior written permission. For written
255 * permission, please contact vocal@vovida.org.
256 *
257 * 4. Products derived from this software may not be called "VOCAL", nor
258 * may "VOCAL" appear in their name, without prior written
259 * permission of Vovida Networks, Inc.
260 *
261 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
262 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
263 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
264 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
265 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
266 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
267 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
268 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
269 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
270 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
271 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
272 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
273 * DAMAGE.
274 *
275 * ====================================================================
276 *
277 * This software consists of voluntary contributions made by Vovida
278 * Networks, Inc. and many individuals on behalf of Vovida Networks,
279 * Inc. For more information on Vovida Networks, Inc., please see
280 * <http://www.vovida.org/>.
281 *
282 */
Base class for all SIP body types.
Definition Contents.hxx:51
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
void checkParsed() const
makes accessing the MessageAccount Uri operate like accessing the other MessageWaiting headers.
Provides an interface for reading and modifying MessageWaiting bodies.
bool & urgent()
Return bool indicating that there are urgent messages.
const unsigned int & urgentNewCount() const
Return new urgent message count.
unsigned int & urgentOldCount()
Return new message count.
const unsigned int & newCount() const
Return new message count.
unsigned int & newCount()
Return new message count.
const unsigned int & oldCount() const
Return old message count.
unsigned int & oldCount()
Return old message count.
const bool & urgent() const
Return bool indicating that there are urgent messages.
const unsigned int & urgentOldCount() const
Return new message count.
unsigned int & urgentNewCount()
Return new urgent message count.
SIP body type for holding MWI contents (MIME content-type application/simple-message-summary).
virtual EncodeStream & encodeParsed(EncodeStream &str) const
bool exists(HeaderType ht) const
Check if HeaderType is present.
virtual Contents * clone() const
duplicate an MessageWaitingContents object
bool & hasMessages()
Check to see if there are messages.
Header & header(HeaderType ht)
Get the header correspoding to ht.
void remove(HeaderType ht)
Remove the header correspoding to ht.
virtual void parse(ParseBuffer &pb)
MessageWaitingContents & operator=(const MessageWaitingContents &rhs)
Represents the "media-type" element in the RFC 3261 grammar.
Definition Mime.hxx:20
Provides string-parsing functionality with protection from buffer overflow.
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
dcm! – add UnusedChecking(_enum) below;
static bool invokeMessageWaitingContentsInit
MessageWaitingContents::AccountHeader mw_account
Used to access the Message-Account header in MessageWaiting docs.
const char * skipSipLWS(ParseBuffer &pb)
HeaderType
An enumeration of MessageWaiting header types for use with resip::MessageWaitingContents.
#define EncodeStream
void list()
Definition userAdmin.cxx:66