ipsservices/ipssosaoplugin/inc/IpsSosAOPopAgent.h
changeset 23 2dc6caa42ec3
parent 18 578830873419
equal deleted inserted replaced
20:ecc8def7944a 23:2dc6caa42ec3
    15 *     Contains pop specified sync logic
    15 *     Contains pop specified sync logic
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 #ifndef IPSSOSAOPOPAGENT_H_
    20 #ifndef IPSSOSAOPOPAGENT_H
    21 #define IPSSOSAOPOPAGENT_H_
    21 #define IPSSOSAOPOPAGENT_H
    22 
    22 
    23 #include <pop3set.h>
    23 #include <pop3set.h>
    24 #include <mtclreg.h>
    24 #include <mtclreg.h>
    25 
    25 
    26 #include "IpsSosAOBaseAgent.h"
    26 #include "IpsSosAOBaseAgent.h"
    33 *
    33 *
    34 * Is created by IpsSosAOBaseAgent, contains pop spesific 
    34 * Is created by IpsSosAOBaseAgent, contains pop spesific 
    35 * implementations of base class pure virtual functions.
    35 * implementations of base class pure virtual functions.
    36 *
    36 *
    37 */
    37 */
       
    38 //<Qmail>
    38 NONSHARABLE_CLASS (CIpsSosAOPopAgent) : public CIpsSosAOBaseAgent
    39 NONSHARABLE_CLASS (CIpsSosAOPopAgent) : public CIpsSosAOBaseAgent
       
    40 //</Qmail>
    39     {
    41     {
    40 public:
    42 public:
    41     
    43     
    42     /**
    44     /**
    43     * Two phased constructor
    45     * Two phased constructor
    52     * Destructor
    54     * Destructor
    53     */
    55     */
    54     virtual ~CIpsSosAOPopAgent();
    56     virtual ~CIpsSosAOPopAgent();
    55     
    57     
    56 public: // from CIpsSosAOBaseAgent
    58 public: // from CIpsSosAOBaseAgent
    57     
    59     //<Qmail>
       
    60     /**
       
    61      * GetServerAddress
       
    62      * @param a return parameter
       
    63      */
    58     virtual void GetServerAddress( 
    64     virtual void GetServerAddress( 
    59             TBuf<KIpsSosAOTextBufferSize>& aIncomingServer ) const;
    65             TBuf<KIpsSosAOTextBufferSize>& aIncomingServer ) const;
    60     
    66     
       
    67     /**
       
    68      * GetUsername
       
    69      * @param a return parameter
       
    70      */
    61     virtual void GetUsername( 
    71     virtual void GetUsername( 
    62             TBuf8<KIpsSosAOTextBufferSize>& aUsername ) const;
    72             TBuf8<KIpsSosAOTextBufferSize>& aUsername ) const;
    63     
    73     
       
    74     /**
       
    75      * checks is does mailbox have connection open
       
    76      * @return is connected or not
       
    77      */
    64     virtual TBool IsConnected() const;
    78     virtual TBool IsConnected() const;
    65     
    79     
       
    80     /**
       
    81      * Starts email sync
       
    82      */
    66     virtual void StartSyncL();
    83     virtual void StartSyncL();
    67     
    84     
       
    85     /**
       
    86      * starts fetching messages
       
    87      */
    68     virtual void StartFetchMessagesL( const RArray<TMsvId>& aFetchMsgArray );
    88     virtual void StartFetchMessagesL( const RArray<TMsvId>& aFetchMsgArray );
    69     
    89     
       
    90     /**
       
    91      * cancels all ongoing suboperations and disconnects
       
    92      */
    70     virtual void CancelAllAndDisconnectL();
    93     virtual void CancelAllAndDisconnectL();
    71     
    94     
       
    95     /**
       
    96      * cancels all suboperations
       
    97      */
    72     virtual void CancelAllAndDoNotDisconnect();
    98     virtual void CancelAllAndDoNotDisconnect();
    73     
    99     
       
   100     /**
       
   101      * sets iDoNotDisconnect as ETrue
       
   102      */
    74     virtual void DoNotDisconnect();
   103     virtual void DoNotDisconnect();
    75     
   104     
       
   105     /**
       
   106      * sets iDoNotDisconnect as EFalse
       
   107      */
    76     virtual void ClearDoNotDisconnect();
   108     virtual void ClearDoNotDisconnect();
    77     
   109     
       
   110     /**
       
   111      * pauses ongoing operations
       
   112      */
    78     virtual void HoldOperations();
   113     virtual void HoldOperations();
    79 
   114 
       
   115     /**
       
   116      * resumes paused operations
       
   117      */
    80     virtual void ContinueHoldOperations();
   118     virtual void ContinueHoldOperations();
    81     
   119     
       
   120     /**
       
   121      * @return current iState
       
   122      */
    82     virtual CIpsSosAOBaseAgent::TAgentState GetState() const;
   123     virtual CIpsSosAOBaseAgent::TAgentState GetState() const;
    83     
   124     
       
   125     /**
       
   126      * Loads CImPop3Settings object
       
   127      */
    84     virtual void LoadSettingsL();
   128     virtual void LoadSettingsL();
    85     
   129     //</Qmail>
    86 private:
   130 private:
    87 
   131 
    88     /**
   132     /**
    89     * Constructor
   133     * Constructor
    90     */
   134     */
    95 
   139 
    96     /**
   140     /**
    97     * Second phase constructor
   141     * Second phase constructor
    98     */
   142     */
    99     void ConstructL();
   143     void ConstructL();
   100     
   144     //<Qmail>
       
   145     /**
       
   146      * called when cancelled
       
   147      */
   101     virtual void DoCancel();
   148     virtual void DoCancel();
   102     
   149     
       
   150     /**
       
   151      * from CActive
       
   152      */
   103     virtual void RunL();
   153     virtual void RunL();
   104     
   154     
       
   155     /**
       
   156      * from CActive
       
   157      */
   105     virtual TInt RunError( TInt aError );
   158     virtual TInt RunError( TInt aError );
   106 
   159 
       
   160     /**
       
   161      * fetches the content of all synced messages
       
   162      */
   107     void PopulateAllL();
   163     void PopulateAllL();
   108     
   164     
       
   165     /**
       
   166      * triggers async statemachine
       
   167      */
   109     inline void SetActiveAndCompleteThis();
   168     inline void SetActiveAndCompleteThis();
   110     
   169     //</Qmail>
   111     
   170     
   112 private:
   171 private:
   113     
   172     
   114     CMsvSession&                        iSession;
   173     CMsvSession&                        iSession;
   115     MIpsSosAOAgentOperationResponse&    iOpResponse;
   174     MIpsSosAOAgentOperationResponse&    iOpResponse;
   116     TMsvId                              iServiceId;
   175     TMsvId                              iServiceId;
   117     TBool                               iSyncStartedSignaled;
   176     TBool                               iSyncStartedSignaled;
   118     TAgentState                         iState;
   177     TAgentState                         iState;
   119     TBool                               iDoNotDisconnect;
   178     TBool                               iDoNotDisconnect;
   120     CImPop3Settings*                    iPopSettings;
   179 	//<Qmail>
   121     CMsvOperation*                      iOngoingOp;
   180     CImPop3Settings*                    iPopSettings;//owned
       
   181     CMsvOperation*                      iOngoingOp;//owned
   122 
   182 
   123     TPckgBuf<TPop3Progress>             iProgressBuf;
   183     TPckgBuf<TPop3Progress>             iProgressBuf;
   124     CMsvEntrySelection*                 iSelection;
   184     CMsvEntrySelection*                 iSelection;//owned
   125     TInt                                iError;
   185     TInt                                iError;
   126     CPop3ClientMtm*                     iPopClientMtm;
   186     CPop3ClientMtm*                     iPopClientMtm;//owned
   127     CClientMtmRegistry*                 iMtmReg;
   187     CClientMtmRegistry*                 iMtmReg;//owned
       
   188 	//</Qmail>
   128     TInt                                iPopulateLimit;
   189     TInt                                iPopulateLimit;
   129     
   190     
   130     };
   191     };
   131 
   192 
   132 
   193 
   133 #endif /*IPSSOSAOPOPAGENT_H_*/
   194 #endif /*IPSSOSAOPOPAGENT_H*/