phonebookengines/VirtualPhonebook/inc/MVPbkSimViewObserver.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2002-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 API for view events
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MVPBKSIMVIEWOBSERVER_H
       
    21 #define MVPBKSIMVIEWOBSERVER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32std.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MVPbkSimCntView;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  An observer API for view events
       
    33 *
       
    34 */
       
    35 class MVPbkSimViewObserver
       
    36     {
       
    37     public: // Types
       
    38 
       
    39         /**
       
    40         * SIM contact events
       
    41         */
       
    42         enum TEvent
       
    43             {
       
    44             /// Unknown operation
       
    45             EUnknown = 0,
       
    46             /// A contact was added to the view
       
    47             EContactAdded,
       
    48             /// A contact was deleted from the view
       
    49             EContactDeleted,
       
    50             };
       
    51 
       
    52     public: // New functions
       
    53         
       
    54         /**
       
    55         * Called after the view is succesfully created
       
    56         * @param aView the view that was created
       
    57         */
       
    58         virtual void ViewReady( MVPbkSimCntView& aView ) = 0;
       
    59 
       
    60         /**
       
    61         * Called if there was an error in view creation
       
    62         * @param aView the view that fail to open
       
    63         * @param aError a system wide error code for failure
       
    64         */
       
    65         virtual void ViewError( MVPbkSimCntView& aView, TInt aError ) = 0;
       
    66 
       
    67         /**
       
    68         * Called if the view is not available. E.g. SAT refresh happens.
       
    69         * @param aView the view that is not available
       
    70         */
       
    71         virtual void ViewNotAvailable( MVPbkSimCntView& aView ) = 0;
       
    72 
       
    73         /**
       
    74         * Called when there is changes in the view
       
    75         * @param aEvent the view event
       
    76         * @param the view index that changed
       
    77         * @param the changed contact sim index
       
    78         */
       
    79         virtual void ViewContactEvent( TEvent aEvent, TInt aIndex, 
       
    80             TInt aSimIndex ) = 0;
       
    81 
       
    82     protected:    // Destruction
       
    83 
       
    84         /**
       
    85         * Destructor.
       
    86         */
       
    87         virtual ~MVPbkSimViewObserver() {}
       
    88     };
       
    89 
       
    90 #endif      // MVPBKSIMVIEWOBSERVER_H
       
    91             
       
    92 // End of File