S60 3rd Edition SDK for Symbian OS
Example Applications Guide

LandmarksLmCategoriesModel.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : LandmarksLmCategoriesModel.h
00004 *  Part of     : Landmark Reference Application
00005 *  Interface   : -
00006 *  Description : See class description below
00007 *  Version     : 1.0
00008 *
00009 *  Copyright (c) 2004-2006 Nokia Corporation.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia Corporation.
00013 * ==============================================================================
00014 */
00015 
00016 #ifndef __LANDMARKS_LM_CATEGORIES_MODEL_H__
00017 #define __LANDMARKS_LM_CATEGORIES_MODEL_H__
00018 
00019 // INCLUDES
00020 #include <e32std.h>
00021 #include <EPos_Landmarks.h>
00022 
00023 // FORWARD DECLARATIONS
00024 class CLandmarksApplicationEngine;
00025 class CPosLandmarkCategory;
00026 class CGulIcon;
00027 
00028 // CLASS DECLARATION
00029 
00030 /**
00031 *  CLandmarksLmCategoriesModel holds the data displayed in the category 
00032 *  listbox in the landmarks category edit dialog.
00033 */
00034 class CLandmarksLmCategoriesModel : public CBase
00035         {
00036     public: // Constructors and destructor
00037 
00038         /**
00039         * Two-phased constructor.
00040         *
00041         * @param aEngine the landmarks application engine.
00042         * @param aMarkedCategories an array of selected landmarks.
00043         */
00044         static CLandmarksLmCategoriesModel* NewL(
00045             CLandmarksApplicationEngine& aEngine,
00046             RArray<TPosLmItemId>& aMarkedCategories);
00047 
00048         /**
00049         * Destructor.
00050         */
00051             ~CLandmarksLmCategoriesModel();
00052 
00053     public: // New functions
00054 
00055         /**
00056         * Stores ids of selected categories.
00057         *
00058         * @param aSelectedIndexes array of indexes of selected catgeories
00059         */
00060             void SelectCategoriesL(CArrayFixFlat<TInt>& aSelectedIndexes);
00061 
00062         /**
00063         * Returns a descriptor array of formatted list items.
00064         *
00065         * @return an descriptor array suitable for a two-column listbox
00066         */
00067         CDesCArray* FormattedCategoryNamesL();
00068 
00069         /**
00070         * Returns array of indices of selected categories.
00071         *
00072         * @return array of indexes of selected catgeories
00073         */
00074                 CArrayFixFlat<TInt>* SelectedCategoriesL();
00075 
00076     private:
00077 
00078         /**
00079         * C++ constructor.
00080         *
00081         * @param aMarkedCategories an array of selected landmarks.
00082         */
00083             CLandmarksLmCategoriesModel(
00084             RArray<TPosLmItemId>& aMarkedCategories);
00085 
00086         /**
00087         * By default Symbian 2nd phase constructor is private.
00088         *
00089         * @param aEngine the landmarks application engine.
00090         */
00091             void ConstructL(CLandmarksApplicationEngine& aEngine);
00092 
00093     private: // Data
00094 
00095         //! contains all existing categories
00096         CArrayPtr<CPosLandmarkCategory>* iCategories;
00097 
00098         /** contains Ids for those categories that are selected for the 
00099             edited landmark. */
00100         RArray<TPosLmItemId>& iMarkedCategoryIds;
00101 
00102         /** An array of formatted category names suitable for a two-column 
00103             listbox. */
00104             CDesCArrayFlat* iListItems;
00105             
00106         };
00107 
00108 #endif // __LANDMARKS_LM_CATEGORIES_MODEL_H__
00109 
00110 // End of File
00111 

© Nokia 2006

Back to top