email/pop3andsmtpmtm/autosend/inc/autosend.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __AUTOSEND_H__
       
    17 #define __AUTOSEND_H__
       
    18 
       
    19 #if !defined(_MSG_NO_LOGGING) || defined(_DEBUG)
       
    20 #define AUTOSEND_LOGGING
       
    21 #endif
       
    22 const TInt KDefaultPriority = CActive::EPriorityStandard;
       
    23 
       
    24 _LIT(KMsvWinsAutoSendThreadName, "AutoSend");
       
    25 
       
    26 class CClientMtmRegistry;
       
    27 
       
    28 TInt Execute(const TMsvId aDestinationId);
       
    29 void DoExecuteL(const TMsvId aDestinationId);
       
    30 
       
    31 class TDummyMsvSessionObserver : public MMsvSessionObserver
       
    32 	{
       
    33 public:
       
    34 	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny *aArg1, TAny *aArg2, TAny *aArg3);
       
    35 	};
       
    36 
       
    37 /**
       
    38 @internalComponent
       
    39 @released
       
    40 */
       
    41 class CAutoSendProgressTimer : public CTimer
       
    42 	{
       
    43 public:
       
    44 	static CAutoSendProgressTimer* NewL(CMsvOperation& aOperation, const TTimeIntervalMicroSeconds32& aPollInterval);
       
    45 	void Start();
       
    46 	~CAutoSendProgressTimer();
       
    47 	
       
    48 private:
       
    49 	CAutoSendProgressTimer(CMsvOperation& aOperation, const TTimeIntervalMicroSeconds32& aPollInterval);
       
    50 	void RunL();
       
    51 	CMsvOperation& iOperation;
       
    52 	TTimeIntervalMicroSeconds32 iPollInterval;
       
    53 	};
       
    54 
       
    55 /**
       
    56 @internalComponent
       
    57 @released
       
    58 */
       
    59 class CImAutoSend : public MMsvSessionObserver, CActive
       
    60 	{
       
    61 public:	
       
    62 	static CImAutoSend* StartLC(const TMsvId aDestinationId);
       
    63 	~CImAutoSend();
       
    64 
       
    65 	void HandleSessionEventL(MMsvSessionObserver::TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) {};
       
    66 	TBool IsSendActive() {return IsActive();}
       
    67 
       
    68 private:
       
    69 
       
    70 	CImAutoSend(const TMsvId aDestinationId);
       
    71 	void ConstructL();
       
    72 
       
    73 	void DoCancel();
       
    74 	void RunL();
       
    75 
       
    76 	void CallMtmL();
       
    77 
       
    78 #ifdef AUTOSEND_LOGGING
       
    79 	void FLog(const TDesC& buf);
       
    80 	void FLog(TRefByValue<const TDesC> aFormat, ...);
       
    81 #endif
       
    82 
       
    83 private:
       
    84 	CMsvSession*			iSession;
       
    85 	CMsvOperation*			iOperation;
       
    86 	CAutoSendProgressTimer*	iTimer;
       
    87 	TMsvId					iDestinationId;
       
    88 	CActiveSchedulerWait	iActiveSchedulerWait;
       
    89 	};
       
    90 
       
    91 #endif