williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // Defines types for SMS adressing and the class TSmsAddr williamr@2: // williamr@2: // williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: @file williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: #if !defined(SMSUADDR_H__) williamr@2: #define SMSUADDR_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: /** SMS sockets family identifier.*/ williamr@2: const TUint KSMSAddrFamily = 0x010; williamr@2: /** SMS sockets protocol ID. */ williamr@2: const TUint KSMSDatagramProtocol = 0x02; williamr@2: /** The maximum number of SAPs the SMS sockets protocol supports. */ williamr@2: const TInt KSMSNumberSockets = 0x100; williamr@2: /** The maximum datagram size the SMS sockets protocol supports. */ williamr@2: const TUint KSMSMaxDatagramSize = 255*160; // Based on 7 bit encoding williamr@2: /** SMS sockets service flags. */ williamr@2: const TUint KSMSDatagramServiceInfo = KSIConnectionLess | KSIMessageBased ; williamr@2: williamr@2: _LIT(KSmsDatagram,"SMS Datagram"); williamr@2: williamr@2: /** Specifies SMS sockets protocol level for the provider in the aLevel argument of RSocket::Ioctl(). */ williamr@2: const TUint KSolSmsProv = 0x100; williamr@2: williamr@2: /** williamr@2: * Ioctl command for deleting SMS messages. williamr@2: * williamr@2: * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. williamr@2: * williamr@2: * @capability WriteUserData williamr@2: * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) williamr@2: */ williamr@2: const TUint KIoctlDeleteSmsMessage = 0x0300; williamr@2: williamr@2: /** williamr@2: * Ioctl command for counting stored SMS messages. williamr@2: * williamr@2: * For this command, the aDesc argument of RSocket::Ioctl() should be a packaged williamr@2: * TUint. On completion, this holds the count of messages enumerated. williamr@2: * williamr@2: * @capability ReadUserData williamr@2: * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) williamr@2: */ williamr@2: const TUint KIoctlEnumerateSmsMessages = 0x0301; williamr@2: williamr@2: /** williamr@2: * Ioctl command to indicate to the protocol that the client received messages williamr@2: * successfully. williamr@2: * williamr@2: * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. williamr@2: * williamr@2: * @capability ReadUserData williamr@2: * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) williamr@2: */ williamr@2: const TUint KIoctlReadMessageSucceeded = 0x0304; williamr@2: williamr@2: /** williamr@2: * Ioctl command to indicate to the protocol that the client failed to receive williamr@2: * messages successfully. williamr@2: * williamr@2: * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. williamr@2: * williamr@2: * @capability ReadUserData williamr@2: * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) williamr@2: */ williamr@2: const TUint KIoctlReadMessageFailed = 0x0305; williamr@2: williamr@2: /** williamr@2: * Ioctl command for sending SMS messages. williamr@2: * williamr@2: * For this command, the aDesc argument of RSocket::Ioctl() should be a packaged williamr@2: * TUint. williamr@2: * williamr@2: * @capability NetworkServices williamr@2: * @see RSocket::Ioctl() williamr@2: */ williamr@2: const TUint KIoctlSendSmsMessage = 0x0306; williamr@2: williamr@2: /** williamr@2: * Ioctl command for writing SMS messages to SIM. williamr@2: * williamr@2: * For this command, the aDesc argument of RSocket::Ioctl() may be NULL or may hold a packaged williamr@2: * descriptor large enough to store information on slots for the message. This descriptor will williamr@2: * be populated upon completion of the request and shall be used by the client to update the williamr@2: * CSmsMessage object that has been written, by invoking its UpdateSlotsL() method. This has williamr@2: * to be done if the client wants to be able to delete this message from the store at some williamr@2: * point, unless it opts to enumerate messages before deletion takes place. williamr@2: * williamr@2: * @capability WriteUserData williamr@2: * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) williamr@2: */ williamr@2: const TUint KIoctlWriteSmsMessage = 0x0307; williamr@2: williamr@2: /** williamr@2: * Ioctl command for enumerating SMS parameter sets. williamr@2: * williamr@2: * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. williamr@2: * williamr@2: * @capability ReadDeviceData williamr@2: * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) williamr@2: */ williamr@2: const TUint KIoctlReadSmsParams = 0x0308; williamr@2: williamr@2: /** williamr@2: * Ioctl command for completing SMSP list read request. williamr@2: * williamr@2: * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. williamr@2: * williamr@2: * @capability ReadDeviceData williamr@2: * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) williamr@2: */ williamr@2: const TUint KIoctlCompleteReadSmsParams = 0x0309; williamr@2: williamr@2: /** williamr@2: * Ioctl command ofr writing SMS parameter sets. williamr@2: * williamr@2: * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. williamr@2: * williamr@2: * @capability WriteDeviceData williamr@2: * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) williamr@2: */ williamr@2: const TUint KIoctlWriteSmsParams = 0x0310; williamr@2: williamr@2: /** williamr@2: * Ioctl command for finding out whether SMS stack is configured for handling williamr@2: * of class 0 messages in out-of-disk condition or not. williamr@2: * williamr@2: * For this command, the aDesc argument of RSocket::Ioctl() should be NULL. williamr@2: * williamr@2: * @capability WriteDeviceData williamr@2: * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) williamr@2: */ williamr@2: const TUint KIoctlSupportOODClass0SmsMessages = 0x0311; williamr@2: williamr@2: /** williamr@2: * KIOctlSelect completion status if a modem is present. williamr@2: * williamr@2: * @capability WriteDeviceData williamr@2: * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) williamr@2: */ williamr@2: const TUint KIoctlSelectModemPresent = 0x400; williamr@2: williamr@2: /** williamr@2: * KIOctlSelect completion status if a modem is not present. williamr@2: * williamr@2: * @capability WriteDeviceData williamr@2: * @see RSocket::Ioctl(TUint aLevel,TUint aName,TDes8* aOption) williamr@2: */ williamr@2: const TUint KIoctlSelectModemNotPresent = 0x401; williamr@2: williamr@2: williamr@2: /** williamr@2: * Category for SMS Stack P&S variables. williamr@2: */ williamr@2: const TUid KUidPSSMSStackCategory = {0x101F7989}; // RootServer's KUidCommsProcess williamr@2: williamr@2: williamr@2: /** williamr@2: * Key for SMS Stack P&S Disk Space Monitor williamr@2: */ williamr@2: const TInt KUidPSSMSStackDiskSpaceMonitorKey = 0x10282FAF; williamr@2: williamr@2: williamr@2: /** williamr@2: * Category for SMS Stack P&S variables. williamr@2: */ williamr@2: const RProperty::TType KUidPSSMSStackDiskSpaceMonitorKeyType = RProperty::EInt; williamr@2: williamr@2: williamr@2: /** williamr@2: * State of Disk Space Monitor. williamr@2: */ williamr@2: enum TSmsDiskSpaceMonitorStatus williamr@2: { williamr@2: /** The Disk Space status is unknown. */ williamr@2: ESmsDiskSpaceUnknown = 0, williamr@2: williamr@2: /** The Disk Space status is believed to be available. */ williamr@2: ESmsDiskSpaceAvailable = 1, williamr@2: williamr@2: /** The Disk Space status was not present during the last receive operation williamr@2: and some PDU have been negatively acknowledged. */ williamr@2: ESmsDiskSpaceFull = 2 williamr@2: }; williamr@2: williamr@2: williamr@2: //ahe TODO williamr@2: //typedef TBuf TSmsServiceCenterAddress; williamr@2: williamr@2: /** Buffer to hold Service Center address. */ williamr@2: typedef TBuf<14> TSmsServiceCenterAddress; williamr@2: /** Package buffer for TSmsServiceCenterAddress objects. */ williamr@2: typedef TPckgBuf TSmsServiceCenterAddressBuf; williamr@2: williamr@2: //note: Maintainers, please do *not* change the order of these enums! williamr@2: /** williamr@2: * SMS address family for a socket. williamr@2: * @publishedAll williamr@2: * @released williamr@2: */ williamr@2: enum TSmsAddrFamily williamr@2: { williamr@4: ESmsAddrUnbound = 0, //< Not bound yet. williamr@4: ESmsAddrSendOnly = 1, //< Only for sending, no reception. williamr@4: ESmsAddrMessageIndication = 2, //< Matches on IEI 0x01 and DCS 0x1100xxxx, 0x1101xxxx and 0x1110xxxx. williamr@4: ESmsAddrMatchIEI = 3, //< For matching Information Element Identifiers (IEI) williamr@4: ESmsAddrMatchText = 4, //< For matching any text patterns williamr@4: ESmsAddrRecvAny = 5, //< Receive all messages. Only one client can use this. williamr@4: ESmsAddrStatusReport = 6, //< For receiving Status Reports. williamr@4: ESmsAddrLocalOperation = 7, //< For local SIM operations. williamr@4: ESmsAddrApplication8BitPort = 8, //< For sock port identification. williamr@4: ESmsAddrApplication16BitPort = 9, //< For sock port identification. williamr@4: ESmsAddrEmail = 10 //< for matching of email messages. williamr@2: }; williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: * SMS address for a socket. williamr@2: * @publishedAll williamr@2: * @released williamr@2: */ williamr@2: class TSmsAddr : public TSockAddr williamr@2: { williamr@2: public: williamr@2: enum { EMaxTextMatchLength = 24 }; williamr@2: public: williamr@2: IMPORT_C TSmsAddr(); williamr@2: IMPORT_C TSmsAddrFamily SmsAddrFamily() const; williamr@2: IMPORT_C void SetSmsAddrFamily(TSmsAddrFamily aFamily); williamr@2: IMPORT_C TInt IdentifierMatch() const; williamr@2: IMPORT_C void SetIdentifierMatch(TInt aIdentifier); williamr@2: IMPORT_C TPtrC8 TextMatch() const; williamr@2: IMPORT_C void SetTextMatch(const TDesC8& aText); williamr@2: IMPORT_C TBool operator==(const TSmsAddr& aAddr) const; williamr@2: }; williamr@2: williamr@2: williamr@2: #endif // SMSUADDR_H__