|
1 // Copyright (c) 1997-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 // Defines types for SMS adressing and the class TSmsAddr |
|
15 // |
|
16 // |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @publishedAll |
|
23 @released |
|
24 */ |
|
25 |
|
26 #if !defined(SMSUADDR_H__) |
|
27 /** @internalComponent */ |
|
28 #define SMSUADDR_H__ |
|
29 |
|
30 #include <e32property.h> |
|
31 #include <es_sock.h> |
|
32 #include <etelmm.h> |
|
33 |
|
34 /** SMS sockets family identifier.*/ |
|
35 const TUint KSMSAddrFamily = 0x010; |
|
36 /** SMS sockets protocol ID. */ |
|
37 const TUint KSMSDatagramProtocol = 0x02; |
|
38 /** The maximum number of SAPs the SMS sockets protocol supports. */ |
|
39 const TInt KSMSNumberSockets = 0x100; |
|
40 /** The maximum datagram size the SMS sockets protocol supports. */ |
|
41 const TUint KSMSMaxDatagramSize = 255*160; // Based on 7 bit encoding |
|
42 /** SMS sockets service flags. */ |
|
43 const TUint KSMSDatagramServiceInfo = KSIConnectionLess | KSIMessageBased ; |
|
44 |
|
45 /** |
|
46 * @internalComponent |
|
47 */ |
|
48 _LIT(KSmsDatagram,"SMS Datagram"); |
|
49 |
|
50 /** Specifies SMS sockets protocol level for the provider in the aLevel argument of RSocket::Ioctl(). */ |
|
51 const TUint KSolSmsProv = 0x100; |
|
52 |
|
53 /** |
|
54 * Ioctl command for deleting SMS messages. |
|
55 * |
|
56 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. |
|
57 * |
|
58 * @capability WriteUserData |
|
59 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) |
|
60 */ |
|
61 const TUint KIoctlDeleteSmsMessage = 0x0300; |
|
62 |
|
63 /** |
|
64 * Ioctl command for counting stored SMS messages. |
|
65 * |
|
66 * For this command, the aDesc argument of RSocket::Ioctl() should be a packaged |
|
67 * TUint. On completion, this holds the count of messages enumerated. |
|
68 * |
|
69 * @capability ReadUserData |
|
70 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) |
|
71 */ |
|
72 const TUint KIoctlEnumerateSmsMessages = 0x0301; |
|
73 |
|
74 /** |
|
75 * Ioctl command to indicate to the protocol that the client received messages |
|
76 * successfully. |
|
77 * |
|
78 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. |
|
79 * |
|
80 * @capability ReadUserData |
|
81 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) |
|
82 */ |
|
83 const TUint KIoctlReadMessageSucceeded = 0x0304; |
|
84 |
|
85 /** |
|
86 * Ioctl command to indicate to the protocol that the client failed to receive |
|
87 * messages successfully. |
|
88 * |
|
89 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. |
|
90 * |
|
91 * @capability ReadUserData |
|
92 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) |
|
93 */ |
|
94 const TUint KIoctlReadMessageFailed = 0x0305; |
|
95 |
|
96 /** |
|
97 * Ioctl command for sending SMS messages. |
|
98 * |
|
99 * For this command, the aDesc argument of RSocket::Ioctl() should be a packaged |
|
100 * TUint. |
|
101 * |
|
102 * @capability NetworkServices |
|
103 * @see RSocket::Ioctl() |
|
104 */ |
|
105 const TUint KIoctlSendSmsMessage = 0x0306; |
|
106 |
|
107 /** |
|
108 * Ioctl command for writing SMS messages to SIM. |
|
109 * |
|
110 * For this command, the aDesc argument of RSocket::Ioctl() may be NULL or may hold a packaged |
|
111 * descriptor large enough to store information on slots for the message. This descriptor will |
|
112 * be populated upon completion of the request and shall be used by the client to update the |
|
113 * CSmsMessage object that has been written, by invoking its UpdateSlotsL() method. This has |
|
114 * to be done if the client wants to be able to delete this message from the store at some |
|
115 * point, unless it opts to enumerate messages before deletion takes place. |
|
116 * |
|
117 * @capability WriteUserData |
|
118 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) |
|
119 */ |
|
120 const TUint KIoctlWriteSmsMessage = 0x0307; |
|
121 |
|
122 /** |
|
123 * Ioctl command for enumerating SMS parameter sets. |
|
124 * |
|
125 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. |
|
126 * |
|
127 * @capability ReadDeviceData |
|
128 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) |
|
129 */ |
|
130 const TUint KIoctlReadSmsParams = 0x0308; |
|
131 |
|
132 /** |
|
133 * Ioctl command for completing SMSP list read request. |
|
134 * |
|
135 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. |
|
136 * |
|
137 * @capability ReadDeviceData |
|
138 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) |
|
139 */ |
|
140 const TUint KIoctlCompleteReadSmsParams = 0x0309; |
|
141 |
|
142 /** |
|
143 * Ioctl command ofr writing SMS parameter sets. |
|
144 * |
|
145 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. |
|
146 * |
|
147 * @capability WriteDeviceData |
|
148 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) |
|
149 */ |
|
150 const TUint KIoctlWriteSmsParams = 0x0310; |
|
151 |
|
152 /** |
|
153 * Ioctl command for finding out whether SMS stack is configured for handling |
|
154 * of class 0 messages in out-of-disk condition or not. |
|
155 * |
|
156 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. |
|
157 * |
|
158 * @capability WriteDeviceData |
|
159 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) |
|
160 */ |
|
161 const TUint KIoctlSupportOODClass0SmsMessages = 0x0311; |
|
162 |
|
163 /** |
|
164 * KIOctlSelect completion status if a modem is present. |
|
165 * |
|
166 * @capability WriteDeviceData |
|
167 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) |
|
168 */ |
|
169 const TUint KIoctlSelectModemPresent = 0x400; |
|
170 |
|
171 /** |
|
172 * KIOctlSelect completion status if a modem is not present. |
|
173 * |
|
174 * @capability WriteDeviceData |
|
175 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) |
|
176 */ |
|
177 const TUint KIoctlSelectModemNotPresent = 0x401; |
|
178 |
|
179 |
|
180 /** |
|
181 * Category for SMS Stack P&S variables. |
|
182 */ |
|
183 const TUid KUidPSSMSStackCategory = {0x101F7989}; // RootServer's KUidCommsProcess |
|
184 |
|
185 |
|
186 /** |
|
187 * Key for SMS Stack P&S Disk Space Monitor |
|
188 */ |
|
189 const TInt KUidPSSMSStackDiskSpaceMonitorKey = 0x10282FAF; |
|
190 |
|
191 |
|
192 /** |
|
193 * Category for SMS Stack P&S variables. |
|
194 */ |
|
195 const RProperty::TType KUidPSSMSStackDiskSpaceMonitorKeyType = RProperty::EInt; |
|
196 |
|
197 |
|
198 /** |
|
199 * State of Disk Space Monitor. |
|
200 */ |
|
201 enum TSmsDiskSpaceMonitorStatus |
|
202 { |
|
203 /** The Disk Space status is unknown. */ |
|
204 ESmsDiskSpaceUnknown = 0, |
|
205 |
|
206 /** The Disk Space status is believed to be available. */ |
|
207 ESmsDiskSpaceAvailable = 1, |
|
208 |
|
209 /** The Disk Space status was not present during the last receive operation |
|
210 and some PDU have been negatively acknowledged. */ |
|
211 ESmsDiskSpaceFull = 2 |
|
212 }; |
|
213 |
|
214 |
|
215 //ahe TODO |
|
216 //typedef TBuf<KGsmMaxTelNumberSize> TSmsServiceCenterAddress; |
|
217 |
|
218 /** Buffer to hold Service Center address. */ |
|
219 typedef TBuf<14> TSmsServiceCenterAddress; |
|
220 /** Package buffer for TSmsServiceCenterAddress objects. */ |
|
221 typedef TPckgBuf<TSmsServiceCenterAddress> TSmsServiceCenterAddressBuf; |
|
222 |
|
223 //note: Maintainers, please do *not* change the order of these enums! |
|
224 /** |
|
225 * SMS address family for a socket. |
|
226 * @publishedAll |
|
227 * @released |
|
228 */ |
|
229 enum TSmsAddrFamily |
|
230 { |
|
231 ESmsAddrUnbound = 0, ///< Not bound yet. |
|
232 ESmsAddrSendOnly = 1, ///< Only for sending, no reception. |
|
233 ESmsAddrMessageIndication = 2, ///< Matches on IEI 0x01 and DCS 0x1100xxxx, 0x1101xxxx and 0x1110xxxx. |
|
234 ESmsAddrMatchIEI = 3, ///< For matching Information Element Identifiers (IEI) |
|
235 ESmsAddrMatchText = 4, ///< For matching any text patterns |
|
236 ESmsAddrRecvAny = 5, ///< Receive all messages. Only one client can use this. |
|
237 ESmsAddrStatusReport = 6, ///< For receiving Status Reports. |
|
238 ESmsAddrLocalOperation = 7, ///< For local SIM operations. |
|
239 ESmsAddrApplication8BitPort = 8, ///< For sock port identification. |
|
240 ESmsAddrApplication16BitPort = 9, ///< For sock port identification. |
|
241 ESmsAddrEmail = 10 ///< for matching of email messages. |
|
242 }; |
|
243 |
|
244 |
|
245 |
|
246 /** |
|
247 * SMS address for a socket. |
|
248 * @publishedAll |
|
249 * @released |
|
250 */ |
|
251 class TSmsAddr : public TSockAddr |
|
252 { |
|
253 public: |
|
254 enum { EMaxTextMatchLength = 24 }; |
|
255 public: |
|
256 IMPORT_C TSmsAddr(); |
|
257 IMPORT_C TSmsAddrFamily SmsAddrFamily() const; |
|
258 IMPORT_C void SetSmsAddrFamily(TSmsAddrFamily aFamily); |
|
259 IMPORT_C TInt IdentifierMatch() const; |
|
260 IMPORT_C void SetIdentifierMatch(TInt aIdentifier); |
|
261 IMPORT_C TPtrC8 TextMatch() const; |
|
262 IMPORT_C void SetTextMatch(const TDesC8& aText); |
|
263 IMPORT_C TBool operator==(const TSmsAddr& aAddr) const; |
|
264 }; |
|
265 |
|
266 |
|
267 #endif // SMSUADDR_H__ |