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