serviceproviders/sapi_contacts_vpbk/contactservice/inc/contactsynccallback.h
changeset 19 989d2f495d90
child 22 fc9cf246af83
equal deleted inserted replaced
14:a36b1e19a461 19:989d2f495d90
       
     1 /*
       
     2 * Copyright (c) 2006 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 the License "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:  callback class implemented for synchronous api's.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CONTACTSYNCCALLBACK_H
       
    20 #define C_CONTACTSYNCCALLBACK_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include "contactcallback.h"
       
    24 /**
       
    25  *class CContactSyncCallback
       
    26  *class to implement the callback class which is needed in cases of synchronous implementation of the api's.
       
    27  */
       
    28  
       
    29 class CContactSyncCallback: public CBase ,public MContactCallback
       
    30     {
       
    31      public:
       
    32          /**
       
    33           *Default constructor.
       
    34           */
       
    35          CContactSyncCallback();
       
    36           /**
       
    37            *Destructor.
       
    38            */
       
    39          ~CContactSyncCallback();
       
    40          /**
       
    41           *Getter method to get a pointer to the iterator does a shallow copy.
       
    42           *@return value CContactIter*, an iterator class pointer.
       
    43           */
       
    44          CContactIter* GetIter();
       
    45          /**
       
    46           *Getter method to get error code.
       
    47           *@return value TInt, integer error code KErrNone if no error
       
    48           *occured else can be any system wide error code.
       
    49           */
       
    50          TInt GetErrorCode();
       
    51          /**
       
    52           *setter method for the wait shceduler shallow copy owned by core class.
       
    53           *@return void.
       
    54           */
       
    55          void SetWaitScheduler(CActiveSchedulerWait *aWaitScheduler);         
       
    56          
       
    57          /**
       
    58           *virtual method inherited from the MContactCallback interface class
       
    59           *called by the core class if any event occurs in the asynchronous call.
       
    60           *@param aError error code.
       
    61           *@param aTransId trasaction Id of the asychronous call.
       
    62           *@return void.
       
    63           */
       
    64          virtual void HandleReturnValue(TOperationEvent aEvent, const TInt& aError, TInt aTransId );
       
    65          /**
       
    66           *virtual method inherited from the MContactCallback interface class
       
    67           *called by the core class if any  asynchronous call completes successfully .
       
    68           *@param aError error code.
       
    69           *@param aIter pointer to the CContactIter class.
       
    70           *@param aTransId trasaction Id of the asychronous call.
       
    71           *@return void.
       
    72           */
       
    73          virtual void HandleReturnIter( const TInt& aError, CContactIter* aIter, TInt aTransId );
       
    74      private:
       
    75         //Pointer to the CContactIter class.
       
    76         CContactIter* iIter;
       
    77         //Integer error code.
       
    78         TInt iError;
       
    79         //Scheduler pointer owned by core class used by this class
       
    80         CActiveSchedulerWait *iWaitScheduler;
       
    81     public:
       
    82         TInt iErrKey;    
       
    83     };
       
    84 
       
    85 #endif    //C_CONTACTSYNCCALLBACK_H