wvuing/wvuistorage/inc/MCAContactList.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Contact data container implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MCACONTACTLIST_H
       
    21 #define MCACONTACTLIST_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "TStorageManagerGlobals.h"
       
    25 
       
    26 #include <e32base.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MCAStoredContact;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34  *  Contact list data interface
       
    35  *
       
    36  *  @lib CAStorage.dll
       
    37  *  @since 3.0
       
    38  */
       
    39 class MCAContactList
       
    40     {
       
    41     public: // Definitions
       
    42 
       
    43         enum TSynchroniseState
       
    44             {
       
    45             ESynchroniseNotDone,
       
    46             ESynchroniseDone,
       
    47             ESynchroniseFailed
       
    48             };
       
    49 
       
    50     public: // New functions
       
    51 
       
    52         /**
       
    53          * List id of contact list
       
    54          * @return List id of contact list.
       
    55          */
       
    56         virtual const TDesC& ListId() const = 0;
       
    57 
       
    58         /**
       
    59          * Displayname of contact list
       
    60          * @return  Display name of list.
       
    61          *          If displayname is not set, Id part of list id is returned.
       
    62          */
       
    63         virtual TPtrC DisplayName() const = 0;
       
    64 
       
    65         /**
       
    66          * Set display name of list.
       
    67          * @param aDisplayName, new name of list.
       
    68          */
       
    69         virtual void SetDisplayNameL( const TDesC& aDisplayName ) = 0;
       
    70 
       
    71         /**
       
    72          * Is list collapsed or not.
       
    73          * @return ETrue, if collapsed, EFalse if expanded
       
    74          */
       
    75         virtual TBool Collapsed() const = 0;
       
    76 
       
    77         /**
       
    78          * Set list collapse status
       
    79          * @param aCollapsed. ETrue when collapsed, EFalse if expanded
       
    80          */
       
    81         virtual void SetCollapsed( TBool aCollapsed ) = 0;
       
    82 
       
    83         /**
       
    84          * Count of items in list
       
    85          * @return count of contacts.
       
    86          */
       
    87         virtual TInt Count() const = 0;
       
    88 
       
    89         /**
       
    90          * Get list item by index from list.
       
    91          * @param  aIndex. Index of item.
       
    92          * @return Contact in index.
       
    93          */
       
    94         virtual MCAStoredContact& operator[]( TInt aIndex ) const = 0;
       
    95 
       
    96         /**
       
    97          * Get Filtered list item by index from list
       
    98          * @param aIndex. Index of Filtered item.
       
    99          * @param aFilter. Filters the contacts according to this filter.
       
   100          * @return contact in index upon the filter.
       
   101          */
       
   102         virtual MCAStoredContact& FilteredContact(
       
   103             TInt aIndex, TStorageManagerGlobals::TFilterType aFilter ) const = 0;
       
   104 
       
   105         /**
       
   106          * Count of non-blocked items in list
       
   107          * @return count of non-blocked contacts
       
   108          */
       
   109         virtual TInt FilteredCount( TStorageManagerGlobals::TFilterType aFilter ) const = 0;
       
   110 
       
   111         /**
       
   112          * Get amount of pending messages in list. Sum of all contacts pendingmessages in list
       
   113          */
       
   114         virtual TInt PendingMessages() const = 0;
       
   115 
       
   116         /**
       
   117          * Sort items by currently active sort algorithm.
       
   118          */
       
   119         virtual void Sort() = 0;
       
   120 
       
   121         /**
       
   122          * Resort one contact in the contact list
       
   123          */
       
   124         virtual void ResortContact( MCAStoredContact* aContact ) = 0;
       
   125         virtual void ResortUnKnownContact( MCAStoredContact* aContact ) = 0;
       
   126 
       
   127         /**
       
   128          * Is list selected or not
       
   129          * @return ETrue if selected, EFalse if not.
       
   130          */
       
   131         virtual TBool Selected() const = 0;
       
   132 
       
   133         /**
       
   134          * Set selected status of list.
       
   135          * @param aSelected ETrue if selected, EFalse if not.
       
   136          */
       
   137         virtual void SetSelected( TBool aSelected ) = 0;
       
   138 
       
   139         /**
       
   140          * Find index of contact in list.
       
   141          * @param aContact. Contact item to be found.
       
   142          * @param aFilter. Filters the contacts according to this filter.
       
   143          * @return index of contact or KErrNotFound, if contact is not found.
       
   144          */
       
   145         virtual TInt FindIndexOfContact(
       
   146             const MCAStoredContact* aContact,
       
   147             TStorageManagerGlobals::TFilterType aFilter =
       
   148                 TStorageManagerGlobals::EFilterAll ) const = 0;
       
   149 
       
   150         /*
       
   151          * Checks if the contact should be shown according to the filter
       
   152          * @param aContact Contact to check
       
   153          * @param aFilter Tells which contacts should be shown
       
   154          * @return ETrue if contact should be shown according
       
   155          *         to the given filter. EFalse otherwise.
       
   156          */
       
   157         virtual TBool FilterAllowsContact( const MCAStoredContact* aContact,
       
   158                                            TStorageManagerGlobals::TFilterType aFilter ) const = 0;
       
   159 
       
   160 
       
   161         /**
       
   162          * Set contact list as synchronised state for list. Can be failed, done or notdone.
       
   163          * @param aSynchroniseState. Default done.
       
   164          */
       
   165         virtual void SetSynchronised( TSynchroniseState aSynchroniseState = ESynchroniseDone ) = 0;
       
   166 
       
   167         /**
       
   168          * Get state of synchronisation.
       
   169          * @return State of synchronisation. Done, not done or failed.
       
   170          */
       
   171         virtual TSynchroniseState Synchronised() const = 0;
       
   172 
       
   173     protected:  // Constructors and destructor
       
   174 
       
   175         /**
       
   176          * Destructor.
       
   177          */
       
   178         ~MCAContactList() {};
       
   179     };
       
   180 
       
   181 
       
   182 #endif      // MCACONTACTLIST_H
       
   183 
       
   184 // End of File