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 contact views.
19 #ifndef MVPBKCONTACTVIEWOBSERVER_H
20 #define MVPBKCONTACTVIEWOBSERVER_H
25 // FORWARD DECLARATIONS
26 class MVPbkContactViewBase;
27 class MVPbkContactLink;
32 * An observer interface for contact views.
34 * A client will receive events related to the view state and the view content
36 * @see CVPbkContactManager::CreateContactViewLC
38 class MVPbkContactViewObserver
42 * Called when a view is ready for use.
44 * This function may also be called if view is already ready. Then
45 * it means that the view has been updated and the observer have
46 * to take this into account.
48 * @param aView A contact view sending the event.
50 virtual void ContactViewReady(
51 MVPbkContactViewBase& aView ) = 0;
54 * Called when a view is unavailable for a while.
56 * When the view is again available ContactViewReady will be called.
57 * The contents of the view may change completely while it is
60 * @param aView A contact view sending the event.
62 virtual void ContactViewUnavailable(
63 MVPbkContactViewBase& aView ) = 0;
66 * Called when a contact has been added to the view.
68 * @param aView A contact view sending the event.
69 * @param aIndex An index of the contact in the view.
70 * @param aContactLink A link to the added contact that is
71 * valid only during the functio call.
73 virtual void ContactAddedToView(
74 MVPbkContactViewBase& aView,
76 const MVPbkContactLink& aContactLink ) = 0;
79 * Called when a contact has been removed from a view.
81 * @param aView A contact view sending the event.
82 * @param aIndex An index of the removed contact.
83 * @param aContactLink A link to the removed contact that is
84 * valid only during this function call.
86 virtual void ContactRemovedFromView(
87 MVPbkContactViewBase& aView,
89 const MVPbkContactLink& aContactLink ) = 0;
92 * Called when an error occurs in the view.
94 * If client decides to destroy the view then it should do
95 * it asynchronously because the view can access member data
96 * after a call to this.
98 * @param aView A contact view sending the event.
99 * @param aError An error code of the failure.
100 * @param aErrorNotified ETrue if the implementation has already
101 * notified user about the error using e.g
102 * an ECOM plug-in, EFalse otherwise.
104 virtual void ContactViewError(
105 MVPbkContactViewBase& aView,
107 TBool aErrorNotified ) = 0;
110 * Returns an extension point for this interface or NULL.
112 * @param aExtensionUid no extensions defined currently.
113 * @return an extension point for this interface or NULL.
115 virtual TAny* ContactViewObserverExtension(TUid /*aExtensionUid*/)
118 protected: // Destructor
119 virtual ~MVPbkContactViewObserver() { }
123 #endif // MVPBKCONTACTVIEWOBSERVER_H