epoc32/include/mw/EPos_CPosLmDisplayData.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2005-2006 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:  CPosLmDisplayData class
    15 *
    16 */
    17 
    18 
    19 #ifndef CPOSLMDISPLAYDATA_H
    20 #define CPOSLMDISPLAYDATA_H
    21 
    22 #include <e32base.h>
    23 
    24 const TInt KPosLmNoNewItems = -1;
    25 
    26 class CPosLmDisplayItem;
    27 class CPosLmPartialReadParameters;
    28 
    29 /**
    30 * Displayable data collection.
    31 *
    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.
    37 *
    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.
    45 *
    46 * Note: The single class instance may only be used by one search
    47 * instance at a time.
    48 *
    49 *  @lib eposlmsearchlib.lib
    50 *  @since S60 3.0
    51 */
    52 class CPosLmDisplayData : public CBase
    53     {
    54     public:
    55 
    56         /**
    57         * Two-phased constructor.
    58         *
    59         * @returns A new instance of this class.
    60         */
    61         IMPORT_C static CPosLmDisplayData* NewL();
    62 
    63         /**
    64         * Destructor.
    65         */
    66         virtual ~CPosLmDisplayData();
    67 
    68     public:
    69 
    70         /**
    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
    74         * by one.
    75         *
    76         * After each search step, the new item indexes are returned in
    77         * ascending order according to the specified sort preference in
    78         * the search.
    79         *
    80         * @return The item index or @p KPosLmNoNewItems when no new items
    81         *   are available.
    82         */
    83         IMPORT_C TInt NewItemIndex();
    84 
    85         /**
    86         * Returns the number of items in the collection.
    87         *
    88         * @return The number of items.
    89         */
    90         IMPORT_C TInt Count() const;
    91 
    92         /**
    93         * Resets the collection and deletes all contained items.
    94         */
    95         IMPORT_C void Reset();
    96 
    97         /**
    98         * Returns the displayable item specified by index.
    99         * The index must be strictly less than @ref Count and not less than 0.
   100         *
   101         * @param[in] aItemIndex A displayable item index.
   102         * @return A displayable item.
   103         *
   104         * @panic "Landmarks Client"-EPosInvalidIndex
   105         *   Item index is beyond valid range.
   106         */
   107         IMPORT_C CPosLmDisplayItem& DisplayItem( TInt aItemIndex ) const;
   108 
   109         /**
   110         * Sets the partial read parameters for this display data.
   111         *
   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.
   115         *
   116         * This function only affects the searches which are started after
   117         * it is called. The current search is not affected.
   118         *
   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.
   121         *
   122         * Note: Partial read parameters are only used for landmark searches.
   123         *
   124         * @param[in] aPartialSettings The partial read parameters.
   125         */
   126         IMPORT_C void SetPartialReadParametersL(
   127             const CPosLmPartialReadParameters& aPartialSettings
   128         );
   129 
   130         /**
   131         * Unsets the partial read parameters for this display data.
   132         *
   133         * This means that from now on all landmarks added to this display data
   134         * instance will contain all information.
   135         *
   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
   138         * the next search.
   139         *
   140         * Note: Partial read parameters will only have effect on landmarks
   141         * searches.
   142         */
   143         IMPORT_C void UnsetPartialReadParameters();
   144 
   145         /** @internal */
   146         /* Returns the partial read parameters set for this display data.
   147         *
   148         * @return Partial read parameters or NULL if not set.
   149         */
   150         CPosLmPartialReadParameters* PartialReadParameters() const;
   151 
   152         /** @internal */
   153         /* Returns a reference to all the displayable items.
   154         * This array owns its displayable items.
   155         *
   156         * @return The items array.
   157         */
   158         RPointerArray<CPosLmDisplayItem>& DisplayItems();
   159 
   160         /** @internal */
   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.
   164         *
   165         * @return The new item indexes array.
   166         */
   167         RPointerArray<CPosLmDisplayItem>& NewDisplayItems();
   168 
   169     private:
   170 
   171         // C++ constructor.
   172         CPosLmDisplayData();
   173 
   174     private:
   175 
   176         RPointerArray<CPosLmDisplayItem> iDisplayItems;
   177         RPointerArray<CPosLmDisplayItem> iNewDisplayItems;
   178         CPosLmPartialReadParameters* iPartialParameters;
   179 
   180     };
   181 
   182 #endif      // CPOSLMDISPLAYDATA_H
   183 
   184