2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: An observer interface for asynchronous single contact
20 #ifndef MVPBKSINGLECONTACTOPERATIONOBSERVER_H
21 #define MVPBKSINGLECONTACTOPERATIONOBSERVER_H
26 // FORWARD DECLARATIONS
27 class MVPbkContactOperationBase;
28 class MVPbkStoreContact;
33 * An observer interface for asynchronous single contact operations.
35 * The interface is used in asynchronous operations that are related
38 class MVPbkSingleContactOperationObserver
42 * Called when the operation is completed.
44 * A client has the operation as a member and it can delete the operation
45 * instance in this function call. If the implementation of the store
46 * calls the function from the operation instance it must not handle
47 * any member data after calling it.
49 * @param aOperation The completed operation.
50 * @param aContact The contact returned by the operation.
51 * A client must take the ownership immediately.
54 * If you use CleanupStack for MVPbkStoreContact
55 * Use MVPbkStoreContact::PushL or
56 * CleanupDeletePushL from e32base.h.
57 * (Do Not Use CleanupStack::PushL(TAny*) because
58 * then the virtual destructor of the M-class
59 * won't be called when the object is deleted).
61 virtual void VPbkSingleContactOperationComplete(
62 MVPbkContactOperationBase& aOperation,
63 MVPbkStoreContact* aContact ) = 0;
66 * Called if the operation fails.
68 * A client has the operation as a member and it can delete the operation
69 * instance in this function call. If the implementation of the store
70 * calls the function from the operation instance it must not handle
71 * any member data after calling it.
73 * @param aOperation The failed operation.
74 * @param aError An error code of the failure.
76 virtual void VPbkSingleContactOperationFailed(
77 MVPbkContactOperationBase& aOperation,
81 * Returns an extension point for this interface or NULL.
83 * @param aExtensionUid no extensions defined currently.
84 * @return An extension point for this interface or NULL.
86 virtual TAny* SingleContactOperationObserverExtension(
87 TUid /*aExtensionUid*/ ) { return NULL; }
89 protected: // Destructor
90 virtual ~MVPbkSingleContactOperationObserver() { }
94 #endif // MVPBKSINGLECONTACTOPERATIONOBSERVER_H