--- a/ipsservices/ipssosplugin/inc/ipsplgonlineoperation.h Tue Aug 31 15:04:17 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgonlineoperation.h Wed Sep 01 12:28:57 2010 +0100
@@ -18,6 +18,7 @@
#ifndef IPSPLGONLINEOPERATION_H
#define IPSPLGONLINEOPERATION_H
+
#include "ipsplgbaseoperation.h"
class CMsvEntrySelection;
@@ -26,136 +27,156 @@
class CIpsPlgTimerOperation;
class CClientMtmRegistry;
-// <qmail> removing class MIpsPlgConnectOpCallback
+
+class MIpsPlgConnectOpCallback
+ {
+public:
+ virtual void CredientialsSetL( TInt aEvent )=0;
+ };
/**
* class CIpsPlgOnlineOperation
+*
* Common base class for email online operations.
*/
-NONSHARABLE_CLASS ( CIpsPlgOnlineOperation ) : public CIpsPlgBaseOperation
+class CIpsPlgOnlineOperation : public CIpsPlgBaseOperation
{
-public:
- virtual ~CIpsPlgOnlineOperation();
+ public:
+
+ /**
+ *
+ */
+ virtual ~CIpsPlgOnlineOperation();
+
+ /**
+ *
+ */
+ virtual const TDesC8& ProgressL() = 0;
+
+ /**
+ * For reporting if DoRunL leaves
+ */
+ virtual const TDesC8& GetErrorProgressL(TInt aError) = 0;
+
+ /**
+ *
+ */
+ virtual TFSProgress GetFSProgressL() const = 0;
+
+ /**
+ *
+ */
+ virtual TInt IpsOpType() const;
+
+
+ protected:
+ /**
+ * C++ constructor
+ */
+ // Construction.
+ CIpsPlgOnlineOperation(
+ CMsvSession& aMsvSession,
+ TInt aPriority,
+ TRequestStatus& aObserverRequestStatus,
+ CIpsPlgTimerOperation& aActivityTimer,
+ TFSMailMsgId aFSMailBoxId,
+ MFSMailRequestObserver& aFSOperationObserver,
+ TInt aFSRequestId,
+ TBool aSignallingAllowed=ETrue );
+
+ /**
+ * Base constructor
+ */
+ void BaseConstructL(TUid aMtmType);
- // <qmail> removing virtual const TDesC8& ProgressL() = 0; as unnecessary (already in baseclass)
- // <qmail> removing virtual const TDesC8& GetErrorProgressL(TInt aError) = 0; as unnecessary (already in baseclass)
-
- /**
- * return progress information about ongoing operation
- */
- virtual TFSProgress GetFSProgressL() const = 0;
-
- // <qmail> removing IpsOpType() from here because this is abstract base class
-
+ /**
+ * From CActive
+ */
+ virtual void DoCancel();
+
+ /**
+ * From CActive
+ */
+ virtual void RunL();
+
+ /**
+ * From CActive
+ */
+ virtual void DoRunL() = 0;
+
+ /**
+ * From CActive
+ */
+ virtual TInt RunError( TInt aError );
+
+ /**
+ * Completes observer with status aStatus
+ * @param aStatus: Status of the operation.
+ * Override if needed to complete with other status than KErrNone.
+ */
+ void CompleteObserver( TInt aStatus = KErrNone );
+
+ /**
+ *
+ */
+ void CompleteThis();
+
+
+ // REVIEW: is there any good reason for next two methods
+ /**
+ *
+ */
+ void InvokeClientMtmAsyncFunctionL(
+ TInt aFunctionId,
+ TMsvId aEntryId,
+ TMsvId aContextId,
+ const TDesC8& aParams=KNullDesC8);
+
+ /**
+ *
+ */
+ void InvokeClientMtmAsyncFunctionL(
+ TInt aFunctionId,
+ const CMsvEntrySelection& aSel,
+ TMsvId aContextId,
+ const TDesC8& aParams=KNullDesC8);
+
+ /**
+ *
+ */
+ //virtual TInt GetEngineProgress( const TDesC8& aProgress );
+
protected:
/**
- * constructor
- * @param aMsvSession reference to existing client-server session to MessageServer
- * @param aObserverRequestStatus client status
- * @param aActivityTimer reference to mailbox's online activity timer
- * @param aFSMailBoxId mailbox id
- * @param aFSOperationObserver callback interface to caller for reporting progress (completion) statuses
- * @param aFSRequestId id of the request
- * @param aSignallingAllowed for asynchronous request response message
- */
- // <qmail> priority parameter has been removed
- // <qmail> MFSMailRequestObserver& changed to pointer
- // <qmail> aSignallingAllowed parameter has been returned
- CIpsPlgOnlineOperation(
- CMsvSession& aMsvSession,
- TRequestStatus& aObserverRequestStatus,
- CIpsPlgTimerOperation& aActivityTimer,
- TFSMailMsgId aFSMailBoxId,
- MFSMailRequestObserver* aFSOperationObserver,
- TInt aFSRequestId,
- TBool aSignallingAllowed=ETrue );
-
- /**
- * Base constructor
- */
- void BaseConstructL( TUid aMtmType );
-
-protected: // From CActive
- virtual void DoCancel();
- virtual void RunL();
-
- /**
- * All concrete classes must implement this
- * It is called by OnlineOperation's RunL()
- */
- virtual void DoRunL() = 0;
-
- // <qmail> removing virtual TInt RunError( TInt aError ); Not needed because RunL uses TRAP harness and never leaves
-
- /**
- * Completes observer with status aStatus
- * @param aStatus: Status of the operation.
- * Override if needed to complete with other status than KErrNone.
- */
- void CompleteObserver( TInt aStatus = KErrNone );
-
- /**
- * Completes "ourselves" not observer; used for starting a new round in statemachine.
- */
- void CompleteThis();
-
- /**
- * Sends a command to MessageServer
- * @param aFunctionId specifies the command
- * @param aEntryId specifies the entry on which the command should be executed
- * (e.g. which message entry to send)
- * @param aParams specifies other parameters needed by particular command
- */
- // <qmail> aContextId parameter has been removed
- void InvokeClientMtmAsyncFunctionL(
- TInt aFunctionId,
- TMsvId aEntryId,
- const TDesC8& aParams=KNullDesC8);
-
- /**
- * Sends a command to MessageServer
- * @param aFunctionId specifies the command
- * @param aSel specifies a selection of entries on which the command should be executed
- * (e.g. which messages to send)
- * @param aParams specifies other parameters needed by particular command
- */
- // <qmail> aContextId parameter has been removed
- void InvokeClientMtmAsyncFunctionL(
- TInt aFunctionId,
- const CMsvEntrySelection& aSel,
- const TDesC8& aParams=KNullDesC8);
-
- // <qmail>
- /**
- * Finds out the current connection state of the mailbox
- * @return true/false
- */
- virtual TBool Connected() const;
- // </qmail>
-
- /**
- * Signals observer of the operation if such exists
- * @param aStatus completion status of the operation
+ *
*/
void SignalFSObserver( TInt aStatus );
protected:
- // mailbox specific activity timer
+ // REVIEW: should tell whether the attributes are owned or not
+ // REVIEW: CMsvOperation already has similar attribute, change the name
CIpsPlgTimerOperation* iActivityTimer;
- CBaseMtm* iBaseMtm;
- CClientMtmRegistry* iMtmReg;
- // sub-operation that this operation is using currently
- CMsvOperation* iSubOperation;
+ CBaseMtm* iBaseMtm;
+ CClientMtmRegistry* iMtmReg;
+ // The sub-operation.
+ CMsvOperation* iOperation;
// Status of current operation
- TInt iError;
- // Return this if iSubOperation==NULL.
- TBuf8<1> iDummyProg;
+ TInt iError;
+ // Return this if iOperation==NULL.
+ TBuf8<1> iDummyProg;
+
- // <qmail> boolean returned
+ //we need to be able to prevent completion signal
+ //to framework, because online operations
+ //may be nested ( fetch uses connect operation )
+ //and we don't want sub operation to signal completion.
TBool iSignallingAllowed;
- // </qmail>
- MFSMailRequestObserver* iFSOperationObserver; //not owned
+ //not owned
+ MFSMailRequestObserver& iFSOperationObserver;
+
+
};
-#endif //IPSPLGONLINEOPERATION_H
+
+#endif//IPSPLGONLINEOPERATION_H