|
1 /* |
|
2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html." |
|
8 * Initial Contributors: |
|
9 * Nokia Corporation - initial contribution. |
|
10 * Contributors: |
|
11 * |
|
12 * Description: |
|
13 * MSRP Implementation |
|
14 * |
|
15 */ |
|
16 |
|
17 // CLASS HEADER |
|
18 #include "CMSRPMessageBase.h" |
|
19 |
|
20 // EXTERNAL INCLUDES |
|
21 #include <MsrpStrConsts.h> |
|
22 |
|
23 // INTERNAL INCLUDES |
|
24 #include "MsrpCommon.h" |
|
25 #include "CMsrpToPathHeader.h" |
|
26 #include "CMsrpFromPathHeader.h" |
|
27 #include "CMsrpContentTypeHeader.h" |
|
28 #include "CMSRPMessageIdHeader.h" |
|
29 #include "CMsrpByteRangeHeader.h" |
|
30 #include "CMsrpFailureReportHeader.h" |
|
31 #include "CMsrpSuccessReportHeader.h" |
|
32 |
|
33 // ----------------------------------------------------------------------------- |
|
34 // CMSRPMessageBase::CMSRPMessageBase |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 CMSRPMessageBase::CMSRPMessageBase() |
|
38 { |
|
39 } |
|
40 |
|
41 // ----------------------------------------------------------------------------- |
|
42 // CMSRPMessageBase::~CMSRPMessageBase |
|
43 // ----------------------------------------------------------------------------- |
|
44 // |
|
45 EXPORT_C CMSRPMessageBase::~CMSRPMessageBase() |
|
46 { |
|
47 delete iToPath; |
|
48 delete iFromPath; |
|
49 delete iContentType; |
|
50 delete iMessageId; |
|
51 delete iByteRange; |
|
52 delete iFailureReport; |
|
53 delete iSuccessReport; |
|
54 } |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // CMSRPMessageBase::SetToPathHeaderL |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 EXPORT_C void CMSRPMessageBase::SetToPathHeader( CMSRPToPathHeader* aToPath ) |
|
61 { |
|
62 if(iToPath) |
|
63 { |
|
64 delete iToPath; |
|
65 iToPath = NULL; |
|
66 } |
|
67 iToPath = aToPath; |
|
68 } |
|
69 |
|
70 // ----------------------------------------------------------------------------- |
|
71 // CMSRPMessageBase::ToPathHeader |
|
72 // ----------------------------------------------------------------------------- |
|
73 // |
|
74 EXPORT_C const CMSRPToPathHeader* CMSRPMessageBase::ToPathHeader() const |
|
75 { |
|
76 if( iToPath ) |
|
77 { |
|
78 return iToPath; |
|
79 } |
|
80 return NULL; |
|
81 } |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // CMSRPMessageBase::SetFromPathHeaderL |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 EXPORT_C void CMSRPMessageBase::SetFromPathHeader( CMSRPFromPathHeader* aFromPath ) |
|
88 { |
|
89 if(iFromPath) |
|
90 { |
|
91 delete iFromPath; |
|
92 iFromPath = NULL; |
|
93 } |
|
94 iFromPath = aFromPath; |
|
95 } |
|
96 |
|
97 // ----------------------------------------------------------------------------- |
|
98 // CMSRPMessageBase::FromPathHeader |
|
99 // ----------------------------------------------------------------------------- |
|
100 // |
|
101 EXPORT_C const CMSRPFromPathHeader* CMSRPMessageBase::FromPathHeader() const |
|
102 { |
|
103 if( iFromPath ) |
|
104 { |
|
105 return iFromPath; |
|
106 } |
|
107 return NULL; |
|
108 } |
|
109 |
|
110 // ----------------------------------------------------------------------------- |
|
111 // CMSRPMessageBase::SetContentTypeHeaderL |
|
112 // ----------------------------------------------------------------------------- |
|
113 // |
|
114 EXPORT_C void CMSRPMessageBase::SetContentTypeHeader( |
|
115 CMSRPContentTypeHeader* aContentType ) |
|
116 { |
|
117 if(iContentType) |
|
118 { |
|
119 delete iContentType; |
|
120 iContentType = NULL; |
|
121 } |
|
122 iContentType = aContentType; |
|
123 } |
|
124 |
|
125 // ----------------------------------------------------------------------------- |
|
126 // CMSRPMessageBase::ContentTypeHeader |
|
127 // ----------------------------------------------------------------------------- |
|
128 // |
|
129 EXPORT_C const CMSRPContentTypeHeader* CMSRPMessageBase::ContentTypeHeader() const |
|
130 { |
|
131 if( iContentType ) |
|
132 { |
|
133 return iContentType; |
|
134 } |
|
135 return NULL; |
|
136 } |
|
137 |
|
138 // ----------------------------------------------------------------------------- |
|
139 // CMSRPMessageBase::SetFailureReportHeaderL |
|
140 // ----------------------------------------------------------------------------- |
|
141 // |
|
142 EXPORT_C void CMSRPMessageBase::SetFailureReportHeader( |
|
143 CMSRPFailureReportHeader* aFailureReport ) |
|
144 { |
|
145 if(iFailureReport) |
|
146 { |
|
147 delete iFailureReport; |
|
148 iFailureReport = NULL; |
|
149 } |
|
150 iFailureReport = aFailureReport; |
|
151 } |
|
152 |
|
153 // ----------------------------------------------------------------------------- |
|
154 // CMSRPMessageBase::FailureReportHeader |
|
155 // ----------------------------------------------------------------------------- |
|
156 // |
|
157 EXPORT_C const CMSRPFailureReportHeader* CMSRPMessageBase::FailureReportHeader() const |
|
158 { |
|
159 if( iFailureReport ) |
|
160 { |
|
161 return iFailureReport; |
|
162 } |
|
163 return NULL; |
|
164 } |
|
165 |
|
166 // ----------------------------------------------------------------------------- |
|
167 // CMSRPMessageBase::SetSuccessReportHeaderL |
|
168 // ----------------------------------------------------------------------------- |
|
169 // |
|
170 EXPORT_C void CMSRPMessageBase::SetSuccessReportHeader( |
|
171 CMSRPSuccessReportHeader* aSuccessReport ) |
|
172 { |
|
173 if(iSuccessReport) |
|
174 { |
|
175 delete iSuccessReport; |
|
176 iSuccessReport = NULL; |
|
177 } |
|
178 iSuccessReport = aSuccessReport; |
|
179 } |
|
180 |
|
181 // ----------------------------------------------------------------------------- |
|
182 // CMSRPMessageBase::SuccessReportHeader |
|
183 // ----------------------------------------------------------------------------- |
|
184 // |
|
185 EXPORT_C const CMSRPSuccessReportHeader* CMSRPMessageBase::SuccessReportHeader() const |
|
186 { |
|
187 if( iSuccessReport ) |
|
188 { |
|
189 return iSuccessReport; |
|
190 } |
|
191 return NULL; |
|
192 } |
|
193 |
|
194 // ----------------------------------------------------------------------------- |
|
195 // CMSRPMessageBase::SetMessageIdHeaderL |
|
196 // ----------------------------------------------------------------------------- |
|
197 // |
|
198 EXPORT_C void CMSRPMessageBase::SetMessageIdHeader( CMSRPMessageIdHeader* aMessageId ) |
|
199 { |
|
200 if(iMessageId) |
|
201 { |
|
202 delete iMessageId; |
|
203 iMessageId = NULL; |
|
204 } |
|
205 iMessageId = aMessageId; |
|
206 } |
|
207 |
|
208 // ----------------------------------------------------------------------------- |
|
209 // CMSRPMessageBase::MessageIdHeader |
|
210 // ----------------------------------------------------------------------------- |
|
211 // |
|
212 EXPORT_C const CMSRPMessageIdHeader* CMSRPMessageBase::MessageIdHeader() const |
|
213 { |
|
214 if( iMessageId ) |
|
215 { |
|
216 return iMessageId; |
|
217 } |
|
218 return NULL; |
|
219 } |
|
220 |
|
221 // ----------------------------------------------------------------------------- |
|
222 // CMSRPMessageBase::SetByteRangeHeaderL |
|
223 // ----------------------------------------------------------------------------- |
|
224 // |
|
225 EXPORT_C void CMSRPMessageBase::SetByteRangeHeader( CMSRPByteRangeHeader* aByteRange ) |
|
226 { |
|
227 if(iByteRange) |
|
228 { |
|
229 delete iByteRange; |
|
230 iByteRange = NULL; |
|
231 } |
|
232 iByteRange = aByteRange; |
|
233 } |
|
234 |
|
235 // ----------------------------------------------------------------------------- |
|
236 // CMSRPMessageBase::ByteRangeHeader |
|
237 // ----------------------------------------------------------------------------- |
|
238 // |
|
239 EXPORT_C const CMSRPByteRangeHeader* CMSRPMessageBase::ByteRangeHeader() const |
|
240 { |
|
241 if( iByteRange ) |
|
242 { |
|
243 return iByteRange; |
|
244 } |
|
245 return NULL; |
|
246 } |
|
247 |
|
248 // End of File |