locationsystemui/locationsysui/locnotprefplugin/inc/locnotprefpluginengine.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:  Location Notation Preferences Plugin Engine
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_LOCNOTPREFPLUGINENGINE_H_
       
    19 #define C_LOCNOTPREFPLUGINENGINE_H_
       
    20 
       
    21 //  System Includes
       
    22 #include <e32base.h>
       
    23 #include <bamdesca.h>  // MDesCArray
       
    24 
       
    25 // User Includes
       
    26 #include "locnotprefadapterobserver.h"
       
    27 
       
    28 // Forward Declarations
       
    29 class MLocNotPrefEngObserver;
       
    30 class CLocNotPrefCoordinateDisplayAdapter;
       
    31 class CLocNotPrefSystemofMeasAdapter;
       
    32 
       
    33 // Constant Declarations
       
    34 
       
    35 // Class Definition
       
    36 
       
    37 /**
       
    38  * Engine for Location Notation Preferences Plugin.
       
    39  *
       
    40  * The class for interacting accessing and modifying Notation preferences settings. The 
       
    41  * class interfaces with the corresponding Central repositories for Measurement and 
       
    42  * co-ordinate settings and also listens for changes to the Cen-rep keys.
       
    43  * Further, its also doubles up as a model for the Location notation preferences 
       
    44  * list-box
       
    45  */
       
    46 class CLocNotPrefPluginEngine : public CBase,
       
    47                                 public MDesCArray,
       
    48                                 public MLocNotPrefAdapterObserver
       
    49     {
       
    50     public:
       
    51         /**
       
    52          * Enumeration for the Settings list
       
    53          */
       
    54         enum TSettingsList
       
    55             {
       
    56             /**
       
    57              * System of Measurement
       
    58              */
       
    59             ESystemofMeasurement,
       
    60             
       
    61             /**
       
    62              * Co-ordinate display format
       
    63              */
       
    64             ECoordinateDisplayFormat      
       
    65             };
       
    66             
       
    67     public:
       
    68         /**
       
    69          * Creates new Location Notation Preferences plug-in engine instance.
       
    70          *
       
    71          * @param  aEngineObserver           Observer to the Notation preferences engine
       
    72          * @return CLocNotPrefPluginEngine* Reference to the application view
       
    73          */                                                 
       
    74         static CLocNotPrefPluginEngine* NewL( MLocNotPrefEngObserver& aEngineObserver );
       
    75 
       
    76         /**
       
    77          * Creates new Location Notation Preferences plug-in engine instance.
       
    78          * Leaves the object on the Clean-up stack.
       
    79          *
       
    80          * @param  aEngineObserver           Observer to the Notation preferences engine
       
    81          * @return CLocNotPrefPluginEngine* Reference to the application view
       
    82          */                                                 
       
    83         static CLocNotPrefPluginEngine* NewLC( MLocNotPrefEngObserver& aEngineObserver );
       
    84         
       
    85         /**
       
    86          * Destructor
       
    87          */
       
    88         ~CLocNotPrefPluginEngine();
       
    89         
       
    90     public:
       
    91         /**
       
    92          * Inherited from MDesCArray
       
    93          */
       
    94         TInt MdcaCount() const;
       
    95 
       
    96         /**
       
    97          * Inherited from MDesCArray
       
    98          */
       
    99         TPtrC16 MdcaPoint( TInt aIndex ) const;
       
   100 
       
   101         /**
       
   102          * Inherited from MLocNotPrefAdapterObserver
       
   103          */     
       
   104         void HandleSettingsChangeL();
       
   105         
       
   106     public:
       
   107         /**
       
   108          * Closes the running Settings UI prematurely. This would result in dismissing
       
   109          * any active dialogs currently running
       
   110          */
       
   111         void Close();
       
   112             
       
   113         /**
       
   114          * Change System of Measurement settings
       
   115          */
       
   116         void ChangeSysofMeasSettingsL();
       
   117         
       
   118         /**
       
   119          * Toggle System of Measurement settings
       
   120          */
       
   121         void ToggleSysofMeasSettingsL();
       
   122         
       
   123         /**
       
   124          * Change Co-ordinate display format settings
       
   125          */
       
   126         void ChangeCoordinateDisplaySettingsL();
       
   127                 
       
   128     private:
       
   129         /**
       
   130          * Constructor
       
   131          */
       
   132         CLocNotPrefPluginEngine(  MLocNotPrefEngObserver& aEngineObserver );
       
   133 
       
   134         /**
       
   135          * Second Phase Constructor
       
   136          */
       
   137         void ConstructL();
       
   138         
       
   139     private:
       
   140         
       
   141         /**
       
   142          * Reference to the Engine observer
       
   143          */
       
   144         MLocNotPrefEngObserver&                 iObserver;
       
   145         
       
   146         /**
       
   147          * Co-ordinate display format settings handle
       
   148          * Owns
       
   149          */ 
       
   150         CLocNotPrefCoordinateDisplayAdapter*    iCordDisplaySettings;
       
   151         
       
   152         /**
       
   153          * System of measurements settings handle
       
   154          * Owns
       
   155          */ 
       
   156         CLocNotPrefSystemofMeasAdapter*         iSysofMeasSettings;
       
   157         
       
   158         /**
       
   159          * System of measurement heading
       
   160          * Owns
       
   161          */
       
   162         HBufC16*                                iSysofMeasTitle;
       
   163         
       
   164         /**
       
   165          * Co-ordinate display format heading
       
   166          * Owns
       
   167          */
       
   168         HBufC16*                                iCoordDispTitle;
       
   169         
       
   170         /**
       
   171          * Imperial settings text
       
   172          * Owns
       
   173          */
       
   174         HBufC16*                                iImperialSettings;
       
   175         
       
   176         /**
       
   177          * Metric settings text
       
   178          * Owns
       
   179          */
       
   180         HBufC16*                                iMetricSettings; 
       
   181         
       
   182          /**
       
   183          * Degrees resolution settings text
       
   184          * Owns
       
   185          */
       
   186         HBufC16*                                iDegreesSettings;
       
   187         
       
   188         /**
       
   189          * Minutes resolution settings text
       
   190          * Owns
       
   191          */
       
   192         HBufC16*                                iMinutesSettings;
       
   193         
       
   194         /**
       
   195          * Seconds resolution settings text
       
   196          * Owns
       
   197          */
       
   198         HBufC16*                                iSecondsSettings;
       
   199         
       
   200         /**
       
   201          * Temporary Buffer for returning values to the Accessor 
       
   202          * functions.
       
   203          * Owns
       
   204          */
       
   205         HBufC16*                                iConversionBuffer;
       
   206         
       
   207         /**
       
   208          * Boolean value to denote whether any settings dialog is currently
       
   209          * outstanding
       
   210          */
       
   211         TBool                                   iSettingsDialogOutstanding;                
       
   212                     
       
   213     };          
       
   214 
       
   215 #endif // C_LOCNOTPREFPLUGINENGINE_H_
       
   216