1.1 --- a/epoc32/include/smut.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/smut.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,154 @@
1.4 -smut.h
1.5 +// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __SMUT_H__
1.21 +#define __SMUT_H__
1.22 +
1.23 +#include <msvstd.h>
1.24 +#include <msvids.h>
1.25 +#include <barsc.h>
1.26 +
1.27 +class CSmsMessage;
1.28 +class CContactItemField;
1.29 +class TResourceReader;
1.30 +class CMsvSession;
1.31 +class CMsvServerEntry;
1.32 +class CMsvEntry;
1.33 +class CSmsSettings;
1.34 +
1.35 +/**
1.36 +The SMS MTM UID.
1.37 +
1.38 +Used to identify the MTMs used for handling SMS messages.
1.39 +
1.40 +@publishedAll
1.41 +@released
1.42 +*/
1.43 +const TUid KUidMsgTypeSMS = {0x1000102C};
1.44 +
1.45 +/**
1.46 +The default maximum length used when extracting a description for an SMS message.
1.47 +
1.48 +Used as default value of aMaxLength in TSmsUtilities::GetDescription. This
1.49 +function is used to extract a string to used as a suitable description field in
1.50 +the message index for a particular SMS message.
1.51 +
1.52 +The CSmsSettings provides accessors to get and set the preferred maximum
1.53 +description length.
1.54 +
1.55 +@deprecated
1.56 +This should not really be used outside of the SMS client MTM. The value provided
1.57 +by the CSmsSettings class should be used.
1.58 +
1.59 +@see CSmsSettings::GetDescriptionLength
1.60 +*/
1.61 +const TInt KSmsDescriptionLength = 32;
1.62 +
1.63 +/**
1.64 +The default maximum length used when extracting the sender/recipiant details for
1.65 +an SMS message.
1.66 +
1.67 +Used as default value of aMaxLength in TSmsUtilities::GetDetails. This function
1.68 +is used to extract a string to used as the details field in the message index
1.69 +for a particular SMS message.
1.70 +
1.71 +@deprecated
1.72 +This should really be used at all.
1.73 +*/
1.74 +const TInt KSmsDetailsLength = 32;
1.75 +
1.76 +_LIT(KSmsResourceFile, "\\resource\\messaging\\SMSS.RSC");
1.77 +
1.78 +/**
1.79 +SMS Messaging utility functions.
1.80 +
1.81 +@publishedAll
1.82 +@released
1.83 +*/
1.84 +class TSmsUtilities
1.85 + {
1.86 +public:
1.87 +
1.88 +/**
1.89 +Special SMS Message Indication Type.
1.90 +
1.91 +A special SMS message indication is used to notify of waiting services, for
1.92 +instance a voicemail message.
1.93 +
1.94 +The TSmsUtilitiesSpecialMessageType enum represents the flags for the known
1.95 +indication types.
1.96 +*/
1.97 + enum TSmsUtilitiesSpecialMessageType
1.98 + {
1.99 +/**
1.100 +Voice message waiting.
1.101 +*/
1.102 + EVoiceMessageWaiting = 0,
1.103 +/**
1.104 +Fax message waiting.
1.105 +*/
1.106 + EFaxMessageWaiting,
1.107 +/**
1.108 +E-mail message waiting.
1.109 +*/
1.110 + EEmailMessageWaiting,
1.111 +/**
1.112 +Other message-type waiting (see 3GPP TS 23.038 [9] for definition of "other").
1.113 +*/
1.114 + EOtherMessageWaiting,
1.115 +/**
1.116 +Mask used to obtain the mesasge indication type from the SMS data.
1.117 +*/
1.118 + ESpecialMessageTypeMask = 0x7F
1.119 + };
1.120 +
1.121 + /**
1.122 + @internalComponent
1.123 + @removed
1.124 + */
1.125 + IMPORT_C void Dummy_Export_1();
1.126 + /**
1.127 + @internalComponent
1.128 + @removed
1.129 + */
1.130 + IMPORT_C void Dummy_Export_2();
1.131 +
1.132 + IMPORT_C static void ServiceIdL(CMsvServerEntry& aEntry, TMsvId& aFirstId, TUid aMtm = KUidMsgTypeSMS, CMsvEntrySelection* aServiceIds = NULL);
1.133 + IMPORT_C static void ServiceIdL(CMsvEntry& aEntry, TMsvId& aFirstId, TUid aMtm = KUidMsgTypeSMS, CMsvEntrySelection* aServiceIds = NULL);
1.134 + IMPORT_C static void ServiceIdL(CMsvSession& aSession, TMsvId& aFirstId, TUid aMtm = KUidMsgTypeSMS, CMsvEntrySelection* aServiceIds = NULL); //more efficient version of the previous one
1.135 +
1.136 + IMPORT_C static void PopulateMsgEntry(TMsvEntry& aEntry, const CSmsMessage& aMessage, TMsvId aServiceId, TUid aMtm = KUidMsgTypeSMS);
1.137 + IMPORT_C static void PopulateMsgEntry(TMsvEntry& aEntry, const CSmsMessage& aMessage, TMsvId aServiceId, const CSmsSettings& aSettings, TUid aMtm = KUidMsgTypeSMS);
1.138 +
1.139 + IMPORT_C static TInt GetDetails(RFs& aFs, const CSmsMessage& aMessage, TDes& aDetails, TInt aMaxLength = KSmsDetailsLength);
1.140 + IMPORT_C static TInt GetDetails(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength = KSmsDetailsLength);
1.141 + IMPORT_C static TInt GetDescription(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength = KSmsDescriptionLength);
1.142 +
1.143 + IMPORT_C static RResourceFile OpenResourceFileL(RFs& aFs);
1.144 + IMPORT_C static void ReadResourceStringL(RResourceFile aResourceFile, TInt aResourceId, TDes& aString);
1.145 +
1.146 +private:
1.147 + static void CompareEntryL(const TMsvEntry& aEntry, TUid aMtm, TMsvId& aFirstId, CMsvEntrySelection* aServiceIds);
1.148 + static void GetName(CContactItemField& aField, TUid aFieldType, TDes& aName);
1.149 + static void DoGetDetailsL(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength);
1.150 + static void Replace(const TDesC& aOld, const TDesC& aNew, TDes& aString);
1.151 +
1.152 + static TBool DoGetDescriptionL(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength);
1.153 + static void ExtractDescriptionFromMessage(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength);
1.154 +
1.155 + static TBool ValidGsmNumber(const TDesC& aTelephone);
1.156 + };
1.157 +
1.158 +#endif // __SMUT_H__