2 * Copyright (c) 2002-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: Virtual Phonebook observer interface for contact
15 * operations (Delete, Commit...).
20 #ifndef MVPBKCONTACTOBSERVER_H
21 #define MVPBKCONTACTOBSERVER_H
27 // FORWARD DECLARATIONS
28 class MVPbkStoreContact;
34 * Virtual Phonebook Contact operation observer interface.
35 * This interface is used to signal the contact operation client
38 class MVPbkContactObserver
42 * Operation codes for Contact operation observers.
47 EContactOperationUnknown = 0,
48 /// See MVPbkViewContact::ReadL
50 /// See MVPbkViewContact::ReadAndLockL
52 /// See MVPbkBaseContact::DeleteL
54 /// See MVPbkStoreContact::LockL
56 /// See MVPbkStoreContact::Commit
58 /// See MVPbkContactStore::SetOwnContacL
62 /// Forward declaration for MVPbkContactObserver::TResult extension
66 * Result object for Contact operation observers.
68 struct TContactOpResult
70 ///Own: Operation code
74 * New Store Contact object.
75 * Set if iOpCode is EContactRead or EContactReadAndLock.
76 * If set client takes ownership of the object.
78 MVPbkStoreContact* iStoreContact;
80 ///Own: Reserved for Extension
81 TResultExt* iExtension;
86 * Called when a contact operation has succesfully completed.
88 * NOTE: If you use Cleanupstack for MVPbkStoreContact use
89 * MVPbkStoreContact::PushL or CleanupDeletePushL from e32base.h.
90 * (Do Not Use CleanupStack::PushL(TAny*) because then the virtual
91 * destructor of the M-class won't be called when the object
94 * @param aResult The result of the operation. The client takes
95 * the ownership of the iStoreContact immediately
98 virtual void ContactOperationCompleted(TContactOpResult aResult) =0;
101 * Called when a contact operation has failed.
103 * @param aOpCode The operation that failed.
104 * @param aErrorCode System error code of the failure.
105 * KErrAccessDenied when EContactCommit
106 * means that contact hasn't been locked.
107 * @param aErrorNotified ETrue if the implementation has already
108 * notified user about the error,
111 virtual void ContactOperationFailed
112 (TContactOp aOpCode, TInt aErrorCode, TBool aErrorNotified) =0;
115 * Returns an extension point for this interface or NULL.
116 * @param aExtensionUid Uid of extension.
117 * @return Extension point or NULL.
119 virtual TAny* ContactObserverExtension(
120 TUid /*aExtensionUid*/) { return NULL; }
122 protected: // Destructor
126 virtual ~MVPbkContactObserver() { }
130 #endif // MVPBKCONTACTOBSERVER_H