S60 3rd Edition SDK for Symbian OS
Example Applications Guide

LandmarksInfoModel.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : LandmarksInfoModel.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_INFOMODEL_H__
00017 #define __LANDMARKS_INFOMODEL_H__
00018 
00019 // INCLUDES
00020 #include <e32base.h>
00021 
00022 // FORWARD DECLARATIONS
00023 class TLocality;
00024 class CPosLandmark;
00025 class CLandmarksApplicationEngine;
00026 
00027 // CLASS DECLARATION
00028 
00029 /**
00030 *  Contains the data model of the landmarks view.
00031 *  
00032 */
00033 class CLandmarksInfoModel : public CBase
00034         {
00035     public: // Constructors and destructor
00036 
00037         /**
00038         * C++ constructor.
00039         */
00040             CLandmarksInfoModel(CLandmarksApplicationEngine& aEngine);
00041 
00042         /**
00043         * Destructor.
00044         */
00045             ~CLandmarksInfoModel();
00046 
00047     public: // New functions
00048 
00049         /**
00050         * Generates descriptor array from landmark's info.
00051         * Caller takes ownership of returned object
00052         *
00053         * @param aLandmark The landmark to get info of.
00054         * @param aFieldIds On return, landmark info field ids.
00055         * @return The landmark's info as descriptor array
00056         */
00057         CDesCArray* GetLandmarkInfoL(
00058             CPosLandmark& aLandmark,
00059             RArray<TInt>& aFieldIds);
00060 
00061     private:
00062 
00063         /**
00064         * Adds new string describing landmark field to the info array.
00065         * Adds also field's ID to array of field IDs.
00066         * @param aCaption The caption of the field
00067         * @param aText The value of the field
00068         * @param aArray Target array
00069         * @param aFieldIds Target field IDs array
00070         */
00071         void AddInfoFieldL(
00072             const TDesC& aCaption, 
00073             const TDesC& aText,
00074             CDesCArray& aArray,
00075             RArray<TInt>& aFieldIds);
00076 
00077         /**
00078         * Adds location fields of the landmark to arrays.
00079         *
00080         * @param aLocation contains the location data to update location fields
00081         * with.
00082         * @param aArray Target array
00083         * @param aFieldIds Target field IDs array
00084         */
00085         void AddLocationFieldsL(
00086             TLocality& aLocation,
00087             CDesCArray& aArray,
00088             RArray<TInt>& aFieldIds);
00089 
00090         /**
00091         * Adds the category fields to arrays.
00092         * @param aLandmark used to retrieve category information
00093         * @param aArray Target array
00094         * @param aFieldIds Target field IDs array
00095         */
00096         void AddCategoryFieldsL(
00097             CPosLandmark& aLandmark, 
00098             CDesCArray& aArray,
00099             RArray<TInt>& aFieldIds);
00100 
00101         /**
00102         * Adds other text field and to arrays.
00103         * @param aCaptionId Caption string resource ID
00104         * @param aText The value of the field
00105         * @param aArray Target array
00106         * @param aFieldIds Target field IDs array
00107         */
00108         void AddTextFieldL(
00109             TInt aCaptionId, 
00110             TDesC& aText,
00111             CDesCArray& aArray,
00112             RArray<TInt>& aFieldIds);
00113 
00114     private: // Data
00115 
00116         //! The application engine used for accessing landmarks
00117         CLandmarksApplicationEngine& iEngine;
00118 
00119         //! Defines how real numbers are displayed
00120         TRealFormat iRealFormat;
00121         };
00122 
00123 #endif // __LANDMARKS_INFOMODEL_H__
00124 
00125 // End of File
00126 

© Nokia 2006

Back to top