locationsystemui/locationsysui/locsuplsettingsui/inc/locsuplservercontainer.h
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     1 /*
       
     2 * Copyright (c) 2008 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:  SUPL server UI View's container
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_LOCSUPLSERVERCONTAINER_H_
       
    20 #define C_LOCSUPLSERVERCONTAINER_H_
       
    21 
       
    22 // System Includes 
       
    23 #include <e32base.h>
       
    24 #include <coecntrl.h>
       
    25 #include <eiklbo.h>
       
    26 
       
    27     
       
    28 // Forward Declarations
       
    29 class CLocSUPLServerLBModel;
       
    30 class CLocSUPLSettingsUiEngine;
       
    31 class CAknSingleNumberStyleListBox;
       
    32 class CAknIconArray;
       
    33 class CLocSUPLServerView;
       
    34 
       
    35 // Class Declarations
       
    36 /**
       
    37  * Container for the SUPL server UI View.
       
    38  * 
       
    39  * Contains the Listbox control that is used to configure various SUPL settings 
       
    40  * options
       
    41  *
       
    42  * @lib locsuplsettings.lib
       
    43  * @since S60 v3.1 
       
    44  */
       
    45 class CLocSUPLServerContainer : public CCoeControl,
       
    46                                 public MEikListBoxObserver
       
    47 	{
       
    48 	public:
       
    49 		/**
       
    50  		 * Static Two phase contructor that instantiates the CLocSUPLServerContainer
       
    51 		 * 
       
    52 		 * @param aRect				            Client rectangle
       
    53          * @param aEngine                       Reference to the SUPL Settings
       
    54          *                                      engine 		 
       
    55          * @param CLocSUPLServerView            Pointer to the current view
       
    56 		 * @return CLocSUPLServerContainer*	Reference to the object created
       
    57 		 */
       
    58 		static CLocSUPLServerContainer* NewL( 
       
    59                     		const TRect&               	aRect,
       
    60                           	CLocSUPLSettingsUiEngine&	aEngine,
       
    61                           	CLocSUPLServerView* 		aView );
       
    62 
       
    63 		/**
       
    64 		 * Static Two phase contructor that instantiates the CLocSUPLServerContainer
       
    65 		 * Leaves the object on the Cleanup stack
       
    66 		 * 
       
    67 		 * @param aRect				            Client rectangle
       
    68          * @param aEngine                       Reference to the SUPL Settings
       
    69          *                                      engine 		 
       
    70          * @param CLocSUPLServerView            Pointer to the current view
       
    71 		 * @return CLocSUPLServerContainer*	Reference to the object created
       
    72 		 */
       
    73 		static CLocSUPLServerContainer* NewLC( 
       
    74                     		const TRect&               	aRect,
       
    75                           	CLocSUPLSettingsUiEngine&	aEngine,
       
    76                           	CLocSUPLServerView* 		aView );
       
    77 
       
    78 		/**
       
    79 		 * Destructor
       
    80 		 */
       
    81 		~CLocSUPLServerContainer();
       
    82     
       
    83 		/**
       
    84 		 * Inherited from CCoeControl
       
    85 		 */
       
    86 		void HandleResourceChange( TInt aType );
       
    87 
       
    88         /**
       
    89          * Returns the help context
       
    90          *
       
    91          * @param aContext	The help context that has to be determined
       
    92          */
       
    93         void GetHelpContext( TCoeHelpContext& aContext ) const; 
       
    94         
       
    95         /**
       
    96          * From CoeControl
       
    97          */
       
    98         TInt CountComponentControls() const;
       
    99 
       
   100         /**
       
   101          * From CCoeControl
       
   102          */
       
   103         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   104         
       
   105         /**
       
   106          * Inherited from CCoeControl
       
   107          */
       
   108         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   109         						           TEventCode aType );
       
   110 		 		 		 
       
   111 		/**
       
   112          * Inherited from MEikListBoxObserver
       
   113          */
       
   114         void HandleListBoxEventL( CEikListBox*      aListBox, 
       
   115         					      TListBoxEvent     aEventType );
       
   116 	 
       
   117         /**
       
   118          * Inherited from CCoeControl
       
   119          */
       
   120         void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   121 	public: // New functions
       
   122 		
       
   123         /**
       
   124          * Refreshes the screen so that the list box reflects the latest contents
       
   125          */
       
   126          void UpdateScreenL();
       
   127          
       
   128         /**
       
   129          * Return reference to listbox
       
   130          * @return CEikListBox reference
       
   131          */
       
   132         CEikListBox& ListBoxL();
       
   133         
       
   134         /**
       
   135 		 * Returns the Selected element. The list box model defines the
       
   136 		 * enumeration that would determine the current element that has been
       
   137 		 * selected
       
   138 		 *
       
   139 		 * @return TInt Index of the item selected
       
   140 		 */
       
   141 		TInt SelectedItemIndex();
       
   142 		 
       
   143         /**
       
   144          * Return current selected server id
       
   145          */
       
   146 		TInt64 CurrentSlpId();
       
   147         					      
       
   148         /**
       
   149          * Return current selected/marked server count
       
   150          */
       
   151 		TInt SelectedCount();
       
   152 
       
   153         /**
       
   154          * Return total no of servers in the view
       
   155          */		
       
   156 		TInt ServerCount();
       
   157         					      
       
   158         /**
       
   159          * Returns the slp ids array
       
   160          */		
       
   161 		RArray<TInt64>& SlpIds();
       
   162 		
       
   163 		/**
       
   164          * Sets the current selected item
       
   165          */	
       
   166 		void SetSelectedIndex();
       
   167 		
       
   168 		/**
       
   169          * Shows context specific options menu
       
   170          */	
       
   171 		void ShowContextMenuL();
       
   172 
       
   173 	protected:
       
   174 		/**
       
   175 		 * Handles Focus Change to list 
       
   176 		 */
       
   177 		void FocusChanged( TDrawNow aDrawNow );
       
   178 		 
       
   179 		/**
       
   180          * From CoeControl,SizeChanged.
       
   181          */
       
   182         void SizeChanged();
       
   183 
       
   184 	private:
       
   185 		/**
       
   186 		 * Overloaded Constructor
       
   187 		 */
       
   188 		CLocSUPLServerContainer( CLocSUPLServerView* aView );
       
   189 		
       
   190 		/**
       
   191 		 * Second phase of the two phase Construction process
       
   192 		 */
       
   193 		void ConstructL( const TRect&                        aRect ,
       
   194 		                       CLocSUPLSettingsUiEngine&     aEngine );
       
   195           
       
   196         /**
       
   197          * Sets the Title text
       
   198          * @param aResourceText Resource to create title
       
   199          */
       
   200         void MakeTitleL( TInt aResourceText );
       
   201           
       
   202 		/**
       
   203          * Returns the Appui's status pane
       
   204          * @return CEikStatusPane* Statuspane pointer
       
   205          */
       
   206 		CEikStatusPane* StatusPane();
       
   207 
       
   208         /** 
       
   209          * Creates the List box and the Listbox model. Associates the 
       
   210          * list box model wit the list box
       
   211          *
       
   212          * @param aEngine    Reference to the SUPL Settings engine          
       
   213          */
       
   214         void CreateListboxL( CLocSUPLSettingsUiEngine&     aEngine );
       
   215         
       
   216         /**
       
   217          * Append icon to icon array. CAknIconArray owns icons so it is 
       
   218          * easier to it leave safely.
       
   219          * @param aIcons icon array
       
   220          * @param aIconFileWithPath icon file name with path
       
   221          * @param aSkinID skin id of the icon
       
   222          * @param aIconGraphicsIndex picture index
       
   223          * @param aIconGraphicsMaskIndex mask index
       
   224          */
       
   225         void AddIconL( CAknIconArray&       aIcons,
       
   226                        const TDesC&         aIconFileWithPath,
       
   227                        TAknsItemID          aSkinID,
       
   228                        TInt                 aIconGraphicsIndex,
       
   229                        TInt                 aIconGraphicsMaskIndex );
       
   230 	
       
   231 		/**
       
   232          * Returns the Applications Icon File name with path
       
   233          */
       
   234 		TFileName* IconFileNameLC() const;
       
   235 		
       
   236    private:
       
   237     
       
   238         /**
       
   239          * Reference to the Current View
       
   240          */
       
   241         CLocSUPLServerView*					iView;
       
   242         
       
   243         /**
       
   244          * Help context
       
   245          */
       
   246         TCoeContextName 					iContextName;
       
   247         
       
   248         /**
       
   249          * Settings list box for SUPL settings
       
   250          * Owns
       
   251          */
       
   252         CAknSingleNumberStyleListBox*   	iListBox;
       
   253         
       
   254         /**
       
   255          * List Box model
       
   256          */
       
   257         CLocSUPLServerLBModel*        		iListBoxModel;
       
   258         
       
   259         /**
       
   260          * Boolean flag to denote whether the pen down occured
       
   261          */
       
   262         TBool								iTouchFlag;  
       
   263         
       
   264          /**
       
   265          * Selected item index value used to set new focus
       
   266          * after delete operation.
       
   267          */
       
   268        	TInt 								iSelectedIndex;
       
   269 	};
       
   270 
       
   271 #endif // C_LOCSUPLSERVERCONTAINER_H_
       
   272