examples/ForumNokia/S60_3rd_Edition_TextMTM_Example/modules/Client/inc/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 "../../Util/inc/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 
00030 
00031         ~CTextMtmClient();
00032 
00033 public:
00034     // from CBaseMtm
00035         // Store and restore entry data 
00036         virtual void SaveMessageL(); 
00037         virtual void LoadMessageL();
00038 
00039         // Response message creation 
00040         virtual CMsvOperation* ReplyL(TMsvId aDestination, TMsvPartList aPartlist, TRequestStatus& aCompletionStatus);
00041         virtual CMsvOperation* ForwardL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
00042 
00043         // Validation and search 
00044         virtual TMsvPartList ValidateMessage(TUint aPartList);
00045         virtual TMsvPartList Find(const TDesC& aTextToFind, TMsvPartList aPartList);
00046 
00047         // Addressees have no meaning in the text mtm.
00048         virtual void AddAddresseeL(const TDesC& aRealAddress);
00049         virtual void AddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias);
00050         virtual void RemoveAddressee(TInt aIndex);
00051 
00052         // MTM-specific functionality
00053         virtual TInt QueryCapability(TUid aCapability, TInt& aResponse);
00054         virtual void InvokeSyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter);
00055         virtual CMsvOperation* InvokeAsyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter, TRequestStatus& aCompletionStatus);
00056 
00057         void CreateAttachmentL(const TDesC& aFilePath, const TDesC8& aMimeType, TRequestStatus& aStatus);
00058         void CreateAttachmentL(RFile& aFile, const TDesC8& aMimeType, TRequestStatus& aStatus);
00059         void CreateLinkedAttachmentL(const TDesC& aFilePath, const TDesC8& aMimeType, TRequestStatus& aStatus);
00060         void CreateMessageAttachmentL(TMsvId aAttachmentId, TRequestStatus& aStatus);
00061         
00062         TMsvId DefaultServiceL() const;
00063         void RemoveDefaultServiceL();
00064         void ChangeDefaultServiceL(const TMsvId& aService);
00065 
00066     virtual void SetSubjectL(const TDesC &aSubject);
00067     virtual const TPtrC SubjectL() const;
00068 public:
00069         // Text-specific
00070         TMTMTxtSettings& TxtSettings();
00071         CMTMTxtSettings& Settings();
00072 protected:
00073     // from CBaseMtm
00074         virtual void ContextEntrySwitched(); 
00075 
00076 protected:
00077         CTextMtmClient(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aMsvSession);
00078         void ConstructL();
00079 
00080 private: // Properties
00081         TMTMTxtSettings iTxtSettings;
00082         CMTMTxtSettings* iSettings;
00083         };
00084 
00085 
00086 //
00087 // inline implementations
00088 //
00089 
00090 // Addresses are not used in this MTM
00091  void CTextMtmClient::AddAddresseeL(const TDesC& /*aRealAddress*/) {};
00092  void CTextMtmClient::AddAddresseeL(const TDesC& /*aRealAddress*/, const TDesC& /*aAlias*/) {};
00093  void CTextMtmClient::RemoveAddressee(TInt /*aIndex*/) {};
00094  TMTMTxtSettings& CTextMtmClient::TxtSettings()
00095         {
00096         return iTxtSettings;
00097         }
00098 
00099  CMTMTxtSettings& CTextMtmClient::Settings()
00100         {
00101         return *iSettings;
00102         }
00103 #endif // __TXCLIENT_H__

Generated by  doxygen 1.6.2