ImagePrint/ImagePrintEngine/ImagePrintServer/inc/cserveridleguard.h
branchRCL_3
changeset 28 d59c248c9d36
parent 0 d11fb78c4374
equal deleted inserted replaced
27:159fc2f68139 28:d59c248c9d36
       
     1 /*
       
     2 * Copyright (c) 2004-2007 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 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSERVERIDLEGUARD_H
       
    20 #define CSERVERIDLEGUARD_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "imageprint.h"
       
    25 #include "tidleguarddata.h"
       
    26 
       
    27 class TEvent;
       
    28 class CImagePrintBody;
       
    29 class TMessageWrp2;
       
    30 
       
    31 class CServerIdleGuard : public CBase, public MIdleObserver
       
    32 	{
       
    33 	public:
       
    34 		
       
    35 		/**
       
    36 		 *	2-phase constructor
       
    37 		 *
       
    38 		 *	@param aEngine printing engine
       
    39 		 *	@return new object
       
    40 		 */
       
    41 		static CServerIdleGuard* NewL( CImagePrintBody& aEngine );
       
    42 		
       
    43 		/**
       
    44 		 *	Destructor		 
       
    45 		 */
       
    46 		~CServerIdleGuard();
       
    47 
       
    48 	private: // from MIdleObserver
       
    49 		
       
    50 		void StatusEvent(const TEvent &aEvent, TInt aError, TInt aMsgCode);
       
    51 		
       
    52 	public:
       
    53 	
       
    54 		/**
       
    55 		 *	Start and continue waiting for idle events
       
    56 		 *
       
    57 		 *	@param aMessage message completed upon event arrival
       
    58 		 */
       
    59 		void Guard( TMessageWrp2& aMessage );
       
    60 		
       
    61 		/**
       
    62 		 *	Stop waiting for idle events. Cancel waiting message
       
    63 		 */
       
    64 		void Stop();
       
    65 
       
    66 	private:
       
    67 
       
    68 		CServerIdleGuard( CImagePrintBody& aEngine );
       
    69 		void ConstructL();
       
    70 		void DoStatusEventL( const TEvent &aEvent, TInt aError, TInt aMsgCode );
       
    71 		void Process( TInt aErr = KErrNone );
       
    72 		void DoProcessL();
       
    73 		
       
    74 	private: // data
       
    75 	
       
    76 		CImagePrintBody& iEngine;
       
    77 		TMessageWrp2* iMessage;
       
    78 		RArray<TIdleGuardData> iBuffer;
       
    79 		TBool iRequestActive;
       
    80 	};
       
    81 
       
    82 
       
    83 #endif // CSERVERIDLEGUARD_H
       
    84 
       
    85 //  End of File