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