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_INFOMODEL_H__ |
|
21 #define __LANDMARKS_INFOMODEL_H__ |
|
22 |
|
23 |
|
24 #include <e32base.h> |
|
25 |
|
26 |
|
27 class TLocality; |
|
28 class CPosLandmark; |
|
29 class CLandmarksApplicationEngine; |
|
30 |
|
31 |
|
32 |
|
33 /** |
|
34 * Contains the data model of the landmarks view. |
|
35 * |
|
36 */ |
|
37 class CLandmarksInfoModel : public CBase |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * C++ constructor. |
|
43 */ |
|
44 CLandmarksInfoModel(CLandmarksApplicationEngine& aEngine); |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 ~CLandmarksInfoModel(); |
|
50 |
|
51 public: // New functions |
|
52 |
|
53 /** |
|
54 * Generates descriptor array from landmark's info. |
|
55 * Caller takes ownership of returned object |
|
56 * |
|
57 * @param aLandmark The landmark to get info of. |
|
58 * @param aFieldIds On return, landmark info field ids. |
|
59 * @return The landmark's info as descriptor array |
|
60 */ |
|
61 CDesCArray* GetLandmarkInfoL( |
|
62 CPosLandmark& aLandmark, |
|
63 RArray<TInt>& aFieldIds); |
|
64 |
|
65 private: |
|
66 |
|
67 /** |
|
68 * Adds new string describing landmark field to the info array. |
|
69 * Adds also field's ID to array of field IDs. |
|
70 * @param aCaption The caption of the field |
|
71 * @param aText The value of the field |
|
72 * @param aArray Target array |
|
73 * @param aFieldIds Target field IDs array |
|
74 */ |
|
75 void AddInfoFieldL( |
|
76 const TDesC& aCaption, |
|
77 const TDesC& aText, |
|
78 CDesCArray& aArray, |
|
79 RArray<TInt>& aFieldIds); |
|
80 |
|
81 /** |
|
82 * Adds location fields of the landmark to arrays. |
|
83 * |
|
84 * @param aLocation contains the location data to update location fields |
|
85 * with. |
|
86 * @param aArray Target array |
|
87 * @param aFieldIds Target field IDs array |
|
88 */ |
|
89 void AddLocationFieldsL( |
|
90 TLocality& aLocation, |
|
91 CDesCArray& aArray, |
|
92 RArray<TInt>& aFieldIds); |
|
93 |
|
94 /** |
|
95 * Adds the category fields to arrays. |
|
96 * @param aLandmark used to retrieve category information |
|
97 * @param aArray Target array |
|
98 * @param aFieldIds Target field IDs array |
|
99 */ |
|
100 void AddCategoryFieldsL( |
|
101 CPosLandmark& aLandmark, |
|
102 CDesCArray& aArray, |
|
103 RArray<TInt>& aFieldIds); |
|
104 |
|
105 /** |
|
106 * Adds other text field and to arrays. |
|
107 * @param aCaptionId Caption string resource ID |
|
108 * @param aText The value of the field |
|
109 * @param aArray Target array |
|
110 * @param aFieldIds Target field IDs array |
|
111 */ |
|
112 void AddTextFieldL( |
|
113 TInt aCaptionId, |
|
114 TDesC& aText, |
|
115 CDesCArray& aArray, |
|
116 RArray<TInt>& aFieldIds); |
|
117 |
|
118 private: // Data |
|
119 |
|
120 //! The application engine used for accessing landmarks |
|
121 CLandmarksApplicationEngine& iEngine; |
|
122 |
|
123 //! Defines how real numbers are displayed |
|
124 TRealFormat iRealFormat; |
|
125 }; |
|
126 |
|
127 #endif // __LANDMARKS_INFOMODEL_H__ |
|
128 |
|
129 |
|