examples/ForumNokia/S60_3rd_Edition_TextMTM_Example/modules/Install/src/txclient.h

00001 // TXCLIENT.H
00002 //
00003 // © 2004 Nokia Corporation.  All rights reserved.
00004 //
00005 
00006 
00007 #if !defined (__TXCLIENT_H__)
00008 #define __TXCLIENT_H__
00009 
00010 // system includes
00011 #include <e32base.h>
00012 #include <badesca.h>
00013 #include <msvapi.h>
00014 #include <mtclbase.h>
00015 #include <txut.h>       // TMTMTxtSettings
00016 
00017 const TUint KAddresseeListResizeGranularity = 5;
00018 
00019 // 
00020 // CTextMtmClient
00021 //              Implements CBaseMtm to provide Client-side Text MTM             
00022 //
00023 
00024 class CTextMtmClient : public CBaseMtm
00025         {
00026 public:
00027         //Construction and destruction 
00028         IMPORT_C static CTextMtmClient* NewL(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aMsvSession);
00029         ~CTextMtmClient();
00030 
00031 public:
00032     // from CBaseMtm
00033 
00034         // Store and restore entry data 
00035         virtual void SaveMessageL(); 
00036         virtual void LoadMessageL();
00037 
00038         // Response message creation 
00039         virtual CMsvOperation* ReplyL(TMsvId aDestination, TMsvPartList aPartlist, TRequestStatus& aCompletionStatus);
00040         virtual CMsvOperation* ForwardL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
00041 
00042         // Validation and search 
00043         virtual TMsvPartList ValidateMessage(TUint aPartList);
00044         virtual TMsvPartList Find(const TDesC& aTextToFind, TMsvPartList aPartList);
00045 
00046         // Addressees have no meaning in the text mtm.
00047         virtual void AddAddresseeL(const TDesC& aRealAddress);
00048         virtual void AddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias);
00049         virtual void RemoveAddressee(TInt aIndex);
00050 
00051         // MTM-specific functionality
00052         virtual TInt QueryCapability(TUid aCapability, TInt& aResponse);
00053         virtual void InvokeSyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter);
00054         virtual CMsvOperation* InvokeAsyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter, TRequestStatus& aCompletionStatus);
00055 
00056         void CreateAttachmentL(const TDesC& aFilePath, const TDesC8& aMimeType, TRequestStatus& aStatus);
00057         void CreateAttachmentL(RFile& aFile, const TDesC8& aMimeType, TRequestStatus& aStatus);
00058         void CreateLinkedAttachmentL(const TDesC& aFilePath, const TDesC8& aMimeType, TRequestStatus& aStatus);
00059         void CreateMessageAttachmentL(TMsvId aAttachmentId, TRequestStatus& aStatus);
00060         
00061         TMsvId DefaultServiceL() const;
00062         void RemoveDefaultServiceL();
00063         void ChangeDefaultServiceL(const TMsvId& aService);
00064 public:
00065         // Text-specific
00066         TMTMTxtSettings& TxtSettings();
00067         CMTMTxtSettings& Settings();
00068 protected:
00069     // from CBaseMtm
00070         virtual void ContextEntrySwitched(); 
00071 
00072 protected:
00073         CTextMtmClient(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aMsvSession);
00074         void ConstructL();
00075 
00076 private: // Properties
00077         TMTMTxtSettings iTxtSettings;
00078         CMTMTxtSettings* iSettings;
00079         };
00080 
00081 
00082 //
00083 // inline implementations
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 inline TMTMTxtSettings& CTextMtmClient::TxtSettings()
00091         {
00092         return iTxtSettings;
00093         }
00094 
00095 inline CMTMTxtSettings& CTextMtmClient::Settings()
00096         {
00097         return *iSettings;
00098         }
00099 #endif // __TXCLIENT_H__

Generated by  doxygen 1.6.2