epoc32/include/app/MVPbkOperationObserver.h
branchSymbian3
changeset 4 837f303aceeb
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Observer interfaces for asynchronous operations
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef VPBKOPERATIONOBSERVER_H
       
    20 #define VPBKOPERATIONOBSERVER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 class MVPbkContactOperationBase;
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    29  * An observer for asynchronous operations that do not return anything.
       
    30  */
       
    31 class MVPbkOperationObserver
       
    32     {
       
    33     public:
       
    34 
       
    35     	/**
       
    36     	 * The operation was completed succesfully.
       
    37     	 * 
       
    38     	 * @param aOperation operation handle
       
    39     	 */
       
    40         virtual void VPbkOperationCompleted(
       
    41                 MVPbkContactOperationBase* aOperation ) = 0;
       
    42 
       
    43     protected:
       
    44         /* Destroying via this interface is not allowed */
       
    45         ~MVPbkOperationObserver(){}
       
    46     };
       
    47 
       
    48 /**
       
    49  * An observer for asynchronous operations
       
    50  * that return result of ResultType type.
       
    51  */
       
    52 template<typename ResultType>
       
    53 class MVPbkOperationResultObserver
       
    54     {
       
    55     public:
       
    56 
       
    57         /**
       
    58          * The operation was completed succesfully.
       
    59          * 
       
    60          * @param aOperation operation handle
       
    61          * @param aOperationResult operation result
       
    62          */
       
    63         virtual void VPbkOperationResultCompleted(
       
    64                 MVPbkContactOperationBase* aOperation,
       
    65                 ResultType aOperationResult ) = 0;
       
    66         
       
    67     protected:
       
    68         /* Destroying via this interface is not allowed */
       
    69         ~MVPbkOperationResultObserver(){}
       
    70     };
       
    71 
       
    72 /**
       
    73  * An observer for asynchronous operations 
       
    74  * to receive error notifications when an operation fails.
       
    75  */
       
    76 class MVPbkOperationErrorObserver
       
    77     {
       
    78     public:
       
    79         
       
    80         /**
       
    81          * An error occured in the operation that was requested.
       
    82          * 
       
    83          * @param aOperation operation handle 
       
    84          * @param aError Operation error code.
       
    85          */
       
    86         virtual void VPbkOperationFailed(
       
    87                 MVPbkContactOperationBase* aOperation,
       
    88                 TInt aError ) = 0;
       
    89         
       
    90     protected:
       
    91         /* Destroying via this interface is not allowed */
       
    92         ~MVPbkOperationErrorObserver(){}
       
    93     };
       
    94 
       
    95 #endif //VPBKOPERATIONOBSERVER_H
       
    96 //End of file