1 gsmumsg.inl |
1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 |
|
22 Gets the SMS-XXX message type. |
|
23 |
|
24 @return SMS-XXX message type |
|
25 |
|
26 */ |
|
27 inline CSmsPDU::TSmsPDUType CSmsMessage::Type() const |
|
28 { |
|
29 return iSmsPDU->Type(); |
|
30 } |
|
31 |
|
32 |
|
33 /** |
|
34 * Tests if the SMS message is complete. |
|
35 * |
|
36 * @return True if complete |
|
37 */ |
|
38 inline TBool CSmsMessage::IsComplete() const |
|
39 { |
|
40 return iFlags&ESmsFlagIsComplete; |
|
41 } |
|
42 |
|
43 |
|
44 /** |
|
45 * Tests if the SMS message is Decoded. |
|
46 * |
|
47 * @return True if Decoded |
|
48 */ |
|
49 inline TBool CSmsMessage::IsDecoded() const |
|
50 { |
|
51 return iFlags&ESmsFlagIsDecoded; |
|
52 } |
|
53 |
|
54 |
|
55 /** |
|
56 * Gets the physical location where the message represented by the object is stored. |
|
57 * |
|
58 * @return Physical location |
|
59 */ |
|
60 inline CSmsMessage::TMobileSmsStorage CSmsMessage::Storage() const |
|
61 { |
|
62 return (TMobileSmsStorage) (iFlags&ESmsStorageMask); |
|
63 } |
|
64 |
|
65 |
|
66 /** |
|
67 * Sets the physical location where the message represented by the object is stored. |
|
68 * |
|
69 * @param aStorage Physical location |
|
70 */ |
|
71 inline void CSmsMessage::SetStorage(TMobileSmsStorage aStorage) |
|
72 { |
|
73 iFlags=aStorage|(iFlags&(~ESmsStorageMask)); |
|
74 } |
|
75 |
|
76 |
|
77 /** |
|
78 * Gets the SMS store status of the message. |
|
79 * |
|
80 * @return SMS store status |
|
81 */ |
|
82 inline NMobileSmsStore::TMobileSmsStoreStatus CSmsMessage::Status() const |
|
83 { |
|
84 return iStatus; |
|
85 } |
|
86 |
|
87 |
|
88 /** |
|
89 * Sets the SMS store status of the message. |
|
90 * |
|
91 * @param aStatus SMS store status |
|
92 */ |
|
93 inline void CSmsMessage::SetStatus(NMobileSmsStore::TMobileSmsStoreStatus aStatus) |
|
94 { |
|
95 iStatus=aStatus; |
|
96 } |
|
97 |
|
98 |
|
99 /** |
|
100 * Gets the Log Server Id. |
|
101 * |
|
102 * @return Log Server Id |
|
103 */ |
|
104 inline TInt CSmsMessage::LogServerId() const |
|
105 { |
|
106 return iLogServerId; |
|
107 } |
|
108 |
|
109 |
|
110 /** |
|
111 * Sets the Log Server Id. |
|
112 * |
|
113 * @param aId Log Server Id |
|
114 */ |
|
115 inline void CSmsMessage::SetLogServerId(TInt aId) |
|
116 { |
|
117 iLogServerId=aId; |
|
118 } |
|
119 |
|
120 |
|
121 /** |
|
122 * Gets the time of message creation. |
|
123 * |
|
124 * @return Time of message creation |
|
125 */ |
|
126 inline const TTime& CSmsMessage::Time() const |
|
127 { |
|
128 return iTime; |
|
129 } |
|
130 |
|
131 |
|
132 /** |
|
133 * Sets the time of message creation. |
|
134 * |
|
135 * @param aTime Time of message creation |
|
136 */ |
|
137 inline void CSmsMessage::SetTime(const TTime& aTime) |
|
138 { |
|
139 iTime=aTime; |
|
140 } |
|
141 |
|
142 |
|
143 /** |
|
144 * Gets the message PDU. |
|
145 * |
|
146 * @return PDU. |
|
147 */ |
|
148 inline CSmsPDU& CSmsMessage::SmsPDU() |
|
149 { |
|
150 return *iSmsPDU; |
|
151 } |
|
152 |
|
153 |
|
154 /** |
|
155 * Gets the message PDU (const). |
|
156 * |
|
157 * @return PDU. |
|
158 */ |
|
159 inline const CSmsPDU& CSmsMessage::SmsPDU() const |
|
160 { |
|
161 return *iSmsPDU; |
|
162 } |
|
163 |
|
164 |
|
165 /** |
|
166 * Gets the message Service Center Address. |
|
167 * |
|
168 * @return Service Center Address |
|
169 */ |
|
170 inline TPtrC CSmsMessage::ServiceCenterAddress() const |
|
171 { |
|
172 return iSmsPDU->ServiceCenterAddress(); |
|
173 } |
|
174 |
|
175 |
|
176 /** |
|
177 * Sets the message Service Center Address. |
|
178 * |
|
179 * @param aAddress Service Center Address |
|
180 */ |
|
181 inline void CSmsMessage::SetServiceCenterAddressL(const TDesC& aAddress) |
|
182 { |
|
183 iSmsPDU->SetServiceCenterAddressL(aAddress); |
|
184 } |
|
185 |
|
186 |
|
187 /** |
|
188 * Gets the Service Center Address as an ETSI-formatted telephone number. |
|
189 * |
|
190 * @param aParsedAddress Service Center Address |
|
191 */ |
|
192 inline void CSmsMessage::ParsedServiceCenterAddress(TGsmSmsTelNumber& aParsedAddress) const |
|
193 { |
|
194 iSmsPDU->ParsedServiceCenterAddress(aParsedAddress); |
|
195 } |
|
196 |
|
197 |
|
198 /** |
|
199 * Sets the Service Center Address as an ETSI-formatted telephone number. |
|
200 * |
|
201 * @param aParsedAddress Service Center Address |
|
202 */ |
|
203 inline void CSmsMessage::SetParsedServiceCenterAddressL(const TGsmSmsTelNumber& aParsedAddress) |
|
204 { |
|
205 iSmsPDU->SetParsedServiceCenterAddressL(aParsedAddress); |
|
206 } |
|
207 |
|
208 |
|
209 /** |
|
210 * Gets unparsed To and From addresses. |
|
211 * |
|
212 * @return To and From addresses |
|
213 */ |
|
214 inline TPtrC CSmsMessage::ToFromAddress() const |
|
215 { |
|
216 return iSmsPDU->ToFromAddress(); |
|
217 } |
|
218 |
|
219 |
|
220 /** |
|
221 * Sets unparsed To and From addresses. |
|
222 * |
|
223 * @param aAddress To and From addresses |
|
224 */ |
|
225 inline void CSmsMessage::SetToFromAddressL(const TDesC& aAddress) |
|
226 { |
|
227 iSmsPDU->SetToFromAddressL(aAddress); |
|
228 } |
|
229 |
|
230 |
|
231 /** |
|
232 * Gets To and From addresses in ETSI format. |
|
233 * |
|
234 * @param aParsedAddress To and From addresses |
|
235 */ |
|
236 inline void CSmsMessage::ParsedToFromAddress(TGsmSmsTelNumber& aParsedAddress) const |
|
237 { |
|
238 iSmsPDU->ParsedToFromAddress(aParsedAddress); |
|
239 } |
|
240 |
|
241 |
|
242 /** |
|
243 * Sets To and From addresses in ETSI format. |
|
244 * |
|
245 * @param aParsedAddress To and From addresses |
|
246 */ |
|
247 inline void CSmsMessage::SetParsedToFromAddressL(const TGsmSmsTelNumber& aParsedAddress) |
|
248 { |
|
249 iSmsPDU->SetParsedToFromAddressL(aParsedAddress); |
|
250 } |
|
251 |
|
252 |
|
253 /** |
|
254 * Gets the text portion of the message (non-const). |
|
255 * |
|
256 * @return Text portion of the message |
|
257 */ |
|
258 inline CSmsBufferBase& CSmsMessage::Buffer() |
|
259 { |
|
260 return *iBuffer; |
|
261 } |
|
262 |
|
263 |
|
264 /** |
|
265 * @return The text portion of the CSmsMessage (const) |
|
266 */ |
|
267 inline const CSmsBufferBase& CSmsMessage::Buffer() const |
|
268 { |
|
269 return *iBuffer; |
|
270 } |
|
271 |
|
272 |
|
273 /** |
|
274 * @param aIsComplete Set to True for CSmsMessage complete |
|
275 */ |
|
276 inline void CSmsMessage::SetIsComplete(TBool aIsComplete) |
|
277 { |
|
278 iFlags=aIsComplete? iFlags|ESmsFlagIsComplete: iFlags&(~ESmsFlagIsComplete); |
|
279 } |
|
280 |
|
281 |
|
282 /** |
|
283 * @param aIsDecoded Set to True for CSmsMessage decoded |
|
284 */ |
|
285 inline void CSmsMessage::SetIsDecoded(TBool aIsDecoded) |
|
286 { |
|
287 iFlags=aIsDecoded? iFlags|ESmsFlagIsDecoded: iFlags&(~ESmsFlagIsDecoded); |
|
288 } |
|
289 |
|
290 |
|
291 /** |
|
292 * @return True if the User Data is Binary |
|
293 */ |
|
294 inline TBool CSmsMessage::BinaryData() const |
|
295 { |
|
296 return iSmsPDU->UserData().IsBinaryData(); |
|
297 } |
|
298 |
|
299 |
|
300 inline void CSmsMessage::Set16BitConcatenation(TBool aIs16BitConcatenation) |
|
301 { |
|
302 iIs16BitConcatenation=aIs16BitConcatenation; |
|
303 } |
|
304 |
|
305 |
|
306 inline TBool CSmsMessage::Is16BitConcatenation()const |
|
307 { |
|
308 return iIs16BitConcatenation; |
|
309 } |