locationsystemui/locationsysui/locsuplsettingsui/inc/locsuplsettingslbmodel.h
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     1 /*
       
     2 * Copyright (c) 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:  List box model for the SUPL Settings UI
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_LOCSUPLSETTINGSLBMODEL_H_
       
    19 #define C_LOCSUPLSETTINGSLBMODEL_H_
       
    20 
       
    21 // System Include
       
    22 #include <e32base.h>
       
    23 #include <bamdesca.h>  // MDesCArray
       
    24 
       
    25 // Forward Declaration
       
    26 class CLocSUPLSettingsUiEngine;
       
    27 
       
    28 
       
    29 // Class Declaration
       
    30 /**
       
    31  * Model for the SUPL Settings UI container. 
       
    32  *
       
    33  * The model interacts with the SUPL Settings Engine inorder to obtain the latest
       
    34  * SUPL UI Settings values
       
    35  *
       
    36  * @lib locsuplsettings.lib
       
    37  * @since S60 v3.1
       
    38  */
       
    39 class CLocSUPLSettingsLBModel : public CBase,
       
    40 						        public MDesCArray
       
    41 	{
       
    42 	public:
       
    43         /**
       
    44         * Enumerations for List box Entries
       
    45         */
       
    46         enum	TSUPLSettingsItemId        
       
    47             {
       
    48             ESUPLSettingsUsage = 0,
       
    49             ESUPLSettingsServersDetail,
       
    50             ESUPLSettingsActiveSessions
       
    51             };
       
    52             	
       
    53 	public:
       
    54         /**
       
    55          * Two-phased constructor
       
    56          *
       
    57          * @param  aEngine                      Reference the SUPL Settings Engine
       
    58          * @return CLocSUPLSettingsLBModel*     Reference to the object created
       
    59          */
       
    60         static CLocSUPLSettingsLBModel* NewL( 
       
    61                         CLocSUPLSettingsUiEngine&     aEngine );
       
    62 
       
    63         /**
       
    64          * Two-phased constructor
       
    65          *
       
    66          * @param  aEngine                      Reference the SUPL Settings Engine         
       
    67          * @return CLocSUPLSettingsLBModel*     Reference to the object created
       
    68          */
       
    69         static CLocSUPLSettingsLBModel* NewLC( 
       
    70                         CLocSUPLSettingsUiEngine&     aEngine );
       
    71         
       
    72         /**
       
    73          * Destructor.
       
    74          */
       
    75         virtual ~CLocSUPLSettingsLBModel();
       
    76         
       
    77         
       
    78         /**
       
    79          * Resolves the list box index to the SUPL settings item.
       
    80          *
       
    81          * @param  aListboxIndex        List box item index.
       
    82          * @return TSUPLSettingsItemId  SUPL settings item id.
       
    83          */
       
    84         TSUPLSettingsItemId ResolveSettingsItem( TInt aListboxIndex ) const;
       
    85         
       
    86         /**
       
    87          * Returns the Active session count.
       
    88          *
       
    89          * @return TInt  SUPL Active sessions count.
       
    90          */
       
    91         TInt ActiveSessionCount( ) const;
       
    92                 
       
    93     protected:
       
    94         /**
       
    95          * Inherited from MDesCArray
       
    96          */
       
    97         TInt MdcaCount() const;
       
    98 
       
    99         /**
       
   100          * Inherited from MDesCArray
       
   101          */
       
   102         TPtrC16 MdcaPoint( TInt aIndex ) const;
       
   103         				
       
   104     private:
       
   105         /**
       
   106          * C++ constructor.
       
   107          */
       
   108         CLocSUPLSettingsLBModel( CLocSUPLSettingsUiEngine&     aEngine );
       
   109         
       
   110         /**
       
   111          * Second Phase constructor
       
   112          */
       
   113         void ConstructL();
       
   114         
       
   115         /**
       
   116          * Packs the SUPL settings usage to the end of the buffer passed.
       
   117          *
       
   118          * @param aPtr Buffer to which the Supl settings usage point needs to be 
       
   119          *            appended.         
       
   120          */
       
   121         void AppendSuplUsage( TDes16& aPtr ) const;
       
   122 
       
   123         /**
       
   124          * Packs the Server Address to the end of the buffer passed.
       
   125          * 
       
   126          * @param aPtr Buffer to which the Access point needs to be 
       
   127          *             appended.
       
   128          */
       
   129         void AppendSuplServerDetail( TDes16& aPtr ) const;  
       
   130      
       
   131         /**
       
   132          * Packs the SUPL access points count to the end of the buffer passed.
       
   133          * 
       
   134          * @param aPtr Buffer to which the SUPL access points count needs to be 
       
   135          *             appended.
       
   136          */    
       
   137         void AppendSuplActiveSessionsDetailL( TDes16& aPtr ) const;
       
   138                  
       
   139     private:
       
   140         /**
       
   141          * Format conversion buffer
       
   142          * Owns
       
   143          */
       
   144         HBufC16*                    iBuffer;
       
   145         
       
   146         /**
       
   147          * Title Text Buffer for Server Detail Heading
       
   148          * Owns
       
   149          */
       
   150         HBufC16*                    iServerDetailTitle;
       
   151         
       
   152         /**
       
   153          * Title text for SUPL usage.
       
   154          * Owns.
       
   155          */
       
   156         HBufC16*                    iSuplUsageTitle;
       
   157         
       
   158         /**
       
   159          * SUPL Active Sessions count.
       
   160          */
       
   161         mutable TInt iSessionCount;
       
   162          
       
   163         /**
       
   164          * Default Server Address 
       
   165          * Owns
       
   166          */
       
   167         HBufC16*                    iSuplServerDetail;
       
   168         
       
   169         /**
       
   170          * Default SUPL usage.
       
   171          * Owns.
       
   172          */
       
   173         HBufC16*                    iDefaultSuplUsage;
       
   174 
       
   175         /**
       
   176          * Reference the SUPL Settings Engine
       
   177          */   
       
   178         CLocSUPLSettingsUiEngine&   iEngine;
       
   179         
       
   180         /** 
       
   181          * Boolean value to indicate whethere SUPL settings usage
       
   182          * is present.
       
   183          */
       
   184         TBool                       iSuplUsagePresent;
       
   185                 
       
   186         /**
       
   187          * Boolean value to indicate whether SUPL address field
       
   188          * is present.
       
   189          */
       
   190         TBool                       iServerAddressPresent;               
       
   191 	};
       
   192 
       
   193 #endif // C_LOCSUPLSETTINGSLBMODEL_H_
       
   194