1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/app/MVPbkContactViewObserver.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,125 @@
1.4 +/*
1.5 +* Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: An observer interface for contact views.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef MVPBKCONTACTVIEWOBSERVER_H
1.23 +#define MVPBKCONTACTVIEWOBSERVER_H
1.24 +
1.25 +// INCLUDES
1.26 +#include <e32std.h>
1.27 +
1.28 +// FORWARD DECLARATIONS
1.29 +class MVPbkContactViewBase;
1.30 +class MVPbkContactLink;
1.31 +
1.32 +// CLASS DECLARATIONS
1.33 +
1.34 +/**
1.35 + * An observer interface for contact views.
1.36 + *
1.37 + * A client will receive events related to the view state and the view content
1.38 + * via this interface.
1.39 + * @see CVPbkContactManager::CreateContactViewLC
1.40 + */
1.41 +class MVPbkContactViewObserver
1.42 + {
1.43 + public: // Interface
1.44 + /**
1.45 + * Called when a view is ready for use.
1.46 + *
1.47 + * This function may also be called if view is already ready. Then
1.48 + * it means that the view has been updated and the observer have
1.49 + * to take this into account.
1.50 + *
1.51 + * @param aView A contact view sending the event.
1.52 + */
1.53 + virtual void ContactViewReady(
1.54 + MVPbkContactViewBase& aView ) = 0;
1.55 +
1.56 + /**
1.57 + * Called when a view is unavailable for a while.
1.58 + *
1.59 + * When the view is again available ContactViewReady will be called.
1.60 + * The contents of the view may change completely while it is
1.61 + * unavailable.
1.62 + *
1.63 + * @param aView A contact view sending the event.
1.64 + */
1.65 + virtual void ContactViewUnavailable(
1.66 + MVPbkContactViewBase& aView ) = 0;
1.67 +
1.68 + /**
1.69 + * Called when a contact has been added to the view.
1.70 + *
1.71 + * @param aView A contact view sending the event.
1.72 + * @param aIndex An index of the contact in the view.
1.73 + * @param aContactLink A link to the added contact that is
1.74 + * valid only during the functio call.
1.75 + */
1.76 + virtual void ContactAddedToView(
1.77 + MVPbkContactViewBase& aView,
1.78 + TInt aIndex,
1.79 + const MVPbkContactLink& aContactLink ) = 0;
1.80 +
1.81 + /**
1.82 + * Called when a contact has been removed from a view.
1.83 + *
1.84 + * @param aView A contact view sending the event.
1.85 + * @param aIndex An index of the removed contact.
1.86 + * @param aContactLink A link to the removed contact that is
1.87 + * valid only during this function call.
1.88 + */
1.89 + virtual void ContactRemovedFromView(
1.90 + MVPbkContactViewBase& aView,
1.91 + TInt aIndex,
1.92 + const MVPbkContactLink& aContactLink ) = 0;
1.93 +
1.94 + /**
1.95 + * Called when an error occurs in the view.
1.96 + *
1.97 + * If client decides to destroy the view then it should do
1.98 + * it asynchronously because the view can access member data
1.99 + * after a call to this.
1.100 + *
1.101 + * @param aView A contact view sending the event.
1.102 + * @param aError An error code of the failure.
1.103 + * @param aErrorNotified ETrue if the implementation has already
1.104 + * notified user about the error using e.g
1.105 + * an ECOM plug-in, EFalse otherwise.
1.106 + */
1.107 + virtual void ContactViewError(
1.108 + MVPbkContactViewBase& aView,
1.109 + TInt aError,
1.110 + TBool aErrorNotified ) = 0;
1.111 +
1.112 + /**
1.113 + * Returns an extension point for this interface or NULL.
1.114 + *
1.115 + * @param aExtensionUid no extensions defined currently.
1.116 + * @return an extension point for this interface or NULL.
1.117 + */
1.118 + virtual TAny* ContactViewObserverExtension(TUid /*aExtensionUid*/)
1.119 + { return NULL; }
1.120 +
1.121 + protected: // Destructor
1.122 + virtual ~MVPbkContactViewObserver() { }
1.123 +
1.124 + };
1.125 +
1.126 +#endif // MVPBKCONTACTVIEWOBSERVER_H
1.127 +
1.128 +// End of File