ImagePrint/ImagePrintEngine/ImagePrintServer/inc/cdiscoveryguard.h
branchGCC_SURGE
changeset 25 59ea2209bb67
parent 23 08cc4cc059d4
parent 15 a92d00fca574
equal deleted inserted replaced
23:08cc4cc059d4 25:59ea2209bb67
     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 CDISCOVERYGUARD_H
       
    20 #define CDISCOVERYGUARD_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class RImagePrintClient;
       
    25 class MPrinterDiscoveryObserver;
       
    26 class TDiscoveryGuardData;
       
    27 
       
    28 class CDiscoveryGuard : public CActive
       
    29 	{
       
    30 	public:
       
    31 
       
    32 		/**
       
    33          *	2-phase constructor
       
    34          *	
       
    35 		 *	@param aClient client for communication with server process 
       
    36          *  @return new object
       
    37          */
       
    38 		IMPORT_C static CDiscoveryGuard* NewL( RImagePrintClient& aClient );
       
    39 		
       
    40 		/**
       
    41          *	Destructor         
       
    42          */
       
    43 		IMPORT_C ~CDiscoveryGuard();	
       
    44 		
       
    45 	public:
       
    46 	
       
    47 		/**
       
    48          *	Start printer discovery (and watching for discovery events)
       
    49          *	for one or several protocols
       
    50          *	
       
    51 		 *	@param aObserver observer for notifications about discovery events
       
    52 		 *	@param aProtocols OR:ed protocol ids
       
    53          *  @return error code
       
    54          */
       
    55 		IMPORT_C TInt Guard( MPrinterDiscoveryObserver& aObserver, TUint aProtocols );
       
    56 
       
    57 	private:
       
    58 
       
    59 		CDiscoveryGuard( RImagePrintClient& aClient );
       
    60 		void ConstructL();
       
    61 		
       
    62 	private: // from CActive
       
    63 	
       
    64 		void RunL();
       
    65 		void DoCancel();
       
    66 		
       
    67 	private: // data
       
    68 	
       
    69 		RImagePrintClient& iClient;
       
    70 		MPrinterDiscoveryObserver* iObserver;
       
    71 		TDiscoveryGuardData* iData;
       
    72 	};
       
    73 
       
    74 
       
    75 #endif // CDISCOVERYGUARD_H
       
    76 
       
    77 //  End of File