genericpositioningplugins/locationnpppsy/inc/npppsysettinghandler.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     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:  NPP PSY status event report handler header file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef NPPPSYSETTINGHANDLER_H
       
    21 #define NPPPSYSETTINGHANDLER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 
       
    28 // CLASS DECLARATION
       
    29 class CRepository;
       
    30 class CNppPsyStatusHandler;
       
    31 
       
    32 /**
       
    33 *  This class implements the handler that responsible for read and write
       
    34 *  PSY list from Central Repository.
       
    35 *  
       
    36 *  This class owns an instance of CRepository.
       
    37 *
       
    38 *  @lib nlanpppsy.dll
       
    39 *  @since 3.1
       
    40 */
       
    41 class CNppPsySettingHandler : public CActive
       
    42     {
       
    43     public:  // Constructors and destructor
       
    44         
       
    45         /**
       
    46         * Two - phased constructor.
       
    47         * @param aStatusHandler Referece to CNppPsyStatusHandler
       
    48         * @return Constructed object of CNppPsySettingHandler
       
    49         */
       
    50         static CNppPsySettingHandler* NewL( 
       
    51             CNppPsyStatusHandler& aStatusHandler );
       
    52         
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         ~CNppPsySettingHandler();
       
    57 
       
    58     public: // Functions from base classes
       
    59         /**
       
    60         * Get PSY list from setting
       
    61         * @param aList On return contains the PSY list
       
    62         */
       
    63         void GetPsyListL( RArray < TUid > &aList );
       
    64 
       
    65         /**
       
    66         * Move PSY to last
       
    67         * @param aPsy The Uid of the PSY that should be moved to the end
       
    68         *        of PSY priority list
       
    69         */
       
    70         void MovePsyLast( TUid aPsy );
       
    71         
       
    72         /**
       
    73         * Remove PSY from the list
       
    74         * @param aPsy The Uid of the PSY to be removed from setting
       
    75         */
       
    76         void RemovePsy( TUid aPsy );
       
    77         
       
    78     private: // From base classes
       
    79         /**
       
    80         * From CActive
       
    81         */
       
    82         void RunL();
       
    83         
       
    84         /**
       
    85         * From CActive
       
    86         */
       
    87         void DoCancel();
       
    88         
       
    89         /**
       
    90         * From CActive
       
    91         */
       
    92         TInt RunError( TInt aError );
       
    93 
       
    94     private:
       
    95 
       
    96         /**
       
    97         * C++default constructor.
       
    98         */
       
    99         CNppPsySettingHandler( CNppPsyStatusHandler& aStatusHandler );
       
   100 
       
   101         /**
       
   102         * By default Symbian 2nd phase constructor is private.
       
   103         */
       
   104         void ConstructL();
       
   105 
       
   106         /**
       
   107         * Parse PSY list setting from CenRep
       
   108         */
       
   109         void ParseSettingL(
       
   110             TInt& aListFrozen, 
       
   111             RArray < TUid >& aPsyList );
       
   112         
       
   113         /**
       
   114         * Check if the key value in ROM contains different PSY or 
       
   115         * frozen flag. If it's different, then reset the key and
       
   116         * use the key value in ROM. 
       
   117         * 
       
   118         * This operation is needed when phone is restore to a old 
       
   119         * version of backup.
       
   120         */
       
   121         void ValidateRomKeyValueL();
       
   122 
       
   123         /**
       
   124         * Write setting. If the setting can't be writen, this function
       
   125         * will just return.
       
   126         */
       
   127         void WriteSetting(); 
       
   128         
       
   129         /**
       
   130         * This function will remove PSY UID which are there already in cenrep key which 
       
   131         * is configured during runtime.
       
   132         */
       
   133         void RemoveDuplicatePsyUid(RArray < TUid >& aToPsyList ,RArray < TUid >& aFromPsyList );
       
   134         
       
   135 
       
   136     private:    // Data
       
   137         //Status handler
       
   138         CNppPsyStatusHandler& iStatusHandler;
       
   139         
       
   140         //Central repository
       
   141         CRepository* iRepository;
       
   142 
       
   143         //Indicate if PSY list is frozen and frozen mode
       
   144         TInt iListFrozen;
       
   145 
       
   146         //Psy list
       
   147         RArray < TUid > iPsyList;
       
   148 
       
   149     };
       
   150 
       
   151 #endif      // NPPPSYSETTINGHANDLER_H
       
   152             
       
   153 // End of File