emailservices/emailstore/base_plugin/inc/baseplugindelayedops.h
branchRCL_3
changeset 24 d189ee25cf9d
parent 16 b5fbb9b25d57
child 25 3533d4323edc
equal deleted inserted replaced
23:dcf0eedfc1a3 24:d189ee25cf9d
    19 #ifndef __BASEPLUGINDELAYEDOPS_H__
    19 #ifndef __BASEPLUGINDELAYEDOPS_H__
    20 #define __BASEPLUGINDELAYEDOPS_H__
    20 #define __BASEPLUGINDELAYEDOPS_H__
    21 
    21 
    22 
    22 
    23 #include <e32base.h>
    23 #include <e32base.h>
    24 #include "cfsmailcommon.h"
    24 #include "CFSMailCommon.h"
    25 #include "baseplugin.h"
    25 #include "BasePlugin.h"
    26 #include "debuglogmacros.h"
    26 #include "DebugLogMacros.h"
    27 
    27 
       
    28 //<qmail>
       
    29 #include "baseplugindef.h"
       
    30 //</qmail>
    28 
    31 
    29 class CBasePlugin;
    32 class CBasePlugin;
    30 class CDelayedOp;
    33 class CDelayedOp;
    31 
    34 
    32 
    35 
    66 
    69 
    67 /**
    70 /**
    68  * The base class for the delayed operations. All of the delayed operations must
    71  * The base class for the delayed operations. All of the delayed operations must
    69  * derive from it.
    72  * derive from it.
    70  */
    73  */
    71 class CDelayedOp : public CActive
    74 class BASEPLUGIN_EXPORT CDelayedOp : public CActive
    72     {
    75     {
    73 
    76 
    74 public:
    77 public:
    75 
       
    76     IMPORT_C virtual ~CDelayedOp();
       
    77     
    78     
    78     IMPORT_C void SetContext(
    79      virtual ~CDelayedOp();
       
    80     
       
    81      void SetContext(
    79         CBasePlugin& aPlugin,
    82         CBasePlugin& aPlugin,
    80         MDelayedOpsManager& aManager );
    83         MDelayedOpsManager& aManager );
    81 
    84     
    82     IMPORT_C void StartOp();
    85 	 void StartOp();
    83 
       
    84     /**
    86     /**
    85      * Derived classes must implement their asynchronous processing in this
    87      * Derived classes must implement their asynchronous processing in this
    86      * method. The GetPlugin method can only be used from within this method.
    88      * method. The GetPlugin method can only be used from within this method.
    87      * Returns boolean: ETrue if op is yielding and needs to be called again, or EFalse if op is done.
       
    88      */
    89      */
    89     virtual TBool ExecuteOpL() = 0;
    90     virtual TBool ExecuteOpL() = 0;
    90 
    91 
    91 protected:
    92 protected:
    92     
    93     
    93     IMPORT_C CDelayedOp();
    94      CDelayedOp();
    94     
    95     
    95     /**
    96     /**
    96      * Returns the plugin instance associated with this operation. Available
    97      * Returns the plugin instance associated with this operation. Available
    97      * only from within the ExecuteOpL method.
    98      * only from within the ExecuteOpL method.
    98      */
    99      */
    99     IMPORT_C CBasePlugin& GetPlugin();
   100      CBasePlugin& GetPlugin();
   100     
   101     
   101     
   102     
   102 private:
   103 private:
   103     
   104     
   104     IMPORT_C virtual void RunL();
   105      virtual void RunL();
   105     IMPORT_C virtual void DoCancel();
   106      virtual void DoCancel();
   106 
   107 
   107 private:
   108 private:
   108     MDelayedOpsManager* iManager;   //not owned
   109     MDelayedOpsManager* iManager;   //not owned
   109     CBasePlugin* iPlugin;           //not owned
   110     CBasePlugin* iPlugin;           //not owned
   110     
   111     
       
   112 public:
       
   113     TInt iRequestId;
       
   114     MFSMailRequestObserver* iOperationObserver;
       
   115     
   111     __LOG_DECLARATION
   116     __LOG_DECLARATION
   112     };
   117     };
   113 
   118 
   114 #endif // __BASEPLUGINDELAYEDOPS_H__
   119 #endif // __BASEPLUGINDELAYEDOPS_H__