epoc32/include/smut.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 // Copyright (c) 1999-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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __SMUT_H__
    17 #define __SMUT_H__
    18 
    19 #include <msvstd.h>
    20 #include <msvids.h>
    21 #include <barsc.h>
    22 
    23 class CSmsMessage;
    24 class CContactItemField;
    25 class TResourceReader;
    26 class CMsvSession;
    27 class CMsvServerEntry;
    28 class CMsvEntry;
    29 class CSmsSettings;
    30 
    31 /**
    32 The SMS MTM UID.
    33 
    34 Used to identify the MTMs used for handling SMS messages.
    35 
    36 @publishedAll
    37 @released
    38 */
    39 const TUid KUidMsgTypeSMS			= {0x1000102C};
    40 
    41 /**
    42 The default maximum length used when extracting a description for an SMS message.
    43 
    44 Used as default value of aMaxLength in TSmsUtilities::GetDescription. This
    45 function is used to extract a string to used as a suitable description field in
    46 the message index for a particular SMS message.
    47 
    48 The CSmsSettings provides accessors to get and set the preferred maximum
    49 description length.
    50 
    51 @deprecated
    52 This should not really be used outside of the SMS client MTM. The value provided
    53 by the CSmsSettings class should be used.
    54 
    55 @see	CSmsSettings::GetDescriptionLength
    56 */
    57 const TInt KSmsDescriptionLength	= 32;
    58 
    59 /**
    60 The default maximum length used when extracting the sender/recipiant details for
    61 an SMS message.
    62 
    63 Used as default value of aMaxLength in TSmsUtilities::GetDetails. This function
    64 is used to extract a string to used as the details field in the message index
    65 for a particular SMS message.
    66 
    67 @deprecated
    68 This should really be used at all.
    69 */
    70 const TInt KSmsDetailsLength		= 32;
    71 
    72 _LIT(KSmsResourceFile, "\\resource\\messaging\\SMSS.RSC");
    73 
    74 /**
    75 SMS Messaging utility functions.
    76 
    77 @publishedAll
    78 @released
    79 */
    80 class TSmsUtilities
    81 	{
    82 public:
    83 
    84 /**
    85 Special SMS Message Indication Type.
    86 
    87 A special SMS message indication is used to notify of waiting services, for
    88 instance a voicemail message.
    89 
    90 The TSmsUtilitiesSpecialMessageType enum represents the flags for the known
    91 indication types.
    92 */
    93 	enum TSmsUtilitiesSpecialMessageType
    94 		{
    95 /**
    96 Voice message waiting.
    97 */
    98 		EVoiceMessageWaiting = 0,
    99 /**
   100 Fax message waiting.
   101 */
   102 		EFaxMessageWaiting,
   103 /**
   104 E-mail message waiting.
   105 */
   106 		EEmailMessageWaiting,
   107 /**
   108 Other message-type waiting (see 3GPP TS 23.038 [9] for definition of "other").
   109 */
   110 		EOtherMessageWaiting,
   111 /**
   112 Mask used to obtain the mesasge indication type from the SMS data.
   113 */
   114 		ESpecialMessageTypeMask = 0x7F
   115 		};
   116 
   117 	/**
   118 	@internalComponent
   119 	@removed
   120 	*/
   121 	IMPORT_C void Dummy_Export_1();
   122 	/**
   123 	@internalComponent
   124 	@removed
   125 	*/
   126 	IMPORT_C void Dummy_Export_2();
   127 
   128 	IMPORT_C static void ServiceIdL(CMsvServerEntry& aEntry, TMsvId& aFirstId, TUid aMtm = KUidMsgTypeSMS, CMsvEntrySelection* aServiceIds = NULL);
   129 	IMPORT_C static void ServiceIdL(CMsvEntry& aEntry, TMsvId& aFirstId, TUid aMtm = KUidMsgTypeSMS, CMsvEntrySelection* aServiceIds = NULL);
   130 	IMPORT_C static void ServiceIdL(CMsvSession& aSession, TMsvId& aFirstId, TUid aMtm = KUidMsgTypeSMS, CMsvEntrySelection* aServiceIds = NULL); //more efficient version of the previous one
   131 
   132 	IMPORT_C static void PopulateMsgEntry(TMsvEntry& aEntry, const CSmsMessage& aMessage, TMsvId aServiceId, TUid aMtm = KUidMsgTypeSMS);
   133 	IMPORT_C static void PopulateMsgEntry(TMsvEntry& aEntry, const CSmsMessage& aMessage, TMsvId aServiceId, const CSmsSettings& aSettings, TUid aMtm = KUidMsgTypeSMS);
   134 
   135 	IMPORT_C static TInt GetDetails(RFs& aFs, const CSmsMessage& aMessage, TDes& aDetails, TInt aMaxLength = KSmsDetailsLength);
   136 	IMPORT_C static TInt GetDetails(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength = KSmsDetailsLength);
   137 	IMPORT_C static TInt GetDescription(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength = KSmsDescriptionLength);
   138 
   139 	IMPORT_C static RResourceFile OpenResourceFileL(RFs& aFs);
   140 	IMPORT_C static void ReadResourceStringL(RResourceFile aResourceFile, TInt aResourceId, TDes& aString);
   141 
   142 private:
   143 	static void CompareEntryL(const TMsvEntry& aEntry, TUid aMtm, TMsvId& aFirstId, CMsvEntrySelection* aServiceIds);
   144 	static void GetName(CContactItemField& aField, TUid aFieldType, TDes& aName);
   145 	static void DoGetDetailsL(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength);
   146 	static void Replace(const TDesC& aOld, const TDesC& aNew, TDes& aString);
   147 
   148 	static TBool DoGetDescriptionL(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength);
   149 	static void ExtractDescriptionFromMessage(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength);
   150 
   151 	static TBool ValidGsmNumber(const TDesC& aTelephone);
   152 	};
   153 
   154 #endif	// __SMUT_H__