locationcentre/lcapp/inc/lclistboxmodel.h
branchRCL_3
changeset 16 4721bd00d3da
parent 14 3a25f69541ff
child 21 e15b7f06eba6
equal deleted inserted replaced
14:3a25f69541ff 16:4721bd00d3da
     1 /*
       
     2 * Copyright (c) 2007 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:  List box model for the list-box used to display the Location
       
    15 *                Centre pop-up and the list in Location Centre Application.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef C_LCLISTBOXMODEL_H
       
    21 #define C_LCLISTBOXMODEL_H
       
    22 
       
    23 // SYSTEM INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <bamdesca.h>  // MDesCArray
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CLcLocationAppInfoArray;
       
    29 class CLcListBoxModel;
       
    30 
       
    31 /**
       
    32  *  List box model for Location Centre
       
    33  *  
       
    34  *  This class provides the implementation of the list-box model for Location
       
    35  *  Centre lists. Currently this is used in both the Location Centre pop-up
       
    36  *  and in Location Centre Application.
       
    37  *
       
    38  *  @lib lcservice.lib
       
    39  *  @since S60 v5.0
       
    40  */
       
    41 class CLcListBoxModel : public CBase,
       
    42 						public MDesCArray
       
    43     {
       
    44 public:    
       
    45     /**
       
    46      * Constructs a new instance of Location Centre list box model.
       
    47      *
       
    48      * @param[in] aAppArray Array of Location based Applicaions and Contents/Services
       
    49      *                      The ownership of the array is transferred.
       
    50      * @return The new instance of Location Centre model object.
       
    51      * @leave System wide error code if the object creation fails.         
       
    52      */
       
    53     static CLcListBoxModel* NewL( CLcLocationAppInfoArray*	aAppArray );        
       
    54 
       
    55     /**
       
    56      * C++ Destructor.
       
    57      * Frees all the resources associated with this Location Centre
       
    58      * model object.
       
    59      */
       
    60     virtual ~CLcListBoxModel();
       
    61     
       
    62     /**
       
    63      * Updates the Listbox model with a new Array of Location based Applications
       
    64      * and Contents/Services.
       
    65      *
       
    66      * @param[in] aAppArray Array of Location based Applicaions and Contents/Services
       
    67      *                      The ownership of the array is transferred.
       
    68      */
       
    69     void UpdateModel( CLcLocationAppInfoArray*	aAppArray );
       
    70     
       
    71     /**
       
    72      * Accessor method for retrieving the Application Information array.
       
    73      *
       
    74      * @return CLcLocationAppInfoArray, Reference to the existing Application
       
    75      * 									Information array.
       
    76      */
       
    77     CLcLocationAppInfoArray& AppArray();
       
    78     
       
    79     /** 
       
    80      * Returns the Application's Identifer corresponding to the index passed.
       
    81      * 
       
    82      * @param[in] aIndex, Index of the Location Application whose Identifier
       
    83      *                    is requested. 
       
    84      */
       
    85     TPtrC AppInfoId( TInt aIndex ) const;     
       
    86         
       
    87 public: // Inherited from Base classes
       
    88     /**
       
    89      * Inherited from MDesCArray
       
    90      */
       
    91     virtual TInt MdcaCount() const;
       
    92 
       
    93     /**
       
    94      * Inherited from MDesCArray
       
    95      */
       
    96     virtual TPtrC16 MdcaPoint( TInt aIndex ) const;
       
    97 
       
    98 private:
       
    99     /**
       
   100      * Overloaded constructor
       
   101      */
       
   102     CLcListBoxModel(  CLcLocationAppInfoArray*	aAppArray );
       
   103 
       
   104     /**
       
   105      * Second phase of the two phase constructor
       
   106      */
       
   107     void ConstructL();
       
   108 
       
   109 private: // data
       
   110     
       
   111     /**
       
   112      * Buffer for packing the MdcaPoint
       
   113      *
       
   114      * Owns
       
   115      */
       
   116     HBufC16*					iBuffer;
       
   117     
       
   118     /**
       
   119      * Application Information Array
       
   120      */
       
   121     CLcLocationAppInfoArray*	iAppArray;
       
   122     };
       
   123 
       
   124 #endif // C_LCLISTBOXMODEL_H