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