2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: CPosLmDisplayData class
19 #ifndef CPOSLMDISPLAYDATA_H
20 #define CPOSLMDISPLAYDATA_H
24 const TInt KPosLmNoNewItems = -1;
26 class CPosLmDisplayItem;
27 class CPosLmPartialReadParameters;
30 * Displayable data collection.
32 * A displayable data collection consists of displayable items
33 * (@ref CPosLmDisplayItem). A displayable data collection either
34 * consists of landmark items (if a landmark search has been started)
35 * or category items (if a category search has been started).
36 * Items of different types cannot be mixed in the collection.
38 * Displayable data is used in @ref CPosLandmarkSearch and
39 * @ref CPosLmMultiDbSearch to hold search results. The collection is
40 * populated with new results every time the next search step is executed.
41 * Displayable items contain full or partial
42 * (see @ref CPosLandmarkDatabase::SetPartialReadParameters)
43 * landmark data or full category data, and can be used to display search
44 * results already during the search and also after it has completed.
46 * Note: The single class instance may only be used by one search
49 * @lib eposlmsearchlib.lib
52 class CPosLmDisplayData : public CBase
57 * Two-phased constructor.
59 * @returns A new instance of this class.
61 IMPORT_C static CPosLmDisplayData* NewL();
66 virtual ~CPosLmDisplayData();
71 * Returns the index of the next match found during current asynchronous
72 * search operation. If the search is executed synchronously, then all
73 * indexes of the matches found during the search are returned one
76 * After each search step, the new item indexes are returned in
77 * ascending order according to the specified sort preference in
80 * @return The item index or @p KPosLmNoNewItems when no new items
83 IMPORT_C TInt NewItemIndex();
86 * Returns the number of items in the collection.
88 * @return The number of items.
90 IMPORT_C TInt Count() const;
93 * Resets the collection and deletes all contained items.
95 IMPORT_C void Reset();
98 * Returns the displayable item specified by index.
99 * The index must be strictly less than @ref Count and not less than 0.
101 * @param[in] aItemIndex A displayable item index.
102 * @return A displayable item.
104 * @panic "Landmarks Client"-EPosInvalidIndex
105 * Item index is beyond valid range.
107 IMPORT_C CPosLmDisplayItem& DisplayItem( TInt aItemIndex ) const;
110 * Sets the partial read parameters for this display data.
112 * Partial read parameters are used to define which landmark data should
113 * be read during a landmark search. If no partial read parameters are
114 * set, the whole landmark will be read.
116 * This function only affects the searches which are started after
117 * it is called. The current search is not affected.
119 * If landmarks are sorted by name, the name will always be a part of
120 * the landmark in the display data, even if it is not requested.
122 * Note: Partial read parameters are only used for landmark searches.
124 * @param[in] aPartialSettings The partial read parameters.
126 IMPORT_C void SetPartialReadParametersL(
127 const CPosLmPartialReadParameters& aPartialSettings
131 * Unsets the partial read parameters for this display data.
133 * This means that from now on all landmarks added to this display data
134 * instance will contain all information.
136 * To have any affect, this function must be called before a search is
137 * started. If it is called during a search, it will only affect
140 * Note: Partial read parameters will only have effect on landmarks
143 IMPORT_C void UnsetPartialReadParameters();
146 /* Returns the partial read parameters set for this display data.
148 * @return Partial read parameters or NULL if not set.
150 CPosLmPartialReadParameters* PartialReadParameters() const;
153 /* Returns a reference to all the displayable items.
154 * This array owns its displayable items.
156 * @return The items array.
158 RPointerArray<CPosLmDisplayItem>& DisplayItems();
161 /* Returns a reference to the new displayable items.
162 * This array does not own its displayable items.
163 * New displayable items are always a subset of all displayable items.
165 * @return The new item indexes array.
167 RPointerArray<CPosLmDisplayItem>& NewDisplayItems();
176 RPointerArray<CPosLmDisplayItem> iDisplayItems;
177 RPointerArray<CPosLmDisplayItem> iNewDisplayItems;
178 CPosLmPartialReadParameters* iPartialParameters;
182 #endif // CPOSLMDISPLAYDATA_H