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 __SMSCLNT_H__
|
williamr@2
|
17 |
#define __SMSCLNT_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <mtclbase.h>
|
williamr@2
|
20 |
#include <smuthdr.h>
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
/**
|
williamr@2
|
24 |
The UID that indentifies the SMS message editor application.
|
williamr@2
|
25 |
|
williamr@2
|
26 |
This is the response to the query for the KUidMsvMtmQueryEditorUidValue
|
williamr@2
|
27 |
capability.
|
williamr@2
|
28 |
|
williamr@2
|
29 |
@see CSmsClientMtm::QueryCapability
|
williamr@2
|
30 |
|
williamr@2
|
31 |
@publishedPartner
|
williamr@2
|
32 |
@released
|
williamr@2
|
33 |
*/
|
williamr@2
|
34 |
const TInt KUidMsgSmsEditorAppVal=0x1000163f;
|
williamr@2
|
35 |
|
williamr@2
|
36 |
/**
|
williamr@2
|
37 |
The maximum number of SMS PDUs allowed in a concatenated SMS message.
|
williamr@2
|
38 |
|
williamr@2
|
39 |
Together with KSmcmMaxCharsInMessageConcatenated7Bit, this is the response to
|
williamr@2
|
40 |
the query for the KUidMtmQueryMaxTotalMsgSizeValue capability.
|
williamr@2
|
41 |
|
williamr@2
|
42 |
@see CSmsClientMtm::QueryCapability
|
williamr@2
|
43 |
@see KSmcmMaxCharsInMessageConcatenated7Bit
|
williamr@2
|
44 |
|
williamr@2
|
45 |
@internalComponent
|
williamr@2
|
46 |
@released
|
williamr@2
|
47 |
*/
|
williamr@2
|
48 |
const TInt KSmcmMaxMessageNumber=0x32;
|
williamr@2
|
49 |
|
williamr@2
|
50 |
/**
|
williamr@2
|
51 |
The maximum number of characters in a concatenated SMS PDU.
|
williamr@2
|
52 |
|
williamr@2
|
53 |
Together with KSmcmMaxMessageNumber, this is the response to the query for the
|
williamr@2
|
54 |
KUidMtmQueryMaxTotalMsgSizeValue capability.
|
williamr@2
|
55 |
|
williamr@2
|
56 |
@see CSmsClientMtm::QueryCapability
|
williamr@2
|
57 |
@see KSmcmMaxCharsInMessageConcatenated7Bit
|
williamr@2
|
58 |
|
williamr@2
|
59 |
@internalComponent
|
williamr@2
|
60 |
@released
|
williamr@2
|
61 |
*/
|
williamr@2
|
62 |
const TInt KSmcmMaxCharsInMessageConcatenated7Bit=0x99;
|
williamr@2
|
63 |
|
williamr@2
|
64 |
/**
|
williamr@2
|
65 |
The maximum number of characters in a non-concatenated SMS PDU.
|
williamr@2
|
66 |
|
williamr@2
|
67 |
This is the response to the query for the KUidMtmQueryMaxBodySizeValue
|
williamr@2
|
68 |
capability.
|
williamr@2
|
69 |
|
williamr@2
|
70 |
@see CSmsClientMtm::QueryCapability
|
williamr@2
|
71 |
|
williamr@2
|
72 |
@internalComponent
|
williamr@2
|
73 |
@released
|
williamr@2
|
74 |
*/
|
williamr@2
|
75 |
const TInt KSmcmMaxTotalMsgSize=160;
|
williamr@2
|
76 |
|
williamr@2
|
77 |
/**
|
williamr@2
|
78 |
The granularity of the in-memory buffer for CRichText objects.
|
williamr@2
|
79 |
|
williamr@2
|
80 |
@see CRichText::NewL
|
williamr@2
|
81 |
|
williamr@2
|
82 |
@internalComponent
|
williamr@2
|
83 |
@released
|
williamr@2
|
84 |
*/
|
williamr@2
|
85 |
const TInt KSmcmRichTextConstant=256;
|
williamr@2
|
86 |
|
williamr@2
|
87 |
class CSmsHeader;
|
williamr@2
|
88 |
class CSmsMessage;
|
williamr@2
|
89 |
class CSmsSettings;
|
williamr@2
|
90 |
class TSmsUtilities;
|
williamr@2
|
91 |
class CSmsSimParamOperation;
|
williamr@2
|
92 |
class CMobilePhoneSmspList;
|
williamr@2
|
93 |
class RResourceFile;
|
williamr@2
|
94 |
|
williamr@2
|
95 |
/**
|
williamr@2
|
96 |
The SMS client MTM interface.
|
williamr@2
|
97 |
|
williamr@2
|
98 |
Most of the functions in this class are implementations of the virtual functions
|
williamr@2
|
99 |
defined by the base class CBaseMtm.
|
williamr@2
|
100 |
|
williamr@2
|
101 |
An object of this class can be obtained from the Client MTM registry. The message
|
williamr@2
|
102 |
server provides the necessary information required by the registry to provide
|
williamr@2
|
103 |
the SMS client MTM.
|
williamr@2
|
104 |
|
williamr@2
|
105 |
All client MTM objects have a current context. This is an entry in the message
|
williamr@2
|
106 |
store that will be manipulated by certain APIs supplied by the MTM. If the
|
williamr@2
|
107 |
current context is not set then certain APIs will panic.
|
williamr@2
|
108 |
|
williamr@2
|
109 |
The CBaseMtm::HasContext API can be used to check that the current context has
|
williamr@2
|
110 |
been set. It can be set using either the CBaseMtm::SwitchCurrenEntryL API or the
|
williamr@2
|
111 |
CBaseMtm::SetCurrentEntryL API.
|
williamr@2
|
112 |
|
williamr@2
|
113 |
@see CClientMtmRegistry
|
williamr@2
|
114 |
@see CBaseMtm::HasContext
|
williamr@2
|
115 |
@see CBaseMtm::SetCurrentEntryL
|
williamr@2
|
116 |
@see CBaseMtm::SwitchCurrenEntryL
|
williamr@2
|
117 |
|
williamr@2
|
118 |
@publishedAll
|
williamr@2
|
119 |
@released
|
williamr@2
|
120 |
*/
|
williamr@2
|
121 |
class CSmsClientMtm : public CBaseMtm
|
williamr@2
|
122 |
{
|
williamr@2
|
123 |
public:
|
williamr@2
|
124 |
|
williamr@2
|
125 |
IMPORT_C static CSmsClientMtm* NewL(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aSession);
|
williamr@2
|
126 |
virtual ~CSmsClientMtm();
|
williamr@2
|
127 |
|
williamr@2
|
128 |
void HandleEntryEvent(enum MMsvEntryObserver::TMsvEntryEvent,TAny*,TAny*,TAny*);
|
williamr@2
|
129 |
|
williamr@2
|
130 |
inline CSmsHeader& SmsHeader();
|
williamr@2
|
131 |
inline const CSmsHeader& SmsHeader() const;
|
williamr@2
|
132 |
inline CSmsSettings& ServiceSettings();
|
williamr@2
|
133 |
inline const CSmsSettings& ServiceSettings() const;
|
williamr@2
|
134 |
inline TInt ServiceId() const;
|
williamr@2
|
135 |
|
williamr@2
|
136 |
IMPORT_C void RestoreServiceAndSettingsL();
|
williamr@2
|
137 |
IMPORT_C CSmsSimParamOperation* ReadSimParamsL(TRequestStatus& aObserverRequestStatus);
|
williamr@2
|
138 |
IMPORT_C CSmsSimParamOperation* WriteSimParamsL(const CMobilePhoneSmspList& aList, TRequestStatus& aObserverRequestStatus);
|
williamr@2
|
139 |
|
williamr@2
|
140 |
/**
|
williamr@2
|
141 |
Sets the character encoding value. The character encoding value options are 7-bit,
|
williamr@2
|
142 |
8-bit and 16-Bit Unicode. By default the character set encoding is 7 bit encoding.
|
williamr@2
|
143 |
*/
|
williamr@2
|
144 |
void SetMessageCharacterSetL(TSmsDataCodingScheme::TSmsAlphabet aTsmsAlphabet);
|
williamr@2
|
145 |
|
williamr@2
|
146 |
public: // methods from CBaseMtm
|
williamr@2
|
147 |
|
williamr@2
|
148 |
virtual void SaveMessageL();
|
williamr@2
|
149 |
virtual void LoadMessageL();
|
williamr@2
|
150 |
virtual TMsvPartList ValidateMessage(TMsvPartList aPartList);
|
williamr@2
|
151 |
virtual TMsvPartList Find(const TDesC& aTextToFind, TMsvPartList aPartList);
|
williamr@2
|
152 |
virtual CMsvOperation* ReplyL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
|
williamr@2
|
153 |
virtual CMsvOperation* ForwardL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
|
williamr@2
|
154 |
virtual void AddAddresseeL(const TDesC& aRealAddress);
|
williamr@2
|
155 |
virtual void AddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias);
|
williamr@2
|
156 |
virtual void RemoveAddressee(TInt aIndex);
|
williamr@2
|
157 |
virtual TInt QueryCapability(TUid aCapability, TInt& aResponse);
|
williamr@2
|
158 |
virtual void InvokeSyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter);
|
williamr@2
|
159 |
virtual CMsvOperation* InvokeAsyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter, TRequestStatus& aCompletionStatus);
|
williamr@2
|
160 |
|
williamr@2
|
161 |
IMPORT_C void CreateMessageL(TMsvId aServiceId);
|
williamr@2
|
162 |
IMPORT_C void BioTypeChangedL(TUid aBioTypeUid);
|
williamr@2
|
163 |
|
williamr@2
|
164 |
protected:
|
williamr@2
|
165 |
/**
|
williamr@2
|
166 |
Methods from CBaseMtm, The implementation of this function assumes that
|
williamr@2
|
167 |
the new service for setting the charset encoding value for a SMS message is supported.
|
williamr@2
|
168 |
*/
|
williamr@2
|
169 |
IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
|
williamr@2
|
170 |
|
williamr@2
|
171 |
private:
|
williamr@2
|
172 |
|
williamr@2
|
173 |
CSmsClientMtm(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aSession);
|
williamr@2
|
174 |
void ConstructL();
|
williamr@2
|
175 |
|
williamr@2
|
176 |
void BasicReplyForwardEntry(TMsvEntry& aNewEntry) const;
|
williamr@2
|
177 |
CMsvOperation* CreateNewEntryL(TMsvEntry& aNewEntry, TMsvId aDestination,CSmsHeader& aSmsHeader,const CRichText& aBody, TRequestStatus& aCompletionStatus);
|
williamr@2
|
178 |
TBool ValidRecipients() const;
|
williamr@2
|
179 |
TBool ValidNumber(const TDesC& aNumber) const;
|
williamr@2
|
180 |
|
williamr@2
|
181 |
private: // methods from CBaseMtm
|
williamr@2
|
182 |
|
williamr@2
|
183 |
virtual void ContextEntrySwitched();
|
williamr@2
|
184 |
|
williamr@2
|
185 |
private:
|
williamr@2
|
186 |
|
williamr@2
|
187 |
void DoAddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias);
|
williamr@2
|
188 |
void AddRecipientL(const TDesC& aRealAddress, const TDesC& aAlias);
|
williamr@2
|
189 |
void DoAddRecipientL(CSmsHeader* aSmsHeader, const TDesC& aRealAddress, const TDesC& aAlias);
|
williamr@2
|
190 |
void ResetHeader();
|
williamr@2
|
191 |
TMsvPartList DoFindL(const TDesC& aTextToFind,TMsvPartList aPartList);
|
williamr@2
|
192 |
void FindL(const TDesC& aTextToFind, const TMsvPartList aPartList,TMsvPartList& aFoundList);
|
williamr@2
|
193 |
void FindInBodyL(const TDesC& aTextToFind, const TMsvPartList& aFoundList, TMsvPartList& aResult);
|
williamr@2
|
194 |
HBufC* ReadEmailSubjectFormatL(RResourceFile& aResourceFile, TInt aResourceId, const TDesC& aDefaultFormat);
|
williamr@2
|
195 |
|
williamr@2
|
196 |
private:
|
williamr@2
|
197 |
|
williamr@2
|
198 |
CSmsSettings* iServiceSettings;
|
williamr@2
|
199 |
TMsvId iServiceId;
|
williamr@2
|
200 |
CSmsHeader* iSmsHeader;
|
williamr@2
|
201 |
TChar iRealAddressOpen;
|
williamr@2
|
202 |
TChar iRealAddressClose;
|
williamr@2
|
203 |
HBufC* iEmailForwardSubjectFormat;
|
williamr@2
|
204 |
HBufC* iEmailReplySubjectFormat;
|
williamr@2
|
205 |
};
|
williamr@2
|
206 |
|
williamr@2
|
207 |
#include <smsclnt.inl>
|
williamr@2
|
208 |
|
williamr@2
|
209 |
#endif // __SMSCLNT_H__
|