locationsystemui/locationsysui/locsysuiview/inc/locsysuiview.h
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     1 /*
       
     2 * Copyright (c) 2005-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: This  is a header file for view class of Location settings Ui
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_LOCSYSUIVIEW_H_
       
    19 #define C_LOCSYSUIVIEW_H_
       
    20 
       
    21 //  System Includes
       
    22 #include <e32base.h>
       
    23 #include <aknview.h>
       
    24 #include <eikclb.h>
       
    25 #include <ConeResLoader.h>
       
    26 #include <gsplugininterface.h>
       
    27 
       
    28 // User Includes
       
    29 #include "locsysuiviewuid.hrh"
       
    30 #include "locsysuicontainereventhandler.h"
       
    31 #include "locationui.h"
       
    32 #include "locsettingsuiecomnotifier.h"
       
    33 
       
    34 // Forward Declarations
       
    35 class CGulIcon;
       
    36 class CLocSysUiContainer;
       
    37 class CLocSettingsUiEngine;
       
    38 
       
    39 // Global Constant Declarations
       
    40 
       
    41 /** 
       
    42  * Plug-In Impletation and View ID 
       
    43  */
       
    44 const TUid KLocSysUiViewPluginUid = { LOCSYSUIVIEW_UID3 };
       
    45 
       
    46 /**
       
    47  * Name of the Plug-in resource file
       
    48  */
       
    49 _LIT( KLocSysUiViewResFileName, "locsysuiviewrsc.rsc" );
       
    50 
       
    51 // Class Declaration
       
    52 
       
    53 /**
       
    54 * Location System UI plugin. Extends the CGSPluginInterface to implement the 
       
    55 * Location Specific Settings. 
       
    56 *
       
    57 * @lib locsysuiview.lib
       
    58 * @since S60 v3.1  
       
    59 */
       
    60 class CLocSysUiView : public CGSPluginInterface,
       
    61 					  public MLocationUIObserver,
       
    62 					  public MLocSettingsUiEcomNotifer,
       
    63 					  public MLocSysUiContainerEventHandler 
       
    64 	{        	
       
    65 	public:
       
    66         /**
       
    67          * Destructor
       
    68          */
       
    69         virtual ~CLocSysUiView();
       
    70         
       
    71         /**
       
    72          * Creates new Location Sys Ui plugin.
       
    73          *
       
    74          * @return CLocSysUiView*	Reference to the application view
       
    75          */                                                 
       
    76         IMPORT_C static CLocSysUiView* NewL();
       
    77 
       
    78         /**
       
    79          * Creates new Location Sys Ui plugin. Leaves the object on the 
       
    80          * Clean up stack
       
    81          *
       
    82          * @return CLocSysUiView*	Reference to the application view
       
    83          */                                                 
       
    84         static CLocSysUiView* NewLC();
       
    85 
       
    86         /**
       
    87          * Sets the flag that the view has been launched from Positioning
       
    88          * Settings Application. This is necessary to variate the CBA for
       
    89          * stand-alone launches.
       
    90          */
       
    91         IMPORT_C void LaunchedfromPosSettingsApp();
       
    92         
       
    93         /**
       
    94          * Handles any change in the client rectangle
       
    95          */
       
    96         void HandleClientRectChange();
       
    97 
       
    98         /**
       
    99          * Open Postioning View. 
       
   100          * Opens the Postioning View in the default mode.
       
   101          */
       
   102         void ActivateViewL();
       
   103         
       
   104         /**
       
   105          * Closes the Positioning View and all the associated sub-settings
       
   106          * views
       
   107          */
       
   108         void DeActivateView();
       
   109        
       
   110         /**
       
   111          * Sets an External Observer for notification about the termination
       
   112          * of Postioning Setting UI.
       
   113          *
       
   114          * @param aObserver Observer to Postioning Settings UI.
       
   115          */
       
   116         void SetObserver( MLocationUIObserver*       aObserver );
       
   117          
       
   118     public:
       
   119         /**
       
   120          * From CAknView. 
       
   121          */
       
   122         void DoActivateL( const TVwsViewId&  aPrevViewId,
       
   123         					    TUid		 aCustomMessageId,
       
   124         			      const TDesC8&	     aCustomMessage );
       
   125 
       
   126         /**
       
   127          * From CAknView. 
       
   128          */
       
   129         void DoDeactivate();
       
   130 
       
   131         /**
       
   132          * From CAknView. Returns the View Id. Should be chosen to reflect 
       
   133          * the Implementation UID of the Plugin
       
   134          */
       
   135         TUid Id() const;
       
   136 
       
   137         /**
       
   138          * From CAknView. 
       
   139          */
       
   140         void HandleCommandL(TInt aCommand);
       
   141     
       
   142     public:
       
   143         /**
       
   144          * From MEikMenuObserver
       
   145          */
       
   146         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   147            
       
   148     public: 
       
   149         /**
       
   150          * Inherited from CGSPluginInterface. 
       
   151          * Method for getting caption of this plugin. This should be the 
       
   152          * localized name of the settings view to be shown in parent view.
       
   153          *
       
   154          * @param aCaption pointer to Caption variable
       
   155          */
       
   156         void GetCaptionL( TDes& aCaption ) const;
       
   157 
       
   158         /**
       
   159          * Inherited from CGSPluginInterface.
       
   160          * Creates a new icon of desired type. Ownership of the created icon 
       
   161          * is transferred to the caller.
       
   162          *
       
   163          * Icon type UIDs (use these defined constants):
       
   164          * KGSIconTypeLbxItem  -   ListBox item icon.
       
   165          * KGSIconTypeTab      -   Tab icon.
       
   166          * 
       
   167          * @param aIconType UID Icon type UID of the icon to be created.
       
   168          * @return CGulIcon* Pointer of the icon. NOTE: Ownership of this
       
   169          *					icon is transferred to the caller.
       
   170          */
       
   171         CGulIcon* CreateIconL( const TUid aIconType );
       
   172 
       
   173         /**
       
   174          * Inherited from CGSPluginInterface
       
   175          * Method for reading the ID of the plugin provider category. 
       
   176          *
       
   177          * @return Plugin provider category ID defined by 
       
   178          *         TGSPluginProviderCategory
       
   179          */
       
   180         TInt PluginProviderCategory() const;
       
   181 
       
   182     public: // Inherited from MLocationUIObserver
       
   183         /**
       
   184          * Inherited from MLocationUIObserver
       
   185          * Notifies the termination of the Settings UI
       
   186          *
       
   187          * @param aErrorCode The termination reason. KErrNone for normal 
       
   188          *					terminations. In case of error or pre-mature
       
   189          *					aborting System wide Error codes.
       
   190          */
       
   191         void LocationUIDismissed( TInt aErrorCode );
       
   192 
       
   193     public: // Inherited from MLocSettingsUiEcomNotifer
       
   194         /** 
       
   195          * Inherited from MLocSettingsUiEcomNotifer
       
   196          * Notifies any change in the state of the underlying Settings UI
       
   197          * session
       
   198          *
       
   199          * @param aErrorCode Error Code denoting the state change
       
   200          */
       
   201         void EComSessionStateChanged( TInt aErrorCode );
       
   202     
       
   203     public:
       
   204         /**
       
   205          * Handles the Item selection event from the container.
       
   206          * Inherited from MLocSysUiContainerEventHandler
       
   207          */
       
   208         void ListBoxItemSelectedL();
       
   209 
       
   210         /**
       
   211          * Handles the Screen Size update
       
   212          * Inherited from MLocSysUiContainerEventHandler
       
   213          */
       
   214         void HandleScreenSizeChange();
       
   215                
       
   216 	private:
       
   217         /**
       
   218          * Constructor
       
   219          */
       
   220         CLocSysUiView();
       
   221         
       
   222         /**
       
   223          * Second Phase Constructor
       
   224          */
       
   225         void ConstructL();
       
   226 
       
   227         /**
       
   228          * Opens the nearest localized resourcefile using aResourceLoader. 
       
   229          * aResourceLoader should be opened only once before closing it. 
       
   230          * Otherwise it will raise a panic. Therefore it is better to have 
       
   231          * multiple resource loaders.
       
   232          * 
       
   233          * @param aResourceFileName Drive and name of resource file in format 
       
   234          *                          <path>:<rsc_file_name>
       
   235          * @param aResourceLoader Resource loader for the resource. The loader 
       
   236          *                        must not be opened allready or it will raise 
       
   237          *                        a panic. It is caller's responsibility to 
       
   238          *                        close the resource loader after using the 
       
   239          *                        resource.
       
   240          */
       
   241         void OpenLocalizedResourceFileL( const TDesC& 				aResourceFileName, 
       
   242         								       RConeResourceLoader& aResourceLoader );
       
   243 	    /**
       
   244          * Shows or dims help option, depending wheather help feature
       
   245          * is supported or not.
       
   246          * @param aMenuPane
       
   247          */
       
   248         void HandleHelpFeature( CEikMenuPane& aMenuPane ) const;
       
   249         	 
       
   250 	private:
       
   251 	    /**
       
   252 	     * View of the View that was active before this view was launched
       
   253 	     */
       
   254 		TVwsViewId 						iPrevViewId;
       
   255 		
       
   256 	    /**
       
   257 	     * Resource Loader
       
   258 	     */
       
   259 		RConeResourceLoader 			iResourceLoader;
       
   260 		
       
   261 	    /**
       
   262 	     * Reference to the Location System UI Engine
       
   263 	     * Owns
       
   264 	     */
       
   265 		CLocSettingsUiEngine*		    iEngine;
       
   266 		
       
   267 	    /**
       
   268 	     * Reference to the Location System UI Container
       
   269 	     * Owns
       
   270 	     */
       
   271 		CLocSysUiContainer*		        iContainer;
       
   272 		
       
   273 	    /**
       
   274 	     * Boolean flag to denote that a UI is waiting for its dismissal
       
   275 	     */
       
   276 		TBool							iSettingsUiDismissalPending;
       
   277 		
       
   278 		/**
       
   279 		 * Current Highlighted item index. Used to refresh the list box when 
       
   280 		 * we return from the Settings UIs
       
   281 		 */
       
   282 		TUint                           iHighlightedIndex;
       
   283 		 
       
   284         /**
       
   285          * Postioning Settings Observer.
       
   286          */
       
   287         MLocationUIObserver*            iObserver;		 
       
   288         
       
   289         /**
       
   290          * Boolean flag to denote whether the view is launched from
       
   291          * Positioning Settings Application
       
   292          */
       
   293         TBool                           isLaunchedFromPosSettingsApp;
       
   294 	};
       
   295 
       
   296 #endif // C_LOCSYSUIVIEW_H_
       
   297