epoc32/include/app/MVPbkBatchOperationObserver.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/MVPbkBatchOperationObserver.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,98 @@
     1.4 +/*
     1.5 +* Copyright (c) 2002-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:  Virtual Phonebook observer interface for batch operations.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +#ifndef MVPBKBATCHOPERATIONOBSERVER_H
    1.24 +#define MVPBKBATCHOPERATIONOBSERVER_H
    1.25 +
    1.26 +// INCLUDES
    1.27 +#include <e32cmn.h>
    1.28 +
    1.29 +// FORWARD DECLARATIONS
    1.30 +class MVPbkContactOperationBase;
    1.31 +class MVPbkStoreContact;
    1.32 +
    1.33 +// CLASS DECLARATIONS
    1.34 +
    1.35 +/**
    1.36 + * Virtual Phonebook asynchronous multi contact operation observer interface.
    1.37 + * This observer interface is used to signal the client during a 
    1.38 + * batch operation, which involves operations to e.g. multiple contacts.
    1.39 + * The client is signaled during the operations steps and then signaled
    1.40 + * of the completion of the whole operation.
    1.41 + */
    1.42 +class MVPbkBatchOperationObserver
    1.43 +    {
    1.44 +    public:  // Interface
    1.45 +        /**
    1.46 +         * Called when one step of the operation is completed.
    1.47 +         *
    1.48 +         * @param aOperation Operation whose step has completed
    1.49 +         * @param aStepSize Size of the performed step
    1.50 +         */
    1.51 +        virtual void StepComplete( 
    1.52 +                MVPbkContactOperationBase& aOperation,
    1.53 +                TInt aStepSize ) = 0;
    1.54 +
    1.55 +        /**
    1.56 +         * Called when one step of the operation fails.
    1.57 +         *
    1.58 +         * @param aOperation Operation whose step has failed
    1.59 +         * @param aStepSize Size of the performed step
    1.60 +         * @param aError Error that occured
    1.61 +         * @return ETrue if the batch operation should continue, 
    1.62 +         *               EFalse otherwise
    1.63 +         *         NOTE! If returning ETrue the operation can NOT be deleted.
    1.64 +         *               Operation should be deleted in OperationCompleted() 
    1.65 +         *               function.
    1.66 +         *               If returning EFalse the operation can be deleted
    1.67 +         *               safely.
    1.68 +         */
    1.69 +        virtual TBool StepFailed(
    1.70 +                MVPbkContactOperationBase& aOperation,
    1.71 +                TInt aStepSize, TInt aError ) = 0;
    1.72 +
    1.73 +        /**
    1.74 +         * Called when operation is completed.
    1.75 +         * This is called when all steps are executed. If EFalse is returned
    1.76 +         * in StepFailed() call this function is NOT called.
    1.77 +         *
    1.78 +         * @param aOperation    the completed operation
    1.79 +         */
    1.80 +        virtual void OperationComplete( 
    1.81 +                MVPbkContactOperationBase& aOperation ) = 0;
    1.82 +
    1.83 +        /**
    1.84 +         * Returns an extension point for this interface or NULL.
    1.85 +         * @param aExtensionUid Uid of extension
    1.86 +         * @return Extension point or NULL
    1.87 +         */
    1.88 +        virtual TAny* BatchOperationObserverExtension( 
    1.89 +                TUid /*aExtensionUid*/ ) { return NULL; }
    1.90 +
    1.91 +    protected:  // Destructor
    1.92 +        /**
    1.93 +         * Destructor.
    1.94 +         */
    1.95 +        virtual ~MVPbkBatchOperationObserver() { }
    1.96 +
    1.97 +    };
    1.98 +
    1.99 +#endif // MVPBKBATCHOPERATIONOBSERVER_H
   1.100 +
   1.101 +// End of file