CPosLmCompositeCriteria Class Reference

API published in: S60 3rd Ed

Link against: eposlmsearchlib.lib eposlmmultidbsearch.lib

Capability Information

Required Capabilities

None

Exceptions

The capability ReadUserData is required in:

CPosLandmarkSearch::StartLandmarkSearchL( const CPosLmSearchCriteria & aCriteria, TBool aSearchOnlyPreviousMatches = EFalse );

CPosLandmarkSearch::StartLandmarkSearchL( const CPosLmSearchCriteria & aCriteria, const TPosLmSortPref & aSortPref, TBool aSearchOnlyPreviousMatches = EFalse );

CPosLandmarkSearch::StartCategorySearchL( const CPosLmSearchCriteria & aCriteria, CPosLmCategoryManager::TCategorySortPref aSortPref, TBool aSearchOnlyPreviousMatches = EFalse );

CPosLmMultiDbSearch::StartLandmarkSearchL( const CPosLmSearchCriteria & aCriteria, TBool aSearchOnlyPreviousMatches = EFalse );

CPosLmMultiDbSearch::StartLandmarkSearchL( const CPosLmSearchCriteria & aCriteria, const TPosLmSortPref & aSortPref, TBool aSearchOnlyPreviousMatches = EFalse );

CPosLmMultiDbSearch::StartCategorySearchL( const CPosLmSearchCriteria & aCriteria, CPosLmCategoryManager::TCategorySortPref aSortPref, TBool aSearchOnlyPreviousMatches = EFalse );

Other Information

The capability NetworkServices is required to work with remote databases.


#include <epos_cposlmcompositecriteria.h>

Inherits CPosLmSearchCriteria.


Detailed Description

Class used to combine multiple search criterion.

For instance, to search for all restaurants in the area, this class can be used to combine a CPosLmAreaCriteria and a CPosLmCategoryCriteria.

If a CPosLmNearestCriteria is used and no sort preference is specified, the result will be sorted by distance. If more than one CPosLmNearestCriteria are combined using a CPosLmCompositeCriteria, the sort order will be undefined unless a sort preference is specified.

Nested CPosLmCompositeCriteria are not allowed.

This criterion only supports searching for landmarks, e.g. if it is passed to CPosLandmarkSearch::StartCategorySearchL, the function will fail with error code KErrNotSupported.


Public Types

enum   TCompositionType { ECompositionAND = 0 }
  Specifies the type of the composite criterion. More...

Public Member Functions

virtual  ~CPosLmCompositeCriteria ()
  Destructor.
IMPORT_C TCompositionType  CompositionType () const
  Returns the type of this composite criterion.
IMPORT_C void  SetCompositionType (TCompositionType aType)
  Set the type of this composite criterion.
IMPORT_C TUint  NumOfArguments () const
  Returns the number of criteria this object contains.
IMPORT_C const CPosLmSearchCriteria Argument (TUint aIndex) const
  Returns a criterion argument contained in this object.
IMPORT_C CPosLmSearchCriteria Argument (TUint aIndex)
  Returns a criterion argument contained in this object.
IMPORT_C TInt  AddArgument (CPosLmSearchCriteria *aCriteria)
  Adds a criterion to this composition.
IMPORT_C CPosLmSearchCriteria RemoveArgument (TUint aIndex)
  Removes a criterion from this composition.
IMPORT_C void  ClearArguments ()
  Removes and deletes all contained criterion objects.

Static Public Member Functions

static IMPORT_C CPosLmCompositeCriteria NewLC (TCompositionType aType)
  Two-phased constructor.

Member Enumeration Documentation

enum CPosLmCompositeCriteria::TCompositionType
 

Specifies the type of the composite criterion.

Enumerator:
ECompositionAND  Search results must match all contained criteria.

Constructor & Destructor Documentation

virtual CPosLmCompositeCriteria::~CPosLmCompositeCriteria  )  [virtual]
 

Destructor.


Member Function Documentation

IMPORT_C TInt CPosLmCompositeCriteria::AddArgument CPosLmSearchCriteria aCriteria  ) 
 

Adds a criterion to this composition.

The composite criterion must contain at least one argument, otherwise CPosLandmarkSearch::StartLandmarkSearchL will fail with error code KErrArgument.

If this function returns without an error code, ownership of the added criterion object is transferred to the composite object.

Nested CPosLmCompositeCriteria are not supported.

Searching for landmark categories using CPosLmCompositeCriteria is not supported.

Parameters:
[in]  aCriteria  The criterion to add to the composition.
Returns:
- KErrNone if successful
IMPORT_C CPosLmSearchCriteria& CPosLmCompositeCriteria::Argument TUint  aIndex  ) 
 

Returns a criterion argument contained in this object.

This overload returns a non-const reference to the criterion argument. There is another overload which returns a const reference.

Parameters:
aIndex  The argument to read. Must be in the interval [0, NumOfArguments - 1], or this function will raise a USER-130 panic.
Returns:
The requested argument.
IMPORT_C const CPosLmSearchCriteria& CPosLmCompositeCriteria::Argument TUint  aIndex  )  const
 

Returns a criterion argument contained in this object.

This overload returns a const reference to the criterion argument. There is another overload which returns a non-const reference.

Parameters:
aIndex  The argument to read. Must be in the interval [0, NumOfArguments - 1], or this function will raise a USER-130 panic.
Returns:
The requested argument.
IMPORT_C void CPosLmCompositeCriteria::ClearArguments  ) 
 

Removes and deletes all contained criterion objects.

The composite criterion must contain at least one argument, otherwise CPosLandmarkSearch::StartLandmarkSearchL will fail with error code KErrArgument.

IMPORT_C TCompositionType CPosLmCompositeCriteria::CompositionType  )  const
 

Returns the type of this composite criterion.

Returns:
The composition type. Currently it is always ECompositionAND.
static IMPORT_C CPosLmCompositeCriteria* CPosLmCompositeCriteria::NewLC TCompositionType  aType  )  [static]
 

Two-phased constructor.

Parameters:
[in]  aType  The composition type to use. Currently only ECompositionAND is supported.
Returns:
A new instance of this class.
IMPORT_C TUint CPosLmCompositeCriteria::NumOfArguments  )  const
 

Returns the number of criteria this object contains.

Returns:
The number of criteria this object contains.
IMPORT_C CPosLmSearchCriteria* CPosLmCompositeCriteria::RemoveArgument TUint  aIndex  ) 
 

Removes a criterion from this composition.

Note: This function does not delete the criterion object. Instead, the ownership of the object is passed to the caller.

Parameters:
aIndex  The argument to remove. Must be in the interval [0, NumOfArguments - 1], or this function will raise a USER-130 panic.
Returns:
The criterion object which was removed from the composition.
IMPORT_C void CPosLmCompositeCriteria::SetCompositionType TCompositionType  aType  ) 
 

Set the type of this composite criterion.

Parameters:
[in]  The  composition type to use. Currently only ECompositionAND is supported.

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top