/[resiprocate]/branches/b-identity-0505/MessageWaitingContents.hxx
ViewVC logotype

Contents of /branches/b-identity-0505/MessageWaitingContents.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4598 - (show annotations) (download)
Wed May 11 22:53:07 2005 UTC (14 years, 6 months ago) by derek
File size: 5059 byte(s)
set svn:eol-style to LF
1 #if !defined(RESIP_MESSAGEWAITINGCONTENTS_HXX)
2 #define RESIP_MESSAGEWAITINGCONTENTS_HXX
3
4 #include <map>
5
6 #include "resiprocate/Contents.hxx"
7 #include "resiprocate/os/Data.hxx"
8
9 namespace resip
10 {
11
12 const char* skipSipLWS(ParseBuffer& pb);
13
14 typedef enum {mw_voice=0, mw_fax, mw_pager, mw_multimedia, mw_text, mw_none, MW_MAX} HeaderType;
15
16 class MessageWaitingContents : public Contents
17 {
18 public:
19 MessageWaitingContents();
20 MessageWaitingContents(HeaderFieldValue* hfv, const Mime& contentType);
21 MessageWaitingContents(const Data& data, const Mime& contentType);
22 MessageWaitingContents(const MessageWaitingContents& rhs);
23 ~MessageWaitingContents();
24 MessageWaitingContents& operator=(const MessageWaitingContents& rhs);
25
26 virtual Contents* clone() const;
27
28 static const Mime& getStaticType() ;
29
30 virtual std::ostream& encodeParsed(std::ostream& str) const;
31 virtual void parse(ParseBuffer& pb);
32
33 class Header;
34
35 Header& header(HeaderType ht) const;
36 bool exists(HeaderType ht) const;
37 void remove(HeaderType ht);
38
39 class AccountHeader {};
40 Uri& header(const AccountHeader& ht) const;
41 bool exists(const AccountHeader& ht) const;
42 void remove(const AccountHeader& ht);
43
44 Data& header(const Data& hn) const;
45 bool exists(const Data& hn) const;
46 void remove(const Data& hn);
47
48 bool& hasMessages() { return mHasMessages; }
49
50 class Header
51 {
52 public:
53 Header(unsigned int numNew,
54 unsigned int numOld);
55
56 Header(unsigned int numNew,
57 unsigned int numOld,
58 unsigned int numUrgentNew,
59 unsigned int numUrgentOld);
60
61 unsigned int& newCount() const {return mNew;}
62 unsigned int& oldCount() const {return mOld;}
63 bool& urgent() const {return mHasUrgent;}
64 unsigned int& urgentNewCount() const {return mUrgentNew;}
65 unsigned int& urgentOldCount() const {return mUrgentOld;}
66
67 private:
68 mutable unsigned int mNew;
69 mutable unsigned int mOld;
70 mutable bool mHasUrgent;
71 mutable unsigned int mUrgentNew;
72 mutable unsigned int mUrgentOld;
73
74 friend class MessageWaitingContents;
75 };
76
77 static bool init();
78 private:
79 void clear();
80
81 bool mHasMessages;
82 Uri* mAccountUri;
83 Header* mHeaders[MW_MAX];
84
85 mutable std::map<Data, Data> mExtensions;
86 };
87
88 extern MessageWaitingContents::AccountHeader mw_account;
89 static bool invokeMessageWaitingContentsInit = MessageWaitingContents::init();
90
91 }
92
93 #endif
94
95 /* ====================================================================
96 * The Vovida Software License, Version 1.0
97 *
98 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
99 *
100 * Redistribution and use in source and binary forms, with or without
101 * modification, are permitted provided that the following conditions
102 * are met:
103 *
104 * 1. Redistributions of source code must retain the above copyright
105 * notice, this std::list of conditions and the following disclaimer.
106 *
107 * 2. Redistributions in binary form must reproduce the above copyright
108 * notice, this std::list of conditions and the following disclaimer in
109 * the documentation and/or other materials provided with the
110 * distribution.
111 *
112 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
113 * and "Vovida Open Communication Application Library (VOCAL)" must
114 * not be used to endorse or promote products derived from this
115 * software without prior written permission. For written
116 * permission, please contact vocal@vovida.org.
117 *
118 * 4. Products derived from this software may not be called "VOCAL", nor
119 * may "VOCAL" appear in their name, without prior written
120 * permission of Vovida Networks, Inc.
121 *
122 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
123 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
124 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
125 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
126 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
127 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
128 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
129 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
130 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
131 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
132 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
133 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
134 * DAMAGE.
135 *
136 * ====================================================================
137 *
138 * This software consists of voluntary contributions made by Vovida
139 * Networks, Inc. and many individuals on behalf of Vovida Networks,
140 * Inc. For more information on Vovida Networks, Inc., please see
141 * <http://www.vovida.org/>.
142 *
143 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27