landmarksui/engine/inc/CLmkCategoryListProvider.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2004 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:    LandmarksUi Content File -    Category list provider
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef CLMKCATEGORYLISTPROVIDER_H
       
    26 #define CLMKCATEGORYLISTPROVIDER_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include "CLmkLmItemListProvider.h"
       
    30 #include "LmkListProviderFactory.h"
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CPosLmCategoryManager;
       
    34 class CPosLandmarkCategory;
       
    35 
       
    36 /********************************/
       
    37 class CPosLandmarkSearch;
       
    38 class CPosLmOperation;
       
    39 class CPosLmCategoryCriteria;
       
    40 /********************************/
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 
       
    45 
       
    46 /**
       
    47 * CLmkCategoryListProvider class
       
    48 */
       
    49 class CLmkCategoryListProvider : public CLmkLmItemListProvider
       
    50     {
       
    51     public:  // Constructors and destructor
       
    52         /**
       
    53         * Creates a provider for all items in the database.
       
    54         * @param aDb landmark database reference
       
    55         * @param aShowType determines whether non-referenced
       
    56         *        categories are considered or not
       
    57         * @return newly instantiated object
       
    58         */
       
    59         static CLmkCategoryListProvider* NewL( CPosLandmarkDatabase& aDb,
       
    60                                                TLmkProviderType aShowType );
       
    61 
       
    62         /**
       
    63         * Destructor.
       
    64         */
       
    65         ~CLmkCategoryListProvider();
       
    66 
       
    67     public: // From CLmkListProviderBase
       
    68         CLmkUiItemBase* ItemAtL( TInt aIndex );
       
    69 
       
    70     public: // From MLmkDbObserver
       
    71         void HandleDatabaseEvent( TPosLmEvent& aEvent );
       
    72 
       
    73     protected: // From CLmkLmItemListProvider
       
    74         void PrepareListL();
       
    75         TBool PrepareListL(const TDesC& aSearchPattern,
       
    76     							TBool aSearchOnlyInPreviousMatches);
       
    77         void RemoveLandmarksL(const RArray<TPosLmItemId>& aSelectedItems ) ;
       
    78 
       
    79     private:  // Constructors and destructor
       
    80         /**
       
    81         * C++ constructor.
       
    82         * @param aDb
       
    83         * @param aShowType
       
    84         * @return newly instantiated object
       
    85         */
       
    86         CLmkCategoryListProvider( CPosLandmarkDatabase& aDb,
       
    87                                   TLmkProviderType aShowType );
       
    88 
       
    89         /**
       
    90         * By default Symbian 2nd phase constructor is private.
       
    91         */
       
    92         void ConstructL();
       
    93 
       
    94     private: //new functions
       
    95         /**
       
    96         * Make category usage list
       
    97         */
       
    98         void PrepareCategoryUsageListL();
       
    99 
       
   100         /**
       
   101          * Check is category used or not
       
   102          * @param aCategory, list item category
       
   103          * @return TBool
       
   104          */
       
   105         TBool IsUsedL( CPosLandmarkCategory& aCategory );
       
   106 
       
   107 
       
   108 /******************************************************/
       
   109      protected: // From MLmkAOOperationObserver
       
   110         void HandleOperationL( TOperationTypes aType,
       
   111                               TReal32 aProgress,
       
   112                               TInt aStatus );
       
   113 
       
   114 
       
   115 	/**
       
   116         * Read items to array
       
   117         */
       
   118         void ReadItemsToArrayL();
       
   119 /******************************************************/
       
   120 
       
   121 
       
   122 
       
   123     private:    // Data
       
   124         ///Own:
       
   125         CPosLmCategoryManager* iCategoryMgr;
       
   126 
       
   127         TLmkProviderType iShowType;
       
   128 
       
   129         // category usage id list
       
   130         RArray<TPosLmItemId> iUsageArray;
       
   131 
       
   132         // index
       
   133         TInt iUsageIndex;
       
   134 
       
   135 		// are any uncategorised items in database
       
   136 		TBool iAreUncategorisedItems;
       
   137 
       
   138 /************************************************/
       
   139   ///Own:
       
   140         CPosLandmarkSearch* iSearch;
       
   141 
       
   142         ///Own:
       
   143         CLmkAOOperation* iSearchAO;
       
   144 
       
   145         CPosLmCategoryCriteria* iCriteria;
       
   146 
       
   147 /************************************************/
       
   148 
       
   149 
       
   150     };
       
   151 
       
   152 #endif      // CLMKCATEGORYLISTPROVIDER_H
       
   153 
       
   154 // End of File