epoc32/include/app/MVPbkOperationObserver.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/MVPbkOperationObserver.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,96 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  Observer interfaces for asynchronous operations
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef VPBKOPERATIONOBSERVER_H
    1.23 +#define VPBKOPERATIONOBSERVER_H
    1.24 +
    1.25 +// INCLUDES
    1.26 +#include <e32base.h>
    1.27 +
    1.28 +class MVPbkContactOperationBase;
    1.29 +// CLASS DECLARATION
    1.30 +
    1.31 +/**
    1.32 + * An observer for asynchronous operations that do not return anything.
    1.33 + */
    1.34 +class MVPbkOperationObserver
    1.35 +    {
    1.36 +    public:
    1.37 +
    1.38 +    	/**
    1.39 +    	 * The operation was completed succesfully.
    1.40 +    	 * 
    1.41 +    	 * @param aOperation operation handle
    1.42 +    	 */
    1.43 +        virtual void VPbkOperationCompleted(
    1.44 +                MVPbkContactOperationBase* aOperation ) = 0;
    1.45 +
    1.46 +    protected:
    1.47 +        /* Destroying via this interface is not allowed */
    1.48 +        ~MVPbkOperationObserver(){}
    1.49 +    };
    1.50 +
    1.51 +/**
    1.52 + * An observer for asynchronous operations
    1.53 + * that return result of ResultType type.
    1.54 + */
    1.55 +template<typename ResultType>
    1.56 +class MVPbkOperationResultObserver
    1.57 +    {
    1.58 +    public:
    1.59 +
    1.60 +        /**
    1.61 +         * The operation was completed succesfully.
    1.62 +         * 
    1.63 +         * @param aOperation operation handle
    1.64 +         * @param aOperationResult operation result
    1.65 +         */
    1.66 +        virtual void VPbkOperationResultCompleted(
    1.67 +                MVPbkContactOperationBase* aOperation,
    1.68 +                ResultType aOperationResult ) = 0;
    1.69 +        
    1.70 +    protected:
    1.71 +        /* Destroying via this interface is not allowed */
    1.72 +        ~MVPbkOperationResultObserver(){}
    1.73 +    };
    1.74 +
    1.75 +/**
    1.76 + * An observer for asynchronous operations 
    1.77 + * to receive error notifications when an operation fails.
    1.78 + */
    1.79 +class MVPbkOperationErrorObserver
    1.80 +    {
    1.81 +    public:
    1.82 +        
    1.83 +        /**
    1.84 +         * An error occured in the operation that was requested.
    1.85 +         * 
    1.86 +         * @param aOperation operation handle 
    1.87 +         * @param aError Operation error code.
    1.88 +         */
    1.89 +        virtual void VPbkOperationFailed(
    1.90 +                MVPbkContactOperationBase* aOperation,
    1.91 +                TInt aError ) = 0;
    1.92 +        
    1.93 +    protected:
    1.94 +        /* Destroying via this interface is not allowed */
    1.95 +        ~MVPbkOperationErrorObserver(){}
    1.96 +    };
    1.97 +
    1.98 +#endif //VPBKOPERATIONOBSERVER_H
    1.99 +//End of file