locationsystemui/locationsysui/locnotprefplugin/inc/locnotprefpluginview.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 view
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_LOCNOTPREFPLUGINVIEW_H_
       
    19 #define C_LOCNOTPREFPLUGINVIEW_H_
       
    20 
       
    21 //  System Includes
       
    22 #include <data_caging_path_literals.hrh>
       
    23 #include <e32base.h>
       
    24 #include <aknview.h>
       
    25 #include <aknViewAppUi.h>
       
    26 #include <ConeResLoader.h>
       
    27 
       
    28 // User Includes
       
    29 #include "locnotprefpluginuid.hrh"
       
    30 #include "locnotprefplugincmdhdlr.h"
       
    31 #include "locnotprefengobserver.h"
       
    32 
       
    33 // Forward Declarations
       
    34 class CLocNotPrefPluginContainer;
       
    35 class MLocNotPrefPluginCmdHdlr;
       
    36 class MLocSettingsUiObserver;
       
    37 class CLocNotPrefPluginEngine;
       
    38 class CTextResolver;
       
    39     
       
    40 // Constant Declarations
       
    41 const TUid KLocNotPrefViewPluginUid = { KLocNotPrefPluginUID3 };
       
    42 _LIT( KLocNotPrefViewResFileName, "locnotprefpluginview.rsc" );
       
    43 
       
    44 // Class Definition
       
    45 
       
    46 /**
       
    47  * Location Notation Preferences Plugin view class. 
       
    48  */
       
    49 class CLocNotPrefPluginView : public CAknView,
       
    50                               public MLocNotPrefPluginCmdHdlr,
       
    51                               public MLocNotPrefEngObserver
       
    52     {
       
    53     public:
       
    54         /**
       
    55          * Creates new Location Notation Preferences plug-in view.
       
    56          *
       
    57          * @param  aSettingsObsrv           Observer to the Settings UI
       
    58          * @return CLocNotPrefPluginView&   Reference to the application view
       
    59          */                                                 
       
    60         static CLocNotPrefPluginView* NewL( MLocSettingsUiObserver& aSettingsObsrv );
       
    61 
       
    62         /**
       
    63          * Creates new Location Notation Preferences plug-in view. 
       
    64          * Leaves the object on the Clean up stack
       
    65          *
       
    66          * @param  aSettingsObsrv           Observer to the Settings UI         
       
    67          * @return CLocNotPrefPluginView&   Reference to the application view
       
    68          */                                                 
       
    69         static CLocNotPrefPluginView* NewLC( MLocSettingsUiObserver& aSettingsObsrv );
       
    70         
       
    71         /**
       
    72          * Destructor
       
    73          */
       
    74         ~CLocNotPrefPluginView ();
       
    75 
       
    76         /**
       
    77          * Close the Notation preferences Settings
       
    78          */
       
    79         void CloseSettings();
       
    80         
       
    81         /**
       
    82          * From CAknView. 
       
    83          */
       
    84         void DoActivateL( const TVwsViewId& aPrevViewId,
       
    85                                 TUid        aCustomMessageId,
       
    86                           const TDesC8&     aCustomMessage );
       
    87         
       
    88         /**
       
    89          * From CAknView. 
       
    90          */
       
    91         void DoDeactivate();
       
    92  
       
    93         /**
       
    94          * From CAknView. Returns the View Id. Should be chosen to reflect 
       
    95          * the Implementation UID of the Plugin
       
    96          */
       
    97         TUid Id() const;
       
    98 
       
    99         /**
       
   100          * From CAknView. 
       
   101          */
       
   102         void HandleCommandL(TInt aCommand);
       
   103         
       
   104        /**
       
   105         * From MEikMenuObserver
       
   106         */
       
   107         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );        
       
   108         
       
   109     public:
       
   110         /**
       
   111          * Inherited from MLocNotPrefPluginCmdHdlr
       
   112          * Handles commands from the container
       
   113          *
       
   114          * @param  aCommand Command ID
       
   115          */
       
   116         void HandleCmdL( TLocNotPrefPluginCmd aCommand );
       
   117 
       
   118     public:
       
   119         /**
       
   120          * Inherited from MLocNotPrefEngObserver
       
   121          */
       
   122         void HandleSettingsChangeEventL();
       
   123                 
       
   124     private:
       
   125         /**
       
   126          * Constructor
       
   127          */
       
   128         CLocNotPrefPluginView( MLocSettingsUiObserver& aSettingsObsrv );
       
   129 
       
   130         /**
       
   131          * Second Phase Constructor
       
   132          */
       
   133         void ConstructL();
       
   134     
       
   135         /**
       
   136          * Shows or dims help option, depending wheather help feature
       
   137          * is supported or not.
       
   138          * @param aMenuPane
       
   139          */
       
   140         void HandleHelpFeature( CEikMenuPane& aMenuPane ) const;
       
   141             
       
   142         /**
       
   143          * Handle Settings Change Event
       
   144          * 
       
   145          * @param aCmd Settings change command
       
   146          */
       
   147         void SettingsChangeL( TInt aCmd );
       
   148         
       
   149         /**
       
   150          * Opens the nearest localized resourcefile using aResourceLoader. 
       
   151          * aResourceLoader should be opened only once before closing it. 
       
   152          * Otherwise it will raise a panic. Therefore it is better to have 
       
   153          * multiple resource loaders.
       
   154          * 
       
   155          * @param aResourceFileName Drive and name of resource file in format 
       
   156          *                          <path>:<rsc_file_name>
       
   157          * @param aResourceLoader Resource loader for the resource. The loader 
       
   158          *                        must not be opened allready or it will raise 
       
   159          *                        a panic. It is caller's responsibility to 
       
   160          *                        close the resource loader after using the 
       
   161          *                        resource.
       
   162          */
       
   163         void OpenLocalizedResourceFileL( const TDesC&                aResourceFileName, 
       
   164                                                RConeResourceLoader&  aResourceLoader );
       
   165         
       
   166     private:        
       
   167         /**
       
   168          * Reference to the Settings UI Observer. Used to notify the dismissal of the 
       
   169          * plug-in
       
   170          */
       
   171         MLocSettingsUiObserver&         iSettingsObserver;
       
   172         
       
   173         /**
       
   174          * Resource loader handle
       
   175          * Owns
       
   176          */
       
   177         RConeResourceLoader             iResourceLoader;
       
   178         
       
   179         /**
       
   180          * Location notation preferences Container
       
   181          * Owns
       
   182          */
       
   183         CLocNotPrefPluginContainer*     iContainer;
       
   184         
       
   185         /**
       
   186          * Location noation preferences engine
       
   187          * Owns
       
   188          */
       
   189         CLocNotPrefPluginEngine*        iEngine;
       
   190         
       
   191         /**
       
   192          * Standard Text resolver for converting Error codes to 
       
   193          * standard texts
       
   194          * Owns
       
   195          */
       
   196         CTextResolver*                  iTextResolver;        
       
   197     };          
       
   198 
       
   199 #endif // C_LOCNOTPREFPLUGINVIEW_H_
       
   200