1.1 --- a/epoc32/include/mw/epos_cposlmtextcriteria.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/epos_cposlmtextcriteria.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,179 @@
1.4 -epos_cposlmtextcriteria.h
1.5 +/*
1.6 +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: CPosLmTextCriteria class
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#ifndef CPOSLMTEXTCRITERIA_H
1.24 +#define CPOSLMTEXTCRITERIA_H
1.25 +
1.26 +#include <e32base.h>
1.27 +#include <LbsFields.h>
1.28 +#include <EPos_CPosLandmark.h>
1.29 +#include "EPos_CPosLmSearchCriteria.h"
1.30 +
1.31 +const TInt KPosLmMaxSearchStringLength = 255;
1.32 +
1.33 +/**
1.34 +* Criterion for searching for landmarks which contain a certain text.
1.35 +*
1.36 +* The search is defined by providing a text to search for and the position
1.37 +* fields and text attributes to search.
1.38 +*
1.39 +* If no attributes are specified for the search, all text attributes in the
1.40 +* landmarks are searched. If no position fields are specified, then all
1.41 +* fields are searched.
1.42 +*
1.43 +* If this criterion is passed to
1.44 +* @ref CPosLandmarkSearch::StartLandmarkSearchL, only landmarks which contain
1.45 +* the specified text are returned.
1.46 +*
1.47 +* Wild-card characters are supported.
1.48 +*
1.49 +* This criterion is only valid when searching for landmarks, i.e. if it
1.50 +* is passed to @p CPosLandmarkSearch::StartCategorySearchL, the function
1.51 +* will fail with error code @p KErrArgument.
1.52 +*
1.53 +* @lib eposlmsearchlib.lib
1.54 +* @since S60 3.0
1.55 +*/
1.56 +class CPosLmTextCriteria : public CPosLmSearchCriteria
1.57 + {
1.58 + public:
1.59 +
1.60 + /**
1.61 + * Two-phased constructor.
1.62 + * @returns A new instance of this class.
1.63 + */
1.64 + IMPORT_C static CPosLmTextCriteria* NewLC();
1.65 +
1.66 + /**
1.67 + * Destructor.
1.68 + */
1.69 + virtual ~CPosLmTextCriteria();
1.70 +
1.71 + public:
1.72 +
1.73 + /**
1.74 + * Retrieves the text to search for.
1.75 + *
1.76 + * @return The text to search for.
1.77 + */
1.78 + IMPORT_C TPtrC Text() const;
1.79 +
1.80 + /**
1.81 + * Sets the search string.
1.82 + *
1.83 + * A non-empty text string must be set, otherwise
1.84 + * @ref CPosLandmarkSearch::StartLandmarkSearchL will leave with error
1.85 + * code @p KErrArgument.
1.86 + *
1.87 + * The search is case insensitive.
1.88 + *
1.89 + * Wild-card characters "?" and "*" are supported in the search string.
1.90 + * "?" matches a single occurrence of any character and "*" matches
1.91 + * zero or more consecutive occurrences of any characters.
1.92 + *
1.93 + * A landmark matches the criterion if specified text is found anywhere
1.94 + * in selected attributes or position fields.
1.95 + *
1.96 + * @param aText The text to search for.
1.97 + *
1.98 + * @leave KErrArgument The search string is longer than @p KPosLmMaxSearchStringLength.
1.99 + */
1.100 + IMPORT_C void SetTextL( const TDesC& aText );
1.101 +
1.102 + /**
1.103 + * Retrieves the landmark attributes which should be searched.
1.104 + *
1.105 + * This function returns a bitmap of landmark attributes. The landmark
1.106 + * attributes are defined by @p CPosLandmark::_TAttributes. It is only
1.107 + * possible to search the @p ELandmarkName and @p EDescription
1.108 + * attributes.
1.109 + *
1.110 + * @return A bitmap indicating which landmark attributes should be
1.111 + * searched.
1.112 + */
1.113 + IMPORT_C CPosLandmark::TAttributes AttributesToSearch() const;
1.114 +
1.115 + /**
1.116 + * Sets which landmark attributes to search.
1.117 + *
1.118 + * The client passes a bitmap of the landmark attributes to search. It
1.119 + * is only possible to search the @p ELandmarkName and @p EDescription
1.120 + * attributes.
1.121 + *
1.122 + * @param aAttributes A bitmap indicating which landmark attributes
1.123 + * should be searched.
1.124 + *
1.125 + * @panic "Landmarks Client"-EPosInvalidLandmarkAttribute
1.126 + * Unsupported attribute is passed.
1.127 + */
1.128 + IMPORT_C void SetAttributesToSearch(
1.129 + CPosLandmark::TAttributes aAttributes
1.130 + );
1.131 +
1.132 + /**
1.133 + * Retrieves a list of the position fields to search.
1.134 + *
1.135 + * @param[out] aFieldArray On return, contains a list of the position fields
1.136 + * which are used in a search. If no position fields have been set,
1.137 + * the array is empty. Position fields are identified by values defined
1.138 + * in @p TPositionFieldId.
1.139 + */
1.140 + IMPORT_C void GetPositionFieldsToSearchL(
1.141 + RArray<TUint>& aFieldArray
1.142 + ) const;
1.143 +
1.144 + /**
1.145 + * Sets the position fields to search.
1.146 + *
1.147 + * Any previously set position fields are cleared by this call.
1.148 + *
1.149 + * @param[in] aFieldArray A list of the position fields to search.
1.150 + * Position fields are identified by values defined in
1.151 + * @p TPositionFieldId.
1.152 + */
1.153 + IMPORT_C void SetPositionFieldsToSearchL(
1.154 + const RArray<TUint>& aFieldArray
1.155 + );
1.156 +
1.157 + /**
1.158 + * Clears the position fields list used in a search.
1.159 + */
1.160 + IMPORT_C void ClearPositionFieldsToSearch();
1.161 +
1.162 + private:
1.163 +
1.164 + CPosLmTextCriteria();
1.165 +
1.166 + void ConstructL();
1.167 +
1.168 + // Prohibit copy constructor
1.169 + CPosLmTextCriteria( const CPosLmTextCriteria& );
1.170 + // Prohibit assigment operator
1.171 + CPosLmTextCriteria& operator= ( const CPosLmTextCriteria& );
1.172 +
1.173 + private:
1.174 +
1.175 + HBufC* iText;
1.176 + RArray<TUint> iPositionFieldArray;
1.177 + CPosLandmark::TAttributes iAttributes;
1.178 +
1.179 + };
1.180 +
1.181 +#endif // CPOSLMTEXTCRITERIA_H
1.182 +
1.183 +