locationsystemui/locationsysui/locpsysettings/locpsysettingseng/inc/locpsysettings.h
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     1 /*
       
     2 * Copyright (c) 2002,2005 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:  Implementes settings extension API
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CLOCPSYSETTINGS_H__
       
    21 #define CLOCPSYSETTINGS_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <lbs/epos_mposmodulesobserver.h> 
       
    26 #include <lbs/epos_cposmoduleidlist.h>
       
    27 
       
    28 #include "locpsyinfo.h"
       
    29 #include "locpsysettingsinterface.h"
       
    30 
       
    31 /// FORWARD DECLARATION
       
    32 class CPosModules;
       
    33 class CPosModuleIdList;
       
    34 class MLocPsyEngObserver;
       
    35 class CLocPsyConfigUiServiceClientImpl;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 *  An location engine API for location application.
       
    41 *  Provides access to location settings.
       
    42 *  @lib loceng.lib
       
    43 *  @since 2.1
       
    44 */
       
    45 class CLocPsySettings : public CBase, 
       
    46                         public MLocPsySettings, 
       
    47 						public MPosModulesObserver
       
    48     {
       
    49     private:
       
    50         /**
       
    51         * C++ default constructor.
       
    52         */
       
    53         CLocPsySettings();
       
    54         
       
    55     public:
       
    56         /**
       
    57         * Two-phased constructor.
       
    58         */
       
    59         static CLocPsySettings* NewL();
       
    60 
       
    61         /**
       
    62         * Destructor.
       
    63         */
       
    64         virtual ~CLocPsySettings();
       
    65 
       
    66     private:
       
    67         /**
       
    68         * By default Symbian 2nd phase constructor is private.
       
    69         */
       
    70         void ConstructL();
       
    71 
       
    72     public:
       
    73         /**
       
    74          * Accessor function for obtaining the number of PSYs
       
    75          * 
       
    76          * @return TInt Number of PSYs
       
    77          */    
       
    78         inline TInt PSYCount();
       
    79         
       
    80         /**
       
    81          * Accessor function for obtaining the PSY information
       
    82          * 
       
    83          * @return CLocPsyInfo* PSY information
       
    84          */         
       
    85         CLocPsyInfo* GetPsyL( TInt aIndex );
       
    86         
       
    87         /**
       
    88          * Enable a particular PSY
       
    89          * 
       
    90          * @param TInt Index of the PSY
       
    91          */          
       
    92 		void EnablePsyL( TInt aIndex );
       
    93 		
       
    94         /**
       
    95          * Disable a particular PSY
       
    96          * 
       
    97          * @param TInt Index of the PSY
       
    98          */ 		
       
    99 		void DisablePsyL( TInt aIndex );
       
   100 		
       
   101         /**
       
   102          * Launch the configuration UI for a particular PSY
       
   103          * 
       
   104          * @param TInt Index of the PSY
       
   105          */ 		
       
   106 		void ConfigurePsyL( TInt                        aIndex,
       
   107 		                    MAknServerAppExitObserver&  aObserver );
       
   108 		    
       
   109         /**
       
   110          * Accessor function to determine whether the PSY is enabled
       
   111          * 
       
   112          * @param  TInt     Index of the PSY
       
   113          * @return TBool    Boolean value to indicate whether the PSY 
       
   114          *                  has been enabled / disabled
       
   115          */ 		                    
       
   116 		TBool IsPsyEnabled( TInt aIndex );
       
   117 	
       
   118         /**
       
   119          * Accessor function to determine whether the PSY is configurable
       
   120          * 
       
   121          * @param  TInt     Index of the PSY
       
   122          * @return TBool    Boolean value to indicate whether the PSY 
       
   123          *                  can be configured
       
   124          */		
       
   125 		TBool IsPsyConfigurable( TInt aIndex );
       
   126 		
       
   127         /**
       
   128          * Close the launched configuration
       
   129          *
       
   130          */ 		
       
   131 		void ClosePsyConfigurationApp();
       
   132 	
       
   133         /**
       
   134          * Accessor function for setting the PSY Settings UI Engine 
       
   135          * Observer
       
   136          * 
       
   137          * @param aObserver Observer to the PSY Settings UI Engine
       
   138          */ 		
       
   139         void SetObserver(MLocPsyEngObserver& aObserver);
       
   140         
       
   141         /**
       
   142          * Accessor function for removing the PSY Settings UI Engine 
       
   143          * Observer
       
   144          *
       
   145          */        
       
   146         void RemoveModelObserver();
       
   147 
       
   148     public:
       
   149         /**
       
   150          * MPosModulesObserver
       
   151          */
       
   152         virtual void HandleSettingsChangeL(TPosModulesEvent aEvent);
       
   153 		
       
   154     private:
       
   155         /// Own: Pointer to modules db
       
   156         CPosModules* iModuleDb;
       
   157         /// Own: Pointer to modules id list
       
   158         CPosModuleIdList* iPsyList;
       
   159         /// Own: psy info
       
   160         CLocPsyInfo* iPsy;
       
   161         /// Ref: Observer interface to location application engine
       
   162         MLocPsyEngObserver* iObserver;
       
   163         /// Own: Handle to the PSY configuration UI application. 
       
   164         ///      Used to close the configuration application if the PSY in uninstalled.
       
   165         CLocPsyConfigUiServiceClientImpl* iServClient;
       
   166     };
       
   167 
       
   168 TInt CLocPsySettings::PSYCount()
       
   169     {
       
   170     return iPsyList->Count();
       
   171     }
       
   172 
       
   173 
       
   174 #endif      // __CLOCPSYSETTINGS_H__   
       
   175             
       
   176 // End of File