locationsystemui/locationsysui/locsuplsettingsui/inc/locsuplserverlbmodel.h
author hgs
Wed, 03 Nov 2010 23:28:39 +0530
changeset 56 4e949f03ecc5
permissions -rw-r--r--
201044
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  List box model for the SUPL server UI
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#ifndef C_LOCSUPLSERVERLBMODEL_H_
hgs
parents:
diff changeset
    19
#define C_LOCSUPLSERVERLBMODEL_H_
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
// System Include
hgs
parents:
diff changeset
    22
#include <e32base.h>
hgs
parents:
diff changeset
    23
#include <bamdesca.h>  // MDesCArray
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
// Forward Declaration
hgs
parents:
diff changeset
    26
class CLocSUPLSettingsUiEngine;
hgs
parents:
diff changeset
    27
class CServerParams;
hgs
parents:
diff changeset
    28
hgs
parents:
diff changeset
    29
// Class Declaration
hgs
parents:
diff changeset
    30
/**
hgs
parents:
diff changeset
    31
 * Model for the SUPL Settings UI container. 
hgs
parents:
diff changeset
    32
 *
hgs
parents:
diff changeset
    33
 * The model interacts with the SUPL Settings Engine inorder to obtain the latest
hgs
parents:
diff changeset
    34
 * SUPL UI Settings values
hgs
parents:
diff changeset
    35
 *
hgs
parents:
diff changeset
    36
 * @lib locsuplsettings.lib
hgs
parents:
diff changeset
    37
 * @since S60 v3.1
hgs
parents:
diff changeset
    38
 */
hgs
parents:
diff changeset
    39
class CLocSUPLServerLBModel : public CBase,
hgs
parents:
diff changeset
    40
						      public MDesCArray
