epoc32/include/mw/epos_cposlmcategorycriteria.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* 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
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  CPosLmCategoryCriteria class
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
#ifndef CPOSLMCATEGORYCRITERIA_H
williamr@2
    20
#define CPOSLMCATEGORYCRITERIA_H
williamr@2
    21
williamr@2
    22
#include <e32base.h>
williamr@2
    23
#include <EPos_Landmarks.h>
williamr@2
    24
williamr@2
    25
#include "EPos_CPosLmSearchCriteria.h"
williamr@2
    26
williamr@2
    27
/**
williamr@2
    28
*  Criterion used for searching for landmarks which belong to a certain
williamr@2
    29
*  category.
williamr@2
    30
*
williamr@2
    31
*  A category has an ID in the database and it has also a unique name. There
williamr@2
    32
*  are also some global categories which are known by all databases. It is
williamr@2
    33
*  possible to specify either a local category in a specific landmark
williamr@2
    34
*  database, a global category or the name of the category. If one is set,
williamr@2
    35
*  the others are reset and not used.
williamr@2
    36
*
williamr@2
    37
*  It is also possible to search for uncategorized landmarks, i.e. landmarks
williamr@2
    38
*  which do not contain any categories. If neither item ID, global ID nor name
williamr@2
    39
*  are set, then @ref CPosLandmarkSearch::StartLandmarkSearchL will search for
williamr@2
    40
*  uncategorized landmarks.
williamr@2
    41
*
williamr@2
    42
*  This criterion is only valid when searching for landmarks, i.e. if it
williamr@2
    43
*  is passed to @p CPosLandmarkSearch::StartCategorySearchL, the function
williamr@2
    44
*  will fail with error code @p KErrArgument.
williamr@2
    45
*
williamr@2
    46
*  @lib eposlmsearchlib.lib
williamr@2
    47
*  @since S60 3.0
williamr@2
    48
*/
williamr@2
    49
class CPosLmCategoryCriteria : public CPosLmSearchCriteria
williamr@2
    50
    {
williamr@2
    51
    public:
williamr@2
    52
williamr@2
    53
        /**
williamr@2
    54
        * Two-phased constructor.
williamr@2
    55
        *
williamr@2
    56
        * @returns A new instance of this class.
williamr@2
    57
        */
williamr@2
    58
        IMPORT_C static CPosLmCategoryCriteria* NewLC();
williamr@2
    59
williamr@2
    60
        /**
williamr@2
    61
        * Destructor.
williamr@2
    62
        */
williamr@2
    63
        virtual ~CPosLmCategoryCriteria();
williamr@2
    64
williamr@2
    65
    public:
williamr@2
    66
williamr@2
    67
        /**
williamr@2
    68
        * Returns the item ID of the category which should be used as
williamr@2
    69
        * landmark search criterion.
williamr@2
    70
        *
williamr@2
    71
        * @return The item ID of the category or @p KPosLmNullItemId
williamr@2
    72
        *   if not set.
williamr@2
    73
        */
williamr@2
    74
        IMPORT_C TPosLmItemId CategoryItemId() const;
williamr@2
    75
williamr@2
    76
        /**
williamr@2
    77
        * Returns the global category which should be used as landmark search
williamr@2
    78
        * criterion.
williamr@2
    79
        *
williamr@2
    80
        * @return The global category or @p KPosLmNullGlobalCategory if not
williamr@2
    81
        *   set.
williamr@2
    82
        */
williamr@2
    83
        IMPORT_C TPosLmGlobalCategory GlobalCategory() const;
williamr@2
    84
williamr@2
    85
        /**
williamr@2
    86
        * Returns the name of the category which should be used as landmark
williamr@2
    87
        * search criterion.
williamr@2
    88
        *
williamr@2
    89
        * @return The category name or empty descriptor if not
williamr@2
    90
        *   set.
williamr@2
    91
        */
williamr@2
    92
        IMPORT_C TPtrC CategoryName() const;
williamr@2
    93
williamr@2
    94
        /**
williamr@2
    95
        * Sets the item ID of the category which should be used as landmark
williamr@2
    96
        * search criterion.
williamr@2
    97
        *
williamr@2
    98
        * Passing @p KPosLmNullItemId means uncategorized landmarks search.
williamr@2
    99
        *
williamr@2
   100
        * @param aItemId The item ID of the category.
williamr@2
   101
        */
williamr@2
   102
        IMPORT_C void SetCategoryItemId( TPosLmItemId aItemId );
williamr@2
   103
williamr@2
   104
        /**
williamr@2
   105
        * Sets the global category which should be used as landmark search
williamr@2
   106
        * criterion.
williamr@2
   107
        *
williamr@2
   108
        * Passing @p KPosLmNullGlobalCategory means uncategorized landmarks
williamr@2
   109
        * search.
williamr@2
   110
        *
williamr@2
   111
        * @param aGlobalCategory The global category.
williamr@2
   112
        */
williamr@2
   113
        IMPORT_C void SetGlobalCategory( TPosLmGlobalCategory aGlobalCategory );
williamr@2
   114
williamr@2
   115
        /**
williamr@2
   116
        * Sets the name of the category which should be used as landmark
williamr@2
   117
        * search criterion.
williamr@2
   118
        *
williamr@2
   119
        * The exact category name must be specified. Wild-card characters are
williamr@2
   120
        * not used as such, they will be considered as ordinary characters.
williamr@2
   121
        * It is possible to use @ref CPosLmCatNameCriteria to
williamr@2
   122
        * list categories which match a category name pattern containing
williamr@2
   123
        * wild-card characters.
williamr@2
   124
        *
williamr@2
   125
        * The matching is case sensitive.
williamr@2
   126
        *
williamr@2
   127
        * An empty descriptor means uncategorized landmarks search.
williamr@2
   128
        *
williamr@2
   129
        * @param aCategoryName The category name.
williamr@2
   130
        *
williamr@2
   131
        * @leave KErrArgument The category name is longer than @p KPosLmMaxCategoryNameLength.
williamr@2
   132
        */
williamr@2
   133
        IMPORT_C void SetCategoryNameL( const TDesC&  aCategoryName );
williamr@2
   134
williamr@2
   135
    private:
williamr@2
   136
williamr@2
   137
        // C++ constructor
williamr@2
   138
        CPosLmCategoryCriteria();
williamr@2
   139
williamr@2
   140
        void ConstructL();
williamr@2
   141
williamr@2
   142
        // Prohibit copy constructor
williamr@2
   143
        CPosLmCategoryCriteria( const CPosLmCategoryCriteria& );
williamr@2
   144
        // Prohibit assigment operator
williamr@2
   145
        CPosLmCategoryCriteria& operator= ( const CPosLmCategoryCriteria& );
williamr@2
   146
williamr@2
   147
    private:
williamr@2
   148
williamr@2
   149
        TPosLmItemId            iItemId;
williamr@2
   150
        TPosLmGlobalCategory    iGlobalCategory;
williamr@2
   151
        HBufC*                  iCategoryName;
williamr@2
   152
williamr@2
   153
    };
williamr@2
   154
williamr@2
   155
#endif      // CPOSLMCATEGORYCRITERIA_H
williamr@2
   156
williamr@2
   157