contacts_plat/virtual_phonebook_engine_api/inc/MVPbkContactViewObserver.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2004-2007 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 "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:  An observer interface for contact views.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MVPBKCONTACTVIEWOBSERVER_H
       
    20 #define MVPBKCONTACTVIEWOBSERVER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MVPbkContactViewBase;
       
    27 class MVPbkContactLink;
       
    28 
       
    29 // CLASS DECLARATIONS
       
    30 
       
    31 /**
       
    32  * An observer interface for contact views.
       
    33  *
       
    34  * A client will receive events related to the view state and the view content
       
    35  * via this interface.
       
    36  * @see CVPbkContactManager::CreateContactViewLC
       
    37  */
       
    38 class MVPbkContactViewObserver
       
    39     {
       
    40     public: // Interface
       
    41         /**
       
    42          * Called when a view is ready for use.
       
    43          *
       
    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.
       
    47          *
       
    48          * @param aView A contact view sending the event.
       
    49          */
       
    50         virtual void ContactViewReady(
       
    51                 MVPbkContactViewBase& aView ) = 0;
       
    52 
       
    53         /**
       
    54          * Called when a view is unavailable for a while.
       
    55          *
       
    56          * When the view is again available ContactViewReady will be called.
       
    57          * The contents of the view may change completely while it is
       
    58          * unavailable.
       
    59          *
       
    60          * @param aView A contact view sending the event.
       
    61          */
       
    62         virtual void ContactViewUnavailable(
       
    63                 MVPbkContactViewBase& aView ) = 0;
       
    64 
       
    65         /**
       
    66          * Called when a contact has been added to the view.
       
    67          *
       
    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.
       
    72          */
       
    73         virtual void ContactAddedToView(
       
    74                 MVPbkContactViewBase& aView,
       
    75                 TInt aIndex,
       
    76                 const MVPbkContactLink& aContactLink ) = 0;
       
    77 
       
    78         /**
       
    79          * Called when a contact has been removed from a view.
       
    80          *
       
    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.
       
    85          */
       
    86         virtual void ContactRemovedFromView(
       
    87                 MVPbkContactViewBase& aView,
       
    88                 TInt aIndex,
       
    89                 const MVPbkContactLink& aContactLink ) = 0;
       
    90 
       
    91         /**
       
    92          * Called when an error occurs in the view.
       
    93          *
       
    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.
       
    97          *
       
    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.
       
   103          */
       
   104         virtual void ContactViewError(
       
   105                 MVPbkContactViewBase& aView,
       
   106                 TInt aError,
       
   107                 TBool aErrorNotified ) = 0;
       
   108 
       
   109         /**
       
   110          * Returns an extension point for this interface or NULL.
       
   111          *
       
   112          * @param aExtensionUid no extensions defined currently.
       
   113          * @return an extension point for this interface or NULL.
       
   114          */
       
   115         virtual TAny* ContactViewObserverExtension(TUid /*aExtensionUid*/)
       
   116                 { return NULL; }
       
   117 
       
   118     protected: // Destructor
       
   119         virtual ~MVPbkContactViewObserver() { }
       
   120 
       
   121     };
       
   122 
       
   123 
       
   124 
       
   125 /// Use this UID to access base contact extension 2.
       
   126 // Used as a parameter to ContactViewObserverExtension() method.
       
   127 const TUid KVPbkContactViewObserverExtension2Uid = { 2 };
       
   128 
       
   129 /**
       
   130  * This class is an extension to MVPbkContactViewObserver.
       
   131  *
       
   132  * @see MVPbkContactViewObserver
       
   133  *
       
   134  */
       
   135 class MVPbkContactViewObserverExtension
       
   136     {
       
   137     protected:  // Destructor
       
   138         virtual ~MVPbkContactViewObserverExtension() { }
       
   139 
       
   140     public:
       
   141 
       
   142         /**
       
   143          * Called when filtered contact removed from view
       
   144          */
       
   145         virtual void FilteredContactRemovedFromView( MVPbkContactViewBase& aView ) = 0;
       
   146     };
       
   147 
       
   148 
       
   149 #endif  // MVPBKCONTACTVIEWOBSERVER_H
       
   150 
       
   151 // End of File