locationsystemui/locationsysui/locsuplsettingsui/inc/locsuplserverlbmodel.h
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     1 /*
       
     2 * Copyright (c) 2008 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 server UI
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_LOCSUPLSERVERLBMODEL_H_
       
    19 #define C_LOCSUPLSERVERLBMODEL_H_
       
    20 
       
    21 // System Include
       
    22 #include <e32base.h>
       
    23 #include <bamdesca.h>  // MDesCArray
       
    24 
       
    25 // Forward Declaration
       
    26 class CLocSUPLSettingsUiEngine;
       
    27 class CServerParams;
       
    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 CLocSUPLServerLBModel : public CBase,
       
    40 						      public MDesCArray
       
    41 	{
       
    42 	public:
       
    43         /**
       
    44         * Enumerations for List box Entries
       
    45         */
       
    46         enum	TSUPLSettingsItemId        
       
    47             {
       
    48             ESUPLSettingsServerAddress = 0
       
    49             };
       
    50             	
       
    51 	public:
       
    52         /**
       
    53          * Two-phased constructor
       
    54          *
       
    55          * @param  aEngine                      Reference the SUPL Settings Engine
       
    56          * @return CLocSUPLServerLBModel*     Reference to the object created
       
    57          */
       
    58         static CLocSUPLServerLBModel* NewL( 
       
    59                         CLocSUPLSettingsUiEngine&     aEngine );
       
    60 
       
    61         /**
       
    62          * Two-phased constructor
       
    63          *
       
    64          * @param  aEngine                      Reference the SUPL Settings Engine         
       
    65          * @return CLocSUPLServerLBModel*     Reference to the object created
       
    66          */
       
    67         static CLocSUPLServerLBModel* NewLC( 
       
    68                         CLocSUPLSettingsUiEngine&     aEngine );
       
    69         
       
    70         /**
       
    71          * Destructor.
       
    72          */
       
    73         virtual ~CLocSUPLServerLBModel();
       
    74     
       
    75     public: // New functions
       
    76     
       
    77         /**
       
    78          * Returns the slp id array to get server attributes
       
    79          */
       
    80    		RArray<TInt64>& SlpIds();		        
       
    81 		
       
    82         /**
       
    83          * Refresh the slp id array list from the supl settings
       
    84          */
       
    85 		void UpdateSlpIdsL();
       
    86 		
       
    87     protected:
       
    88         /**
       
    89          * Inherited from MDesCArray
       
    90          */
       
    91         TInt MdcaCount() const;
       
    92 
       
    93         /**
       
    94          * Inherited from MDesCArray
       
    95          */
       
    96         TPtrC16 MdcaPoint( TInt aIndex ) const;
       
    97         				
       
    98     private:
       
    99         /**
       
   100          * C++ constructor.
       
   101          */
       
   102         CLocSUPLServerLBModel( CLocSUPLSettingsUiEngine&     aEngine );
       
   103         
       
   104         /**
       
   105          * Second Phase constructor
       
   106          */
       
   107         void ConstructL();
       
   108         
       
   109         /**
       
   110          * Appends the server address to the end of the buffer passed.
       
   111          * 
       
   112          * @param aPtr Buffer to which server attributes will be
       
   113          *             appended.
       
   114          * @param aIndex index to get server entry 
       
   115          */
       
   116 		void AppendSuplServerDetail( TDes& aPtr, TInt aIndex ) const;
       
   117 		
       
   118     private:
       
   119         /**
       
   120          * Format conversion buffer
       
   121          * Owns
       
   122          */
       
   123         HBufC16*                    	iBuffer;
       
   124         
       
   125         /**
       
   126          * Reference the SUPL Settings Engine
       
   127          */   
       
   128         CLocSUPLSettingsUiEngine&   	iEngine;
       
   129         
       
   130         /** 
       
   131          * Boolean value to indicate whethere SUPL settings usage
       
   132          * is present.
       
   133          */
       
   134         TBool                       	iSuplUsagePresent;
       
   135                 
       
   136         /**
       
   137          * Boolean value to indicate whether SUPL address field
       
   138          * is present.
       
   139          */
       
   140         TBool                       	iServerAddressPresent;     
       
   141 
       
   142         /**
       
   143          * SUPL Servers SlpId
       
   144          * Owns.
       
   145          */
       
   146         RArray< TInt64 > 				iSlpIdList;
       
   147         
       
   148         /**
       
   149          * SUPL Server Addresses 
       
   150          * Owns.
       
   151          */
       
   152         RPointerArray< HBufC >			iSlpAddressList;
       
   153         
       
   154         /**
       
   155          * SUPL Servers with its attributes.
       
   156          * Owns.
       
   157          */
       
   158         RArray< TBool>					iEnableFlagList;
       
   159 	};
       
   160 
       
   161 #endif // C_LOCSUPLSERVERLBMODEL_H_
       
   162