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