locationsystemui/locationsysui/locsysuiview/inc/locsysuicontainer.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:  Location System Ui Plugin View's container
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_LOCSYSUICONTAINER_H_
       
    20 #define C_LOCSYSUICONTAINER_H_
       
    21 
       
    22 // System Includes 
       
    23 #include <e32base.h>
       
    24 #include <coecntrl.h>
       
    25 #include <eiklbo.h>
       
    26 
       
    27 
       
    28 // Forward Declarations
       
    29 class CAknSettingStyleListBox;
       
    30 class CLocSysUiView;
       
    31 class CLocSysUiLBModel;
       
    32 class CEikStatusPane;
       
    33 class MLocSysUiContainerEventHandler;
       
    34 class CLocationSettings;
       
    35 
       
    36 // Class Declarations
       
    37 /**
       
    38  * Container for the LocationSystemUiView. Contains the Listbox control that is used to 
       
    39  * display the various sub-views that are available. The List box takes a model
       
    40  * from the view which it inturn uses as a list box model
       
    41  *
       
    42  * @lib locsysuiview.lib
       
    43  * @since S60 v3.1
       
    44  */
       
    45  NONSHARABLE_CLASS( CLocSysUiContainer ): public CCoeControl, 
       
    46 						                  public MEikListBoxObserver
       
    47 	{
       
    48     private:
       
    49         
       
    50         	
       
    51 	public:
       
    52         /**
       
    53          * Destructor
       
    54          */
       
    55         virtual ~CLocSysUiContainer();
       
    56 
       
    57 		/**
       
    58          * Static Two phase contructor that instantiates the 
       
    59          * CLocationSystemUiUIContainer
       
    60          * 
       
    61          * @param aEventHandler		 Reference to the Container's event handler
       
    62          * @param aSettingsArray	 Reference to the Settings UI array.
       
    63          * @param aRect				 Client rectangle.
       
    64          * @return CLocSysUiContainer*	Reference to the object created.
       
    65          */
       
    66         static CLocSysUiContainer* NewL( 
       
    67         		MLocSysUiContainerEventHandler&	    aEventHandler,
       
    68         		RPointerArray<CLocationSettings>&   aSettingsArray,
       
    69         		const TRect& 					    aRect );
       
    70 
       
    71         /**
       
    72          * Static Two phase contructor that instantiates the 
       
    73          * CLocationSystemUiUIContainer. Leaves the object on the Cleanup stack
       
    74          * 
       
    75          * @param aEventHandler		 Reference to the Container's event handler
       
    76          * @param aSettingsArray	 Reference to the Settings UI array.
       
    77          * @param aRect				 Client rectangle.
       
    78          * @return CLocSysUiContainer*	Reference to the object created.
       
    79          */
       
    80         static CLocSysUiContainer* NewLC( 
       
    81         		MLocSysUiContainerEventHandler&	    aEventHandler,
       
    82         		RPointerArray<CLocationSettings>&   aSettingsArray,
       
    83         		const TRect& 					    aRect );
       
    84 
       
    85         /**
       
    86          * Returns the Settings Ui item that is currently focussed.
       
    87          *
       
    88          * @return	CLocationSettings& Referrence to the Settings UI corresponding
       
    89          *							   to the index.
       
    90          */
       
    91         CLocationSettings&	GetFocussedSettingsUiL();
       
    92 
       
    93         /**
       
    94          * Calls upon the container to update the list bix contents.
       
    95          *
       
    96          * @param aSettingsArray Reference to the Settings UI array.
       
    97          */
       
    98         void UpdateListBoxL(RPointerArray<CLocationSettings>&	aSettingsArray);
       
    99         
       
   100         /**
       
   101          * Returns the currently focussed element index
       
   102          *
       
   103          * @return TUint    Currently focussed element index    
       
   104          */
       
   105         TUint CurrentFocussedElement();
       
   106         
       
   107         /**
       
   108          * Sets the current highlighted element
       
   109          *
       
   110          * @param aCurrentElement    Currently focussed element index    
       
   111          */
       
   112         void SetFocussedElement( TUint      aCurrentElement );
       
   113         
       
   114     public:
       
   115         /**
       
   116          * Inherited from CCoeControl
       
   117          */
       
   118         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   119         						           TEventCode aType );
       
   120         							    
       
   121         /**
       
   122          * Inherited from CCoeControl
       
   123          */
       
   124         void HandleResourceChange(TInt aType);
       
   125 
       
   126         /**
       
   127          * From CoeControl
       
   128          */
       
   129         TInt CountComponentControls() const;
       
   130 
       
   131         /**
       
   132          * From CCoeControl
       
   133          */
       
   134         CCoeControl* ComponentControl(TInt aIndex) const;
       
   135 
       
   136         /**
       
   137          * From CCoeControl
       
   138          */
       
   139         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   140     
       
   141     public:
       
   142         /**
       
   143          * Inherited from MEikListBoxObserver
       
   144          */
       
   145         void HandleListBoxEventL( CEikListBox*      aListBox, 
       
   146         					      TListBoxEvent     aEventType );
       
   147         					      
       
   148 	protected:
       
   149         /**
       
   150          * Handles Focus Change to list 
       
   151          */
       
   152         void FocusChanged(TDrawNow aDrawNow);
       
   153 
       
   154         /**
       
   155          * From CoeControl,SizeChanged.
       
   156          */
       
   157         void SizeChanged();
       
   158 
       
   159 	private:
       
   160 	    /**
       
   161          * Overloaded Constructor
       
   162          *
       
   163          * @param aEventHandler		Reference to the Container's event handler
       
   164          */
       
   165         CLocSysUiContainer( MLocSysUiContainerEventHandler&	aEventHandler );
       
   166         
       
   167         /**
       
   168          * Second phase of the two phase Construction process
       
   169          *
       
   170          * @param aSettingsArray    Reference to the Settings UI array.
       
   171          * @param aRect				Client rectangle
       
   172          */
       
   173         void ConstructL( RPointerArray<CLocationSettings>&  aSettingsArray,
       
   174         			     const TRect& 						aRect );
       
   175 
       
   176         /** 
       
   177          * Creates the List box and the Listbox model. Associates the 
       
   178          * list box model wit the list box
       
   179          *
       
   180          * @param aSettingsArray	 Reference to the Settings UI array.
       
   181          */
       
   182         void CreateListboxL( RPointerArray<CLocationSettings>&  aSettingsArray );
       
   183 
       
   184         /**
       
   185          * Returns the Appui's status pane
       
   186          * @return CEikStatusPane* Statuspane pointer
       
   187          */
       
   188         CEikStatusPane* StatusPane();
       
   189 
       
   190         /**
       
   191          * Sets the Title text
       
   192          * @param aResourceText Resource to create title
       
   193          */
       
   194         void MakeTitleL( TInt aResourceText );
       
   195 
       
   196 	private:
       
   197 	    /**
       
   198 	     * Reference to the Container's event handler
       
   199 	     */
       
   200 		MLocSysUiContainerEventHandler&		iEventHandler;
       
   201        
       
   202         /**
       
   203          * Help Context Name
       
   204          */ 
       
   205         TCoeContextName 					iContextName;
       
   206         
       
   207 		/**
       
   208 		 * List box Model
       
   209 		 * Owns
       
   210 		 */
       
   211 		CLocSysUiLBModel*			iListBoxModel;
       
   212 		
       
   213 		/**
       
   214 		 * List box component control
       
   215 		 * Owns
       
   216 		 */
       
   217 		CAknSettingStyleListBox*			iListBox;
       
   218 	};
       
   219 
       
   220 #endif // C_LOCSYSUICONTAINER_H_
       
   221