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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Defines types for SMS adressing and the class TSmsAddr
26 #if !defined(SMSUADDR_H__)
27 /** @internalComponent */
30 #include <e32property.h>
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 ;
48 _LIT(KSmsDatagram,"SMS Datagram");
50 /** Specifies SMS sockets protocol level for the provider in the aLevel argument of RSocket::Ioctl(). */
51 const TUint KSolSmsProv = 0x100;
54 * Ioctl command for deleting SMS messages.
56 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
58 * @capability WriteUserData
59 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
61 const TUint KIoctlDeleteSmsMessage = 0x0300;
64 * Ioctl command for counting stored SMS messages.
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.
69 * @capability ReadUserData
70 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
72 const TUint KIoctlEnumerateSmsMessages = 0x0301;
75 * Ioctl command to indicate to the protocol that the client received messages
78 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
80 * @capability ReadUserData
81 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
83 const TUint KIoctlReadMessageSucceeded = 0x0304;
86 * Ioctl command to indicate to the protocol that the client failed to receive
87 * messages successfully.
89 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
91 * @capability ReadUserData
92 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
94 const TUint KIoctlReadMessageFailed = 0x0305;
97 * Ioctl command for sending SMS messages.
99 * For this command, the aDesc argument of RSocket::Ioctl() should be a packaged
102 * @capability NetworkServices
103 * @see RSocket::Ioctl()
105 const TUint KIoctlSendSmsMessage = 0x0306;
108 * Ioctl command for writing SMS messages to SIM.
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.
117 * @capability WriteUserData
118 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
120 const TUint KIoctlWriteSmsMessage = 0x0307;
123 * Ioctl command for enumerating SMS parameter sets.
125 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
127 * @capability ReadDeviceData
128 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
130 const TUint KIoctlReadSmsParams = 0x0308;
133 * Ioctl command for completing SMSP list read request.
135 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
137 * @capability ReadDeviceData
138 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
140 const TUint KIoctlCompleteReadSmsParams = 0x0309;
143 * Ioctl command ofr writing SMS parameter sets.
145 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
147 * @capability WriteDeviceData
148 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
150 const TUint KIoctlWriteSmsParams = 0x0310;
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.
156 * For this command, the aDesc argument of RSocket::Ioctl() should be NULL.
158 * @capability WriteDeviceData
159 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
161 const TUint KIoctlSupportOODClass0SmsMessages = 0x0311;
164 * KIOctlSelect completion status if a modem is present.
166 * @capability WriteDeviceData
167 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
169 const TUint KIoctlSelectModemPresent = 0x400;
172 * KIOctlSelect completion status if a modem is not present.
174 * @capability WriteDeviceData
175 * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption)
177 const TUint KIoctlSelectModemNotPresent = 0x401;
181 * Category for SMS Stack P&S variables.
183 const TUid KUidPSSMSStackCategory = {0x101F7989}; // RootServer's KUidCommsProcess
187 * Key for SMS Stack P&S Disk Space Monitor
189 const TInt KUidPSSMSStackDiskSpaceMonitorKey = 0x10282FAF;
193 * Category for SMS Stack P&S variables.
195 const RProperty::TType KUidPSSMSStackDiskSpaceMonitorKeyType = RProperty::EInt;
199 * State of Disk Space Monitor.
201 enum TSmsDiskSpaceMonitorStatus
203 /** The Disk Space status is unknown. */
204 ESmsDiskSpaceUnknown = 0,
206 /** The Disk Space status is believed to be available. */
207 ESmsDiskSpaceAvailable = 1,
209 /** The Disk Space status was not present during the last receive operation
210 and some PDU have been negatively acknowledged. */
211 ESmsDiskSpaceFull = 2
216 //typedef TBuf<KGsmMaxTelNumberSize> TSmsServiceCenterAddress;
218 /** Buffer to hold Service Center address. */
219 typedef TBuf<14> TSmsServiceCenterAddress;
220 /** Package buffer for TSmsServiceCenterAddress objects. */
221 typedef TPckgBuf<TSmsServiceCenterAddress> TSmsServiceCenterAddressBuf;
223 //note: Maintainers, please do *not* change the order of these enums!
225 * SMS address family for a socket.
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.
247 * SMS address for a socket.
251 class TSmsAddr : public TSockAddr
254 enum { EMaxTextMatchLength = 24 };
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;
267 #endif // SMSUADDR_H__