locationlandmarksrefappfors60/Inc/LandmarksLmCategoriesModel.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-2005 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:  
       
    15 *     See class description below
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __LANDMARKS_LM_CATEGORIES_MODEL_H__
       
    21 #define __LANDMARKS_LM_CATEGORIES_MODEL_H__
       
    22 
       
    23 
       
    24 #include <e32std.h>
       
    25 #include <EPos_Landmarks.h>
       
    26 
       
    27 
       
    28 class CLandmarksApplicationEngine;
       
    29 class CPosLandmarkCategory;
       
    30 class CGulIcon;
       
    31 
       
    32 
       
    33 
       
    34 /**
       
    35 *  CLandmarksLmCategoriesModel holds the data displayed in the category 
       
    36 *  listbox in the landmarks category edit dialog.
       
    37 */
       
    38 class CLandmarksLmCategoriesModel : public CBase
       
    39 	{
       
    40     public: // Constructors and destructor
       
    41 
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         *
       
    45         * @param aEngine the landmarks application engine.
       
    46         * @param aMarkedCategories an array of selected landmarks.
       
    47         */
       
    48         static CLandmarksLmCategoriesModel* NewL(
       
    49             CLandmarksApplicationEngine& aEngine,
       
    50             RArray<TPosLmItemId>& aMarkedCategories);
       
    51 
       
    52         /**
       
    53         * Destructor.
       
    54         */
       
    55 	    ~CLandmarksLmCategoriesModel();
       
    56 
       
    57     public: // New functions
       
    58 
       
    59         /**
       
    60         * Stores ids of selected categories.
       
    61         *
       
    62         * @param aSelectedIndexes array of indexes of selected catgeories
       
    63         */
       
    64 	    void SelectCategoriesL(CArrayFixFlat<TInt>& aSelectedIndexes);
       
    65 
       
    66         /**
       
    67         * Returns a descriptor array of formatted list items.
       
    68         *
       
    69         * @return an descriptor array suitable for a two-column listbox
       
    70         */
       
    71         CDesCArray* FormattedCategoryNamesL();
       
    72 
       
    73         /**
       
    74         * Returns array of indices of selected categories.
       
    75         *
       
    76         * @return array of indexes of selected catgeories
       
    77         */
       
    78 		CArrayFixFlat<TInt>* SelectedCategoriesL();
       
    79 
       
    80     private:
       
    81 
       
    82         /**
       
    83         * C++ constructor.
       
    84         *
       
    85         * @param aMarkedCategories an array of selected landmarks.
       
    86         */
       
    87 	    CLandmarksLmCategoriesModel(
       
    88             RArray<TPosLmItemId>& aMarkedCategories);
       
    89 
       
    90         /**
       
    91         * By default Symbian 2nd phase constructor is private.
       
    92         *
       
    93         * @param aEngine the landmarks application engine.
       
    94         */
       
    95 	    void ConstructL(CLandmarksApplicationEngine& aEngine);
       
    96 
       
    97     private: // Data
       
    98 
       
    99         //! contains all existing categories
       
   100         CArrayPtr<CPosLandmarkCategory>* iCategories;
       
   101 
       
   102         /** contains Ids for those categories that are selected for the 
       
   103             edited landmark. */
       
   104         RArray<TPosLmItemId>& iMarkedCategoryIds;
       
   105 
       
   106         /** An array of formatted category names suitable for a two-column 
       
   107             listbox. */
       
   108 	    CDesCArrayFlat* iListItems;
       
   109 	    
       
   110 	};
       
   111 
       
   112 #endif // __LANDMARKS_LM_CATEGORIES_MODEL_H__
       
   113