2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: CPosLmCategoryCriteria class
19 #ifndef CPOSLMCATEGORYCRITERIA_H
20 #define CPOSLMCATEGORYCRITERIA_H
23 #include <EPos_Landmarks.h>
25 #include "EPos_CPosLmSearchCriteria.h"
28 * Criterion used for searching for landmarks which belong to a certain
31 * A category has an ID in the database and it has also a unique name. There
32 * are also some global categories which are known by all databases. It is
33 * possible to specify either a local category in a specific landmark
34 * database, a global category or the name of the category. If one is set,
35 * the others are reset and not used.
37 * It is also possible to search for uncategorized landmarks, i.e. landmarks
38 * which do not contain any categories. If neither item ID, global ID nor name
39 * are set, then @ref CPosLandmarkSearch::StartLandmarkSearchL will search for
40 * uncategorized landmarks.
42 * This criterion is only valid when searching for landmarks, i.e. if it
43 * is passed to @p CPosLandmarkSearch::StartCategorySearchL, the function
44 * will fail with error code @p KErrArgument.
46 * @lib eposlmsearchlib.lib
49 class CPosLmCategoryCriteria : public CPosLmSearchCriteria
54 * Two-phased constructor.
56 * @returns A new instance of this class.
58 IMPORT_C static CPosLmCategoryCriteria* NewLC();
63 virtual ~CPosLmCategoryCriteria();
68 * Returns the item ID of the category which should be used as
69 * landmark search criterion.
71 * @return The item ID of the category or @p KPosLmNullItemId
74 IMPORT_C TPosLmItemId CategoryItemId() const;
77 * Returns the global category which should be used as landmark search
80 * @return The global category or @p KPosLmNullGlobalCategory if not
83 IMPORT_C TPosLmGlobalCategory GlobalCategory() const;
86 * Returns the name of the category which should be used as landmark
89 * @return The category name or empty descriptor if not
92 IMPORT_C TPtrC CategoryName() const;
95 * Sets the item ID of the category which should be used as landmark
98 * Passing @p KPosLmNullItemId means uncategorized landmarks search.
100 * @param aItemId The item ID of the category.
102 IMPORT_C void SetCategoryItemId( TPosLmItemId aItemId );
105 * Sets the global category which should be used as landmark search
108 * Passing @p KPosLmNullGlobalCategory means uncategorized landmarks
111 * @param aGlobalCategory The global category.
113 IMPORT_C void SetGlobalCategory( TPosLmGlobalCategory aGlobalCategory );
116 * Sets the name of the category which should be used as landmark
119 * The exact category name must be specified. Wild-card characters are
120 * not used as such, they will be considered as ordinary characters.
121 * It is possible to use @ref CPosLmCatNameCriteria to
122 * list categories which match a category name pattern containing
123 * wild-card characters.
125 * The matching is case sensitive.
127 * An empty descriptor means uncategorized landmarks search.
129 * @param aCategoryName The category name.
131 * @leave KErrArgument The category name is longer than @p KPosLmMaxCategoryNameLength.
133 IMPORT_C void SetCategoryNameL( const TDesC& aCategoryName );
138 CPosLmCategoryCriteria();
142 // Prohibit copy constructor
143 CPosLmCategoryCriteria( const CPosLmCategoryCriteria& );
144 // Prohibit assigment operator
145 CPosLmCategoryCriteria& operator= ( const CPosLmCategoryCriteria& );
149 TPosLmItemId iItemId;
150 TPosLmGlobalCategory iGlobalCategory;
151 HBufC* iCategoryName;
155 #endif // CPOSLMCATEGORYCRITERIA_H