phonebookui/Phonebook2/remotecontactlookup/contactactionservice/inc/cfscstorecontactset.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Declaration of CFscStoreContactSet.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_FSCCONTACTITEMSET_H
       
    20 #define C_FSCCONTACTITEMSET_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "cfsccontactset.h"
       
    25 
       
    26 /**
       
    27  *  Contact set.
       
    28  *  Implementation of a contact item objects based contact set.
       
    29  *
       
    30  *  @since S60 3.1
       
    31  */
       
    32 class CFscStoreContactSet: public CFscContactSet
       
    33     {
       
    34 
       
    35 public: // Constructors and destructor
       
    36 
       
    37     /**
       
    38      * Two-phased constructor.
       
    39      *
       
    40      * @param aVPbkContactManager Contact manager
       
    41      * @param aStoreContactList Source contacts
       
    42      * @return New instance of CFscStoreContactSet
       
    43      */
       
    44     static CFscStoreContactSet* NewL( 
       
    45         CVPbkContactManager& aVPbkContactManager,
       
    46         const RFscStoreContactList& aStoreContactList );
       
    47            
       
    48     /**
       
    49      * Destructor.
       
    50      */
       
    51     virtual ~CFscStoreContactSet();
       
    52    
       
    53 public: // From base class MFscContactSet
       
    54     
       
    55     /**
       
    56      * Contact count.
       
    57      *
       
    58      * @return contact count.
       
    59      */
       
    60     TInt ContactCount() const;
       
    61     
       
    62     /**
       
    63      * Group count.
       
    64      *
       
    65      * @return group count.
       
    66      */
       
    67     TInt GroupCount() const;
       
    68     
       
    69     /**
       
    70      * Checks if collection has next contact.
       
    71      *
       
    72      * @return ETrue if the next contact exists.
       
    73      */
       
    74     TBool HasNextContact() const;
       
    75     
       
    76     /**
       
    77      * Checks if collection has next group.
       
    78      * Just for interface compatibility - always EFalse.
       
    79      *
       
    80      * @return Just for interface compatibility - always EFalse. 
       
    81      */
       
    82     TBool HasNextGroup() const;
       
    83     
       
    84     /**
       
    85      * Sets the index to point to the first contact in the list.
       
    86      */
       
    87     void SetToFirstContact();
       
    88     
       
    89     /**
       
    90      * Sets the index to point to the first group in the list.
       
    91      * Just for interface compatibility.
       
    92      */
       
    93     void SetToFirstGroup();
       
    94     
       
    95     /**
       
    96      * Retrieves store contact.
       
    97      */
       
    98     void NextContactL( MFscContactSetObserver* aObserver );
       
    99     
       
   100     /**
       
   101       * From MFscContactSet.
       
   102       * 
       
   103       * @return link for contact.
       
   104       */
       
   105     MVPbkContactLink* NextContactLinkL();
       
   106     
       
   107     /**
       
   108      * Retrieves store contact for group. Just for interface compatibility.
       
   109      * Calling this method for this objects will cause calling observer's
       
   110      * mthod NextContactFailed() with KErrArgument as error.
       
   111      */
       
   112     void NextGroupL( MFscContactSetObserver* aObserver );
       
   113     
       
   114     /**
       
   115       * From MFscContactSet.
       
   116       * 
       
   117       * @return link for group.
       
   118       */
       
   119     MVPbkContactLink* NextGroupLinkL();
       
   120     
       
   121     /**
       
   122      * Cancel NextContactL method.
       
   123      * Just for interface compatibility.
       
   124      */
       
   125     void CancelNextContactL();
       
   126     
       
   127     /**
       
   128      * Cancel NextGroupL method.
       
   129      * Just for interface compatibility.
       
   130      */
       
   131     void CancelNextGroupL();
       
   132     
       
   133 protected: // From base class MVPbkSingleContactOperationObserver
       
   134     
       
   135     /**
       
   136      * From MVPbkSingleContactOperationObserver.
       
   137      * Called when the operation is completed.
       
   138      * 
       
   139      * @param aOperation The completed operation.
       
   140      * @param aContact The contact returned by the operation.
       
   141      *                 A client must take the ownership immediately.
       
   142      */
       
   143     void VPbkSingleContactOperationComplete(
       
   144             MVPbkContactOperationBase& aOperation,
       
   145             MVPbkStoreContact* aContact );
       
   146     
       
   147     /**
       
   148      * From MVPbkSingleContactOperationObserver.
       
   149      * Called if the operation fails.
       
   150      * 
       
   151      * @param aOperation The failed operation.
       
   152      * @param aError An error code of the failure.
       
   153      */
       
   154     void VPbkSingleContactOperationFailed(
       
   155             MVPbkContactOperationBase& aOperation, TInt aError );
       
   156 
       
   157 private: // Private constructors
       
   158 
       
   159     /**
       
   160      * Constructor.
       
   161      *
       
   162      * @param aVPbkContactManager Contact manager     
       
   163      */
       
   164     CFscStoreContactSet( CVPbkContactManager& aVPbkContactManager );
       
   165 
       
   166     /**
       
   167      * Second phase constructor.
       
   168      *
       
   169      * @param aStoreContactList Source contacts
       
   170      */
       
   171     void ConstructL( const RFscStoreContactList& aStoreContactList );
       
   172 
       
   173 private: // Private members
       
   174     
       
   175     /**
       
   176      * Store contacts list pointer.
       
   177      * Not Own.
       
   178      */    
       
   179     const RFscStoreContactList* iStoreContactList;
       
   180     
       
   181     /**
       
   182      * Current store contact.
       
   183      */
       
   184     TInt iCurrentStoreContact;
       
   185     
       
   186     };
       
   187 
       
   188 #endif // C_FSCCONTACTITEMSET_H