ipsservices/ipssosaoplugin/inc/IpsSosAOPopAgent.h
changeset 0 8466d47a6819
child 18 578830873419
child 63 d189ee25cf9d
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *     Contains pop specified sync logic
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef IPSSOSAOPOPAGENT_H_
       
    21 #define IPSSOSAOPOPAGENT_H_
       
    22 
       
    23 #include <pop3set.h>
       
    24 #include <mtclreg.h>
       
    25 
       
    26 #include "IpsSosAOBaseAgent.h"
       
    27 
       
    28 
       
    29 class CPop3ClientMtm;
       
    30 
       
    31 /**
       
    32 * class CIpsSosAOPopAgent;
       
    33 *
       
    34 * Is created by IpsSosAOBaseAgent, contains pop spesific 
       
    35 * implementations of base class pure virtual functions.
       
    36 *
       
    37 */
       
    38 class CIpsSosAOPopAgent : public CIpsSosAOBaseAgent
       
    39     {
       
    40 public:
       
    41     
       
    42     /**
       
    43     * Two phased constructor
       
    44     * @return self pointer
       
    45     */
       
    46     static CIpsSosAOPopAgent* NewL( 
       
    47             CMsvSession& aSession,
       
    48             MIpsSosAOAgentOperationResponse& aOpResponse,
       
    49             TMsvId aServiceId );
       
    50 
       
    51     /**
       
    52     * Destructor
       
    53     */
       
    54     virtual ~CIpsSosAOPopAgent();
       
    55     
       
    56 public: // from CIpsSosAOBaseAgent
       
    57     
       
    58     virtual void GetServerAddress( 
       
    59             TBuf<KIpsSosAOTextBufferSize>& aIncomingServer ) const;
       
    60     
       
    61     virtual void GetUsername( 
       
    62             TBuf8<KIpsSosAOTextBufferSize>& aUsername ) const;
       
    63     
       
    64     virtual TBool IsConnected() const;
       
    65     
       
    66     virtual void StartSyncL();
       
    67     
       
    68     virtual void StartFetchMessagesL( const RArray<TMsvId>& aFetchMsgArray );
       
    69     
       
    70     virtual void CancelAllAndDisconnectL();
       
    71     
       
    72     virtual void CancelAllAndDoNotDisconnect();
       
    73     
       
    74     virtual void DoNotDisconnect();
       
    75     
       
    76     virtual void ClearDoNotDisconnect();
       
    77     
       
    78     virtual void HoldOperations();
       
    79 
       
    80     virtual void ContinueHoldOperations();
       
    81     
       
    82     virtual CIpsSosAOBaseAgent::TAgentState GetState() const;
       
    83     
       
    84     virtual void LoadSettingsL();
       
    85     
       
    86 private:
       
    87 
       
    88     /**
       
    89     * Constructor
       
    90     */
       
    91     CIpsSosAOPopAgent(             
       
    92             CMsvSession& aSession,
       
    93             MIpsSosAOAgentOperationResponse& aOpResponse,
       
    94             TMsvId aServiceId );
       
    95 
       
    96     /**
       
    97     * Second phase constructor
       
    98     */
       
    99     void ConstructL();
       
   100     
       
   101     virtual void DoCancel();
       
   102     
       
   103     virtual void RunL();
       
   104     
       
   105     virtual TInt RunError( TInt aError );
       
   106 
       
   107     void PopulateAllL();
       
   108     
       
   109     inline void SetActiveAndCompleteThis();
       
   110     
       
   111     
       
   112 private:
       
   113     
       
   114     CMsvSession&                        iSession;
       
   115     MIpsSosAOAgentOperationResponse&    iOpResponse;
       
   116     TMsvId                              iServiceId;
       
   117     TBool                               iSyncStartedSignaled;
       
   118     TAgentState                         iState;
       
   119     TBool                               iDoNotDisconnect;
       
   120     CImPop3Settings*                    iPopSettings;
       
   121     CMsvOperation*                      iOngoingOp;
       
   122 
       
   123     TPckgBuf<TPop3Progress>             iProgressBuf;
       
   124     CMsvEntrySelection*                 iSelection;
       
   125     TInt                                iError;
       
   126     CPop3ClientMtm*                     iPopClientMtm;
       
   127     CClientMtmRegistry*                 iMtmReg;
       
   128     TInt                                iPopulateLimit;
       
   129     
       
   130     };
       
   131 
       
   132 
       
   133 #endif /*IPSSOSAOPOPAGENT_H_*/