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