epoc32/include/smsclnt.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 __SMSCLNT_H__
    17 #define __SMSCLNT_H__
    18 
    19 #include <mtclbase.h>
    20 #include <smuthdr.h>
    21 
    22 
    23 /**
    24 The UID that indentifies the SMS message editor application.
    25 
    26 This is the response to the query for the KUidMsvMtmQueryEditorUidValue
    27 capability.
    28 
    29 @see	CSmsClientMtm::QueryCapability
    30 
    31 @publishedPartner
    32 @released
    33 */
    34 const TInt KUidMsgSmsEditorAppVal=0x1000163f;
    35 
    36 /**
    37 The maximum number of SMS PDUs allowed in a concatenated SMS message.
    38 
    39 Together with KSmcmMaxCharsInMessageConcatenated7Bit, this is the response to
    40 the query for the KUidMtmQueryMaxTotalMsgSizeValue capability.
    41 
    42 @see	CSmsClientMtm::QueryCapability
    43 @see	KSmcmMaxCharsInMessageConcatenated7Bit
    44 
    45 @internalComponent
    46 @released
    47 */
    48 const TInt KSmcmMaxMessageNumber=0x32;
    49 
    50 /**
    51 The maximum number of characters in a concatenated SMS PDU.
    52 
    53 Together with KSmcmMaxMessageNumber, this is the response to the query for the
    54 KUidMtmQueryMaxTotalMsgSizeValue capability.
    55 
    56 @see	CSmsClientMtm::QueryCapability
    57 @see	KSmcmMaxCharsInMessageConcatenated7Bit
    58 
    59 @internalComponent
    60 @released
    61 */
    62 const TInt KSmcmMaxCharsInMessageConcatenated7Bit=0x99;
    63 
    64 /**
    65 The maximum number of characters in a non-concatenated SMS PDU.
    66 
    67 This is the response to the query for the KUidMtmQueryMaxBodySizeValue
    68 capability.
    69 
    70 @see	CSmsClientMtm::QueryCapability
    71 
    72 @internalComponent
    73 @released
    74 */
    75 const TInt KSmcmMaxTotalMsgSize=160;
    76 
    77 /**
    78 The granularity of the in-memory buffer for CRichText objects.
    79 
    80 @see	CRichText::NewL
    81 
    82 @internalComponent
    83 @released
    84 */
    85 const TInt KSmcmRichTextConstant=256;
    86 
    87 class CSmsHeader;
    88 class CSmsMessage;
    89 class CSmsSettings;
    90 class TSmsUtilities;
    91 class CSmsSimParamOperation;
    92 class CMobilePhoneSmspList;
    93 class RResourceFile;
    94 
    95 /** 
    96 The SMS client MTM interface.
    97 
    98 Most of the functions in this class are implementations of the virtual functions 
    99 defined by the base class CBaseMtm.
   100 
   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
   103 the SMS client MTM.
   104 
   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. 
   108 
   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.
   112 
   113 @see	CClientMtmRegistry
   114 @see	CBaseMtm::HasContext
   115 @see	CBaseMtm::SetCurrentEntryL
   116 @see	CBaseMtm::SwitchCurrenEntryL
   117 
   118 @publishedAll
   119 @released
   120 */
   121 class CSmsClientMtm : public CBaseMtm
   122 	{
   123 public:
   124 
   125 	IMPORT_C static CSmsClientMtm* NewL(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aSession);
   126 	virtual ~CSmsClientMtm();
   127 
   128 	void HandleEntryEvent(enum MMsvEntryObserver::TMsvEntryEvent,TAny*,TAny*,TAny*);
   129 
   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;
   135 
   136 	IMPORT_C void RestoreServiceAndSettingsL();
   137 	IMPORT_C CSmsSimParamOperation* ReadSimParamsL(TRequestStatus& aObserverRequestStatus);
   138 	IMPORT_C CSmsSimParamOperation* WriteSimParamsL(const CMobilePhoneSmspList& aList, TRequestStatus& aObserverRequestStatus); 
   139 	
   140 	/** 
   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.
   143 	*/
   144 	void SetMessageCharacterSetL(TSmsDataCodingScheme::TSmsAlphabet aTsmsAlphabet);
   145 
   146 public:	// methods from CBaseMtm
   147 
   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);
   160 
   161 	IMPORT_C void CreateMessageL(TMsvId aServiceId);
   162 	IMPORT_C void BioTypeChangedL(TUid aBioTypeUid);
   163 	
   164 protected: 
   165 	/**
   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.
   168     */
   169 	IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
   170  
   171 private:
   172 
   173 	CSmsClientMtm(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aSession);
   174 	void ConstructL();
   175 
   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;
   180 
   181 private:	// methods from CBaseMtm
   182 
   183 	virtual void ContextEntrySwitched(); 
   184 
   185 private:
   186 
   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);
   190 	void ResetHeader();
   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);
   195 
   196 private:
   197 
   198 	CSmsSettings*	iServiceSettings;
   199 	TMsvId			iServiceId;
   200 	CSmsHeader*		iSmsHeader;
   201 	TChar			iRealAddressOpen;
   202 	TChar			iRealAddressClose;
   203 	HBufC*			iEmailForwardSubjectFormat;
   204 	HBufC*			iEmailReplySubjectFormat;
   205 	};
   206 
   207 #include <smsclnt.inl>
   208 
   209 #endif	// __SMSCLNT_H__