hgs
parents:
diff changeset
    41
	{
hgs
parents:
diff changeset
    42
	public:
hgs
parents:
diff changeset
    43
        /**
hgs
parents:
diff changeset
    44
        * Enumerations for List box Entries
hgs
parents:
diff changeset
    45
        */
hgs
parents:
diff changeset
    46
        enum	TSUPLSettingsItemId        
hgs
parents:
diff changeset
    47
            {
hgs
parents:
diff changeset
    48
            ESUPLSettingsServerAddress = 0
hgs
parents:
diff changeset
    49
            };
hgs
parents:
diff changeset
    50
            	
hgs
parents:
diff changeset
    51
	public:
hgs
parents:
diff changeset
    52
        /**
hgs
parents:
diff changeset
    53
         * Two-phased constructor
hgs
parents:
diff changeset
    54
         *
hgs
parents:
diff changeset
    55
         * @param  aEngine                      Reference the SUPL Settings Engine
hgs
parents:
diff changeset
    56
         * @return CLocSUPLServerLBModel*     Reference to the object created
hgs
parents:
diff changeset
    57
         */
hgs
parents:
diff changeset
    58
        static CLocSUPLServerLBModel* NewL( 
hgs
parents:
diff changeset
    59
                        CLocSUPLSettingsUiEngine&     aEngine );
hgs
parents:
diff changeset
    60
hgs
parents:
diff changeset
    61
        /**
hgs
parents:
diff changeset
    62
         * Two-phased constructor
hgs
parents:
diff changeset
    63
         *
hgs
parents:
diff changeset
    64
         * @param  aEngine                      Reference the SUPL Settings Engine         
hgs
parents:
diff changeset
    65
         * @return CLocSUPLServerLBModel*     Reference to the object created
hgs
parents:
diff changeset
    66
         */
hgs
parents:
diff changeset
    67
        static CLocSUPLServerLBModel* NewLC( 
hgs
parents:
diff changeset
    68
                        CLocSUPLSettingsUiEngine&     aEngine );
hgs
parents:
diff changeset
    69
        
hgs
parents:
diff changeset
    70
        /**
hgs
parents:
diff changeset
    71
         * Destructor.
hgs
parents:
diff changeset
    72
         */
hgs
parents:
diff changeset
    73
        virtual ~CLocSUPLServerLBModel();
hgs
parents:
diff changeset
    74
    
hgs
parents:
diff changeset
    75
    public: // New functions
hgs
parents:
diff changeset
    76
    
hgs
parents:
diff changeset
    77
        /**
hgs
parents:
diff changeset
    78
         * Returns the slp id array to get server attributes
hgs
parents:
diff changeset
    79
         */
hgs
parents:
diff changeset
    80
   		RArray<TInt64>& SlpIds();		        
hgs
parents:
diff changeset
    81
		
hgs
parents:
diff changeset
    82
        /**
hgs
parents:
diff changeset
    83
         * Refresh the slp id array list from the supl settings
hgs
parents:
diff changeset
    84
         */
hgs
parents:
diff changeset
    85
		void UpdateSlpIdsL();
hgs
parents:
diff changeset
    86
		
hgs
parents:
diff changeset
    87
    protected:
hgs
parents:
diff changeset
    88
        /**
hgs
parents:
diff changeset
    89
         * Inherited from MDesCArray
hgs
parents:
diff changeset
    90
         */
hgs
parents:
diff changeset
    91
        TInt MdcaCount() const;
hgs
parents:
diff changeset
    92
hgs
parents:
diff changeset
    93
        /**
hgs
parents:
diff changeset
    94
         * Inherited from MDesCArray
hgs
parents:
diff changeset
    95
         */
hgs
parents:
diff changeset
    96
        TPtrC16 MdcaPoint( TInt aIndex ) const;
hgs
parents:
diff changeset
    97
        				
hgs
parents:
diff changeset
    98
    private:
hgs
parents:
diff changeset
    99
        /**
hgs
parents:
diff changeset
   100
         * C++ constructor.
hgs
parents:
diff changeset
   101
         */
hgs
parents:
diff changeset
   102
        CLocSUPLServerLBModel( CLocSUPLSettingsUiEngine&     aEngine );
hgs
parents:
diff changeset
   103
        
hgs
parents:
diff changeset
   104
        /**
hgs
parents:
diff changeset
   105
         * Second Phase constructor
hgs
parents:
diff changeset
   106
         */
hgs
parents:
diff changeset
   107
        void ConstructL();
hgs
parents:
diff changeset
   108
        
hgs
parents:
diff changeset
   109
        /**
hgs
parents:
diff changeset
   110
         * Appends the server address to the end of the buffer passed.
hgs
parents:
diff changeset
   111
         * 
hgs
parents:
diff changeset
   112
         * @param aPtr Buffer to which server attributes will be
hgs
parents:
diff changeset
   113
         *             appended.
hgs
parents:
diff changeset
   114
         * @param aIndex index to get server entry 
hgs
parents:
diff changeset
   115
         */
hgs
parents:
diff changeset
   116
		void AppendSuplServerDetail( TDes& aPtr, TInt aIndex ) const;
hgs
parents:
diff changeset
   117
		
hgs
parents:
diff changeset
   118
    private:
hgs
parents:
diff changeset
   119
        /**
hgs
parents:
diff changeset
   120
         * Format conversion buffer
hgs
parents:
diff changeset
   121
         * Owns
hgs
parents:
diff changeset
   122
         */
hgs
parents:
diff changeset
   123
        HBufC16*                    	iBuffer;
hgs
parents:
diff changeset
   124
        
hgs
parents:
diff changeset
   125
        /**
hgs
parents:
diff changeset
   126
         * Reference the SUPL Settings Engine
hgs
parents:
diff changeset
   127
         */   
hgs
parents:
diff changeset
   128
        CLocSUPLSettingsUiEngine&   	iEngine;
hgs
parents:
diff changeset
   129
        
hgs
parents:
diff changeset
   130
        /** 
hgs
parents:
diff changeset
   131
         * Boolean value to indicate whethere SUPL settings usage
hgs
parents:
diff changeset
   132
         * is present.
hgs
parents:
diff changeset
   133
         */
hgs
parents:
diff changeset
   134
        TBool                       	iSuplUsagePresent;
hgs
parents:
diff changeset
   135
                
hgs
parents:
diff changeset
   136
        /**
hgs
parents:
diff changeset
   137
         * Boolean value to indicate whether SUPL address field
hgs
parents:
diff changeset
   138
         * is present.
hgs
parents:
diff changeset
   139
         */
hgs
parents:
diff changeset
   140
        TBool                       	iServerAddressPresent;     
hgs
parents:
diff changeset
   141
hgs
parents:
diff changeset
   142
        /**
hgs
parents:
diff changeset
   143
         * SUPL Servers SlpId
hgs
parents:
diff changeset
   144
         * Owns.
hgs
parents:
diff changeset
   145
         */
hgs
parents:
diff changeset
   146
        RArray< TInt64 > 				iSlpIdList;
hgs
parents:
diff changeset
   147
        
hgs
parents:
diff changeset
   148
        /**
hgs
parents:
diff changeset
   149
         * SUPL Server Addresses 
hgs
parents:
diff changeset
   150
         * Owns.
hgs
parents:
diff changeset
   151
         */
hgs
parents:
diff changeset
   152
        RPointerArray< HBufC >			iSlpAddressList;
hgs
parents:
diff changeset
   153
        
hgs
parents:
diff changeset
   154
        /**
hgs
parents:
diff changeset
   155
         * SUPL Servers with its attributes.
hgs
parents:
diff changeset
   156
         * Owns.
hgs
parents:
diff changeset
   157
         */
hgs
parents:
diff changeset
   158
        RArray< TBool>					iEnableFlagList;
hgs
parents:
diff changeset
   159
	};
hgs
parents:
diff changeset
   160
hgs
parents:
diff changeset
   161
#endif // C_LOCSUPLSERVERLBMODEL_H_
hgs
parents:
diff changeset
   162