epoc32/include/app/MVPbkContactViewObserver.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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 #endif  // MVPBKCONTACTVIEWOBSERVER_H
   124 
   125 // End of File