javaextensions/location/landmarks/inc/clapilandmarksearchfactory.h
changeset 21 2a9601315dfc
equal deleted inserted replaced
18:e8e63152f320 21:2a9601315dfc
       
     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:  Landmark search factory
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CLAPILANDMARKSEARCHFACTORY_H
       
    20 #define CLAPILANDMARKSEARCHFACTORY_H
       
    21 
       
    22 // EXTERNAL INCLUDES
       
    23 #include    <e32std.h>
       
    24 #include    <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CPosLandmarkDatabase;
       
    28 class CPosLmCompositeCriteria;
       
    29 class CPosLmSearchCriteria;
       
    30 class CPosLandmarkSearch;
       
    31 class CPosLmItemIterator;
       
    32 class TLAPISearchCriteria;
       
    33 
       
    34 /**
       
    35  * Landmark search factory
       
    36  *
       
    37  * Creates a landmark iterator based on the provided search
       
    38  * arguments. The arguments can contain multiple combinations
       
    39  * of different search criterias.
       
    40  *
       
    41  * Currently supported search criterias are category, text or
       
    42  * area specific searches or combination of these three types
       
    43  *
       
    44  * @lib N/A
       
    45  * @since S60 3.2
       
    46  */
       
    47 NONSHARABLE_CLASS(CLAPILandmarkSearchFactory) : public CBase
       
    48 {
       
    49 public: // Constructors and destructor
       
    50 
       
    51     /**
       
    52      * Two-phased constructor. Creates an instance from this class
       
    53      * The caller takes the ownership of the returned instance
       
    54      * @return New instance from this class
       
    55      */
       
    56     static CLAPILandmarkSearchFactory* NewL(
       
    57         CPosLandmarkDatabase& aDatabase);
       
    58 
       
    59     /**
       
    60      * Two-phased constructor. Creates an instance from this class
       
    61      * The caller takes the ownership of the returned instance which
       
    62      * is left to the cleanup stack
       
    63      * @return New instance from this class
       
    64      */
       
    65     static CLAPILandmarkSearchFactory* NewLC(
       
    66         CPosLandmarkDatabase& aDatabase);
       
    67 
       
    68     /**
       
    69      * Destructor.
       
    70      */
       
    71     virtual ~CLAPILandmarkSearchFactory();
       
    72 
       
    73 public: // New functions
       
    74 
       
    75     /**
       
    76      * Creates a landmark item iterator based on the passed
       
    77      * criteria argument. Currently it is possible to search
       
    78      * using a text, category or area criterias or a combination
       
    79      * of these criterias
       
    80      *
       
    81      * If the parameter is null an iterator containing all landmarks
       
    82      * will be returned to the caller
       
    83      *
       
    84      * @param aCriteria A search criteria
       
    85      * @return An iterator of landmarks matching the specified criteria
       
    86      *         The ownership is transferred to the caller
       
    87      */
       
    88     CPosLmItemIterator* CreateIteratorL(
       
    89         const TLAPISearchCriteria* aCriteria);
       
    90 
       
    91 private: // New functions
       
    92 
       
    93     /**
       
    94      * Adds a criteria to the passed composite search criteria
       
    95      * The ownership of the added criteria is taken from the caller
       
    96      *
       
    97      * @param aCompositeCriteria The composite search criteria to which
       
    98      *        the criteria argument is added.
       
    99      * @param aCriteria The added criteria. The criteria is popped from
       
   100      *        the cleanup stack
       
   101      */
       
   102     void AddCriteriaAndPopL(
       
   103         CPosLmCompositeCriteria& aCompositeCriteria,
       
   104         CPosLmSearchCriteria* aCriteria) const;
       
   105 
       
   106 protected: // Constructors
       
   107 
       
   108     /**
       
   109      * Default C++ constructor
       
   110      */
       
   111     CLAPILandmarkSearchFactory(CPosLandmarkDatabase& aDatabase);
       
   112 
       
   113     /**
       
   114      * Second phase constructor
       
   115      */
       
   116     void ConstructL();
       
   117 
       
   118 private: // Data
       
   119 
       
   120     // Database manager. Used
       
   121     CPosLandmarkDatabase& iDatabase;
       
   122 
       
   123     // Landmark search manager. Owned
       
   124     CPosLandmarkSearch* iLmSearch;
       
   125 
       
   126 };
       
   127 
       
   128 #endif // CLAPILANDMARKSEARCHFACTORY_H
       
   129 // End of file