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

00001 //
00002 // � 2004 Nokia Corporation.  All rights reserved.
00003 //
00004 
00005 
00006 #ifndef __TXTU_H__
00007 #define __TXTU_H__
00008 
00009 // system include
00010 #include <mtmuibas.h>       // CBaseMtmUi
00011 
00012 // user include
00013 #include "txut.h"        //service settings
00014 
00015 //
00016 // CTextMtmUi: User Interface MTM
00017 //
00018 
00019 class CTextMtmUi : public CBaseMtmUi
00020         {
00021 public:
00022         // Construction
00023         static CTextMtmUi* NewL(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll);
00024         // Destruction
00025         ~CTextMtmUi();
00026 
00027 public:
00028         // Context-specific APIs from CBaseMtmUi
00029         virtual CMsvOperation* CancelL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection);
00030 
00031         virtual CMsvOperation* OpenL(TRequestStatus& aStatus); 
00032         virtual CMsvOperation* OpenL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection); 
00033 
00034         virtual CMsvOperation* CloseL(TRequestStatus& aStatus); 
00035         virtual CMsvOperation* CloseL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection);
00036 
00037         // Launches editor/settings dialog as appropriate  
00038         virtual CMsvOperation* EditL(TRequestStatus& aStatus);
00039         virtual CMsvOperation* EditL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection) ;
00040 
00041         // Launches viewer/settings dialog as appropriate  
00042         virtual CMsvOperation* ViewL(TRequestStatus& aStatus);
00043         virtual CMsvOperation* ViewL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection);
00044 
00045         // Copy and move
00046         virtual CMsvOperation* CopyToL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
00047         virtual CMsvOperation* MoveToL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
00048         virtual CMsvOperation* CopyFromL(const CMsvEntrySelection& aSelection, TMsvId aTargetId, TRequestStatus& aStatus);
00049         virtual CMsvOperation* MoveFromL(const CMsvEntrySelection& aSelection, TMsvId aTargetId, TRequestStatus& aStatus);
00050 
00051         // Creat reply/forward message entries
00052     virtual CMsvOperation* ReplyL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
00053         virtual CMsvOperation* ForwardL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
00054 
00055         // Create/delete/undelete
00056         virtual CMsvOperation* CreateL(const TMsvEntry& aEntry, CMsvEntry& aParent, TRequestStatus& aStatus);
00057         virtual CMsvOperation* DeleteFromL(const CMsvEntrySelection& aSelection,TRequestStatus& aStatus);
00058         CMsvOperation* DeleteServiceL(const TMsvEntry& aService, TRequestStatus& aStatus);
00059 
00060 public:
00061         // Operation APIs from CBaseMtmUi
00062         virtual void InvokeSyncFunctionL(TInt aFunctionId, const CMsvEntrySelection& aSelection, TDes8& aParameter);
00063         virtual CMsvOperation* InvokeAsyncFunctionL(TInt aFunctionId, const CMsvEntrySelection& aSelection, TRequestStatus& aCompletionStatus, TDes8& aParameter);
00064         virtual TInt GetProgress(const TDesC8& aProgress, TBuf<EProgressStringMaxLen>& aReturnString, TInt& aTotalEntryCount, TInt& aEntriesDone,
00065                 TInt& aCurrentEntrySize, TInt& aCurrentBytesTrans) const;
00066 
00067 
00068 public:
00069         CMsvOperation* LaunchEditorApplicationL(TRequestStatus& aStatus, TMsvId aId, TBool aReadOnly);
00070      CMsvOperation* LaunchViewerApplicationL(TRequestStatus& aStatus, TMsvId aId);
00071      
00072 protected: 
00073         // from CBaseMtmUi
00074         void GetResourceFileName(TFileName& aFileName) const;
00075 
00076 protected:
00077         CTextMtmUi(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll);
00078         void TxtConstructL();
00079 
00080 private:
00081     // private utility methods
00082         CMsvOperation* DoCopyMoveToL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus, TBool aCopy);
00083         CMsvOperation* DoCopyMoveFromL(const CMsvEntrySelection& aSelection, TMsvId aTargetId, TRequestStatus& aStatus, TBool aCopy);
00084         void ValidateSelectionL(const CMsvEntry& aParent, const CMsvEntrySelection& aSelection);
00085         CMsvOperation* MessageEditL(TRequestStatus& aStatus);
00086         CMsvOperation* ServiceEditL(TRequestStatus& aStatus);
00087         void SetProgressSuccess(TPckgBuf<TMsvLocalOperationProgress>& aProgress,TMsvId aId);
00088 
00089 private:
00090         TMsvId iServiceId;
00091     TInt iNewResourceFileOffset;
00092     HBufC* iResourceFileName;
00093         };
00094 
00095 
00096 //
00097 //      CEditRemoteOperation: remote edit operation
00098 //
00099 class CEditRemoteOperation : public CMsvOperation
00100         {
00101         enum TEditRemoteState
00102                 {
00103                 EStateFinished=0,
00104                 EStateEditing,
00105                 EStateCopying,
00106                 };
00107         
00108         public:
00109                 CEditRemoteOperation(CTextMtmUi& aMtmUi, CMsvSession& aMsvSession, 
00110                         TInt aPriority, TRequestStatus& aObserverRequestStatus);
00111                 ~CEditRemoteOperation();
00112 
00113     public:
00114         void StartL(TMsvEntry& aSourceEntry);
00115 
00116         public: // from CMsvOperation           
00117                 virtual const TDesC8& ProgressL();
00118 
00119         public: // from CActive
00120                 virtual void DoCancel();
00121                 virtual void RunL();
00122 
00123         private:
00124                 CTextMtmUi& iMtmUi;
00125                 TBuf8<10> iProgress;
00126                 CMsvOperation* iCopyOperation;
00127                 CMsvOperation* iEditOperation;
00128                 TEditRemoteState iState;
00129         };
00130 
00131 #endif // __TXTU_H__

Generated by  doxygen 1.6.2