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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
24 The UID that indentifies the SMS message editor application.
26 This is the response to the query for the KUidMsvMtmQueryEditorUidValue
29 @see CSmsClientMtm::QueryCapability
34 const TInt KUidMsgSmsEditorAppVal=0x1000163f;
37 The maximum number of SMS PDUs allowed in a concatenated SMS message.
39 Together with KSmcmMaxCharsInMessageConcatenated7Bit, this is the response to
40 the query for the KUidMtmQueryMaxTotalMsgSizeValue capability.
42 @see CSmsClientMtm::QueryCapability
43 @see KSmcmMaxCharsInMessageConcatenated7Bit
48 const TInt KSmcmMaxMessageNumber=0x32;
51 The maximum number of characters in a concatenated SMS PDU.
53 Together with KSmcmMaxMessageNumber, this is the response to the query for the
54 KUidMtmQueryMaxTotalMsgSizeValue capability.
56 @see CSmsClientMtm::QueryCapability
57 @see KSmcmMaxCharsInMessageConcatenated7Bit
62 const TInt KSmcmMaxCharsInMessageConcatenated7Bit=0x99;
65 The maximum number of characters in a non-concatenated SMS PDU.
67 This is the response to the query for the KUidMtmQueryMaxBodySizeValue
70 @see CSmsClientMtm::QueryCapability
75 const TInt KSmcmMaxTotalMsgSize=160;
78 The granularity of the in-memory buffer for CRichText objects.
85 const TInt KSmcmRichTextConstant=256;
91 class CSmsSimParamOperation;
92 class CMobilePhoneSmspList;
96 The SMS client MTM interface.
98 Most of the functions in this class are implementations of the virtual functions
99 defined by the base class CBaseMtm.
101 An object of this class can be obtained from the Client MTM registry. The message
102 server provides the necessary information required by the registry to provide
105 All client MTM objects have a current context. This is an entry in the message
106 store that will be manipulated by certain APIs supplied by the MTM. If the
107 current context is not set then certain APIs will panic.
109 The CBaseMtm::HasContext API can be used to check that the current context has
110 been set. It can be set using either the CBaseMtm::SwitchCurrenEntryL API or the
111 CBaseMtm::SetCurrentEntryL API.
113 @see CClientMtmRegistry
114 @see CBaseMtm::HasContext
115 @see CBaseMtm::SetCurrentEntryL
116 @see CBaseMtm::SwitchCurrenEntryL
121 class CSmsClientMtm : public CBaseMtm
125 IMPORT_C static CSmsClientMtm* NewL(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aSession);
126 virtual ~CSmsClientMtm();
128 void HandleEntryEvent(enum MMsvEntryObserver::TMsvEntryEvent,TAny*,TAny*,TAny*);
130 inline CSmsHeader& SmsHeader();
131 inline const CSmsHeader& SmsHeader() const;
132 inline CSmsSettings& ServiceSettings();
133 inline const CSmsSettings& ServiceSettings() const;
134 inline TInt ServiceId() const;
136 IMPORT_C void RestoreServiceAndSettingsL();
137 IMPORT_C CSmsSimParamOperation* ReadSimParamsL(TRequestStatus& aObserverRequestStatus);
138 IMPORT_C CSmsSimParamOperation* WriteSimParamsL(const CMobilePhoneSmspList& aList, TRequestStatus& aObserverRequestStatus);
141 Sets the character encoding value. The character encoding value options are 7-bit,
142 8-bit and 16-Bit Unicode. By default the character set encoding is 7 bit encoding.
144 void SetMessageCharacterSetL(TSmsDataCodingScheme::TSmsAlphabet aTsmsAlphabet);
146 public: // methods from CBaseMtm
148 virtual void SaveMessageL();
149 virtual void LoadMessageL();
150 virtual TMsvPartList ValidateMessage(TMsvPartList aPartList);
151 virtual TMsvPartList Find(const TDesC& aTextToFind, TMsvPartList aPartList);
152 virtual CMsvOperation* ReplyL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
153 virtual CMsvOperation* ForwardL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
154 virtual void AddAddresseeL(const TDesC& aRealAddress);
155 virtual void AddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias);
156 virtual void RemoveAddressee(TInt aIndex);
157 virtual TInt QueryCapability(TUid aCapability, TInt& aResponse);
158 virtual void InvokeSyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter);
159 virtual CMsvOperation* InvokeAsyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter, TRequestStatus& aCompletionStatus);
161 IMPORT_C void CreateMessageL(TMsvId aServiceId);
162 IMPORT_C void BioTypeChangedL(TUid aBioTypeUid);
166 Methods from CBaseMtm, The implementation of this function assumes that
167 the new service for setting the charset encoding value for a SMS message is supported.
169 IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
173 CSmsClientMtm(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aSession);
176 void BasicReplyForwardEntry(TMsvEntry& aNewEntry) const;
177 CMsvOperation* CreateNewEntryL(TMsvEntry& aNewEntry, TMsvId aDestination,CSmsHeader& aSmsHeader,const CRichText& aBody, TRequestStatus& aCompletionStatus);
178 TBool ValidRecipients() const;
179 TBool ValidNumber(const TDesC& aNumber) const;
181 private: // methods from CBaseMtm
183 virtual void ContextEntrySwitched();
187 void DoAddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias);
188 void AddRecipientL(const TDesC& aRealAddress, const TDesC& aAlias);
189 void DoAddRecipientL(CSmsHeader* aSmsHeader, const TDesC& aRealAddress, const TDesC& aAlias);
191 TMsvPartList DoFindL(const TDesC& aTextToFind,TMsvPartList aPartList);
192 void FindL(const TDesC& aTextToFind, const TMsvPartList aPartList,TMsvPartList& aFoundList);
193 void FindInBodyL(const TDesC& aTextToFind, const TMsvPartList& aFoundList, TMsvPartList& aResult);
194 HBufC* ReadEmailSubjectFormatL(RResourceFile& aResourceFile, TInt aResourceId, const TDesC& aDefaultFormat);
198 CSmsSettings* iServiceSettings;
200 CSmsHeader* iSmsHeader;
201 TChar iRealAddressOpen;
202 TChar iRealAddressClose;
203 HBufC* iEmailForwardSubjectFormat;
204 HBufC* iEmailReplySubjectFormat;
207 #include <smsclnt.inl>
209 #endif // __SMSCLNT_H__