examples/Messaging/TextMTM/txtc/TXCLIENT.H

00001 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 //
00015 
00016 
00017 #if !defined (__TXCLIENT_H__)
00018 #define __TXCLIENT_H__
00019 
00020 #include <e32base.h>
00021 #include <badesca.h>
00022 #include <msvapi.h>
00023 #include <mtclbase.h>
00024 
00025 const TUint KAddresseeListResizeGranularity = 5;
00026 
00027 #include "TXUT.H"
00028 
00029 // 
00030 // CTextMtmClient
00031 //              Implements CBaseMtm to provide Client-side Text MTM             
00032 //
00033 
00034 class CTextMtmClient : public CBaseMtm
00035         {
00036 public:
00037         //Construction and destruction 
00038         IMPORT_C static CTextMtmClient* NewL(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aMsvSession);
00039         ~CTextMtmClient();
00040 
00041         // Store and restore entry data 
00042         void SaveMessageL(); 
00043         void LoadMessageL();
00044 
00045         // Response message creation 
00046         CMsvOperation* ReplyL  (TMsvId aReplyEntryId, TMsvPartList aPartlist, TRequestStatus& aCompletionStatus);
00047         CMsvOperation* ForwardL(TMsvId aForwardEntryId, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
00048 
00049         // Validation and search 
00050         TMsvPartList ValidateMessage(TUint aPartList);
00051         TMsvPartList Find(const TDesC& aTextToFind, TMsvPartList aPartList);
00052 
00053         // Addressees have no meaning in the text mtm.
00054         void AddAddresseeL(const TDesC& aRealAddress);
00055         void AddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias);
00056         void RemoveAddressee(TInt aIndex);
00057 
00058         // MTM-specific functionality
00059         TInt QueryCapability(TUid aCapability, TInt& aResponse);
00060         void InvokeSyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter);
00061         CMsvOperation* InvokeAsyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter, TRequestStatus& aCompletionStatus);
00062 
00063         void CreateAttachmentL(const TDesC& aFilePath, const TDesC8& aMimeType, TRequestStatus& aStatus);
00064         void CreateAttachmentL(RFile& aFile, const TDesC8& aMimeType, TRequestStatus& aStatus);
00065         void CreateLinkedAttachmentL(const TDesC& aFilePath, const TDesC8& aMimeType, TRequestStatus& aStatus);
00066         void CreateMessageAttachmentL(TMsvId aAttachmentId, TRequestStatus& aStatus);
00067         
00068         TMsvId DefaultServiceL() const;
00069         void RemoveDefaultServiceL();
00070         void ChangeDefaultServiceL(const TMsvId& aService);
00071 
00072         // Text-specific
00073         TMTMTxtSettings& TxtSettings();
00074         CMTMTxtSettings& Settings();
00075 
00076 protected:
00077         CTextMtmClient(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aMsvSession);
00078         void ContextEntrySwitched(); 
00079         void ConstructL();
00080 
00081 private: // Properties
00082         TMTMTxtSettings iTxtSettings;
00083         CMTMTxtSettings* iSettings;
00084         };
00085 
00086 // Addresses are not used in this MTM
00087 inline void CTextMtmClient::AddAddresseeL(const TDesC& /*aRealAddress*/) {};
00088 inline void CTextMtmClient::AddAddresseeL(const TDesC& /*aRealAddress*/, const TDesC& /*aAlias*/) {};
00089 inline void CTextMtmClient::RemoveAddressee(TInt /*aIndex*/) {};
00090 
00091 inline TMTMTxtSettings& CTextMtmClient::TxtSettings()
00092         {
00093         return iTxtSettings;
00094         }
00095 
00096 inline CMTMTxtSettings& CTextMtmClient::Settings()
00097         {
00098         return *iSettings;
00099         }
00100 
00101 #endif // __TXCLIENT_H__

Generated on Thu Jan 21 10:32:59 2010 for TB10.1 Example Applications by  doxygen 1.5.3