serviceproviders/sapi_landmarks/inc/clandmarkiterable.h
changeset 19 989d2f495d90
child 37 5d0ec8b709be
equal deleted inserted replaced
14:a36b1e19a461 19:989d2f495d90
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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 the License "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:  CLandmarkIterable class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CLANDMARKITERABLE_H__
       
    20 #define __CLANDMARKITERABLE_H__
       
    21 
       
    22 //INCLUDES
       
    23 #include <liwvariant.h>
       
    24 
       
    25 //FORWARD DECLARATIONS
       
    26 class CPosLandmark;
       
    27 class CPosLandmarkDatabase;
       
    28 class CPosLmItemIterator;
       
    29 
       
    30 /**
       
    31 * CLandmarkIterable
       
    32 * This class inherits from CLiwIterable and implements the Reset() and 
       
    33 * NextL(TLiwVariant& aEntry) functions. This class acts as wrapper for the 
       
    34 * CPosLmItemIterator to iterate through a list of landmarks in a database.
       
    35 */
       
    36 // CLASS DECLARATION
       
    37 NONSHARABLE_CLASS(CLandmarkIterable): public CLiwIterable
       
    38     {
       
    39     public: //New methods
       
    40 
       
    41         /**
       
    42         * NewL.
       
    43         * Two-phased constructor.
       
    44         * Create a CLandmarkIterable object.
       
    45         * @param aIterator The iterator to be used for iterating landmarks. This owns the iterator.
       
    46         * @param aDatabaseUri The URI of the database on which the iteration is to be done.
       
    47         * @return A pointer to the created instance of CLandmarkIterable.
       
    48         */
       
    49         static CLandmarkIterable* NewL( CPosLmItemIterator* aIterator,
       
    50             const TDesC& aDatabaseUri );
       
    51 
       
    52         /**
       
    53         * ~CLandmarkIterable
       
    54         * Destructor.
       
    55         */
       
    56         ~CLandmarkIterable();
       
    57 
       
    58     protected: //from CLiwIterable
       
    59 
       
    60         // Resets the iterator. 
       
    61         void Reset();
       
    62 
       
    63         // Iterates over the collection entries to fetch the next data element.
       
    64         TBool NextL(TLiwVariant& aEntry);
       
    65 
       
    66     private: //constructor
       
    67 
       
    68         /**
       
    69         * ConstructL
       
    70         * 2nd phase constructor.
       
    71         * Perform the second phase construction of a
       
    72         * CLandmarkIterable object.
       
    73         * @param aDatabaseUri The URI of the database on which the iteration is to be done.
       
    74         */
       
    75         void ConstructL( const TDesC& aDatabaseUri );
       
    76 
       
    77         /**
       
    78         * CLandmarkIterable.
       
    79         * C++ default constructor.
       
    80         * @param aIterator The iterator to be used for iterating landmarks. This owns the iterator.
       
    81         */
       
    82         CLandmarkIterable( CPosLmItemIterator* aIterator );
       
    83 
       
    84     private: //data
       
    85 
       
    86         /**
       
    87         * iIterator
       
    88         * The handle to the CPosLmItemIterator landmark iterator. 
       
    89         */
       
    90         CPosLmItemIterator* iIterator;
       
    91 
       
    92         /**
       
    93         * iDatabase
       
    94         * The handle to the CPosLandmarkDatabase.
       
    95         */
       
    96         CPosLandmarkDatabase* iDatabase;
       
    97 
       
    98         /**
       
    99         * iLandmark
       
   100         * The CPosLandmark instance retrieved by iterator.
       
   101         */
       
   102         CPosLandmark* iLandmark;
       
   103         
       
   104         /**
       
   105         * iLandmarkId
       
   106         * The Id of the landmark stored as string.
       
   107         */
       
   108         HBufC* iLandmarkId;
       
   109         
       
   110         /**
       
   111         * iCategoryIds
       
   112         * The Id of the landmark categories stored as string.
       
   113         */
       
   114         RPointerArray<HBufC> iCategoryIds;
       
   115     };
       
   116 
       
   117 #endif // __CLANDMARKITERABLE_H__
       
   118 
       
   119 // End of File