phonebookengines/VirtualPhonebook/inc/MVPbkSimCntView.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     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 API for sim views
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MVPBKSIMCNTVIEW_H
       
    21 #define MVPBKSIMCNTVIEW_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32std.h>
       
    25 #include <bamdesca.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MVPbkSimViewObserver;
       
    29 class MVPbkSimCntStore;
       
    30 class RVPbkSimFieldTypeArray;
       
    31 class MVPbkSimContact;
       
    32 class MVPbkSimStoreOperation;
       
    33 class MDesCArray;
       
    34 class MVPbkSimViewFindObserver;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 *  An API for sim views
       
    40 *
       
    41 */
       
    42 class MVPbkSimCntView
       
    43     {
       
    44     public:  // Constructors and destructor
       
    45         
       
    46         /**
       
    47         * Destructor. Use Close() to release resources
       
    48         */
       
    49         virtual ~MVPbkSimCntView() {}
       
    50 
       
    51     public: // New functions
       
    52         
       
    53         /**
       
    54         * Returns the name of the view so that the client can use
       
    55         * the identified view.
       
    56         * @return the name of the view or KNullDesC
       
    57         */
       
    58         virtual const TDesC& Name() const = 0;
       
    59         
       
    60         /**
       
    61         * Returns the parent store of this view
       
    62         * @return the parent store of this view
       
    63         */ 
       
    64         virtual MVPbkSimCntStore& ParentStore() const = 0;
       
    65 
       
    66         /**
       
    67         * Starts sorting the view.
       
    68         * @param aObserver the observer that is notified after view is ready
       
    69         */
       
    70         virtual void OpenL( MVPbkSimViewObserver& aObserver ) = 0;
       
    71         
       
    72         /**
       
    73         * Releases resources.
       
    74         * @param aObserver the observer to be removed. The view must not be
       
    75         *        accessed after this
       
    76         */
       
    77         virtual void Close( MVPbkSimViewObserver& aObserver ) = 0;
       
    78         
       
    79         /**
       
    80         * Returns the amount of contacts in the view
       
    81         * @return the amount of contacts in the view
       
    82         */
       
    83         virtual TInt CountL() const = 0;
       
    84 
       
    85         /**
       
    86         * Returns the view contact in the specified location. View contact
       
    87         * contains fields that are defined in the sort order
       
    88         * @param aIndex the view index of the contact
       
    89         * @return the contact in the specified location. The reference is
       
    90         *         valid only until next ContactAtL call!
       
    91         */
       
    92         virtual MVPbkSimContact& ContactAtL( TInt aIndex ) = 0;
       
    93 
       
    94         /**
       
    95         * Changes the sort order of the view. The view will become unavailable
       
    96         * while reordering contacts
       
    97         * @param aSortOrder the new sort order.
       
    98         */ 
       
    99         virtual void ChangeSortOrderL( 
       
   100             const RVPbkSimFieldTypeArray& aSortOrder ) = 0;
       
   101 
       
   102         /**
       
   103         * Maps the sim index to index of the view contact
       
   104         * @param aSimIndex the sim index of the contact
       
   105         * @return the view index of the contact or KErrNotFound
       
   106         */
       
   107         virtual TInt MapSimIndexToViewIndexL( TInt aSimIndex ) = 0;
       
   108         
       
   109         /**
       
   110         * Contact matching prefix
       
   111         *
       
   112         * @param aFindStrings
       
   113         * @param aObserver
       
   114         * @return MVPbkSimStoreOperation
       
   115         */
       
   116         virtual MVPbkSimStoreOperation* ContactMatchingPrefixL(
       
   117                 const MDesCArray& aFindStrings, 
       
   118                 MVPbkSimViewFindObserver& aObserver ) = 0;
       
   119         
       
   120         /**
       
   121         * Returns the sort order of the view
       
   122         *
       
   123         * @return the sort order of the view.
       
   124         */
       
   125         virtual const RVPbkSimFieldTypeArray& SortOrderL() const = 0;
       
   126     };
       
   127 
       
   128 #endif      // MVPBKSIMCNTVIEW_H
       
   129             
       
   130 // End of File