locationcentre/lcapp/inc/lccontainer.h
branchRCL_3
changeset 9 4721bd00d3da
parent 8 3a25f69541ff
child 11 e15b7f06eba6
equal deleted inserted replaced
8:3a25f69541ff 9:4721bd00d3da
     1 /*
       
     2 * Copyright (c) 2007 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:  Container class for Location Centre Application UI.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_LCCONTAINER_H
       
    20 #define C_LCCONTAINER_H
       
    21 
       
    22 // SYSTEM INCLUDES
       
    23 #include <coecntrl.h>
       
    24 #include <eiklbo.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CLcAppUi;
       
    28 class CLcListBoxModel;
       
    29 class CAknSingleLargeStyleListBox;
       
    30 class MLcEventHandler;
       
    31 
       
    32 /**
       
    33  *  Location Centre Application's Container class. This class is the chief
       
    34  *  windowing component of Location Centre which displays the List of
       
    35  *  Location based Applications and Contents/Services
       
    36  *
       
    37  *  @lib lcapp.exe
       
    38  *  @since S60 v5.0
       
    39  */
       
    40 class CLcContainer : public CCoeControl,
       
    41 					 public MEikListBoxObserver
       
    42     {
       
    43 public:
       
    44 	/**
       
    45 	 * Static Two phase constructor
       
    46 	 *
       
    47 	 * @param[in] aRect, 		 Client Rectangle for this window owning control.
       
    48 	 * @param[in] aEventHandler, Location Centre Event Handle.
       
    49 	 * @param[in] aListBoxModel, List box model.
       
    50 	 */
       
    51 	static CLcContainer* NewL( const TRect& 			aRect,
       
    52 									 MLcEventHandler&	aEventHandler,
       
    53 									 CLcListBoxModel&	aListBoxModel );
       
    54 	
       
    55   	/**
       
    56   	 * Virtual destructor
       
    57   	 */
       
    58     ~CLcContainer();
       
    59     
       
    60     /**
       
    61      * Returns the help context
       
    62      *
       
    63      * @param aContext  The help context that has to be determined
       
    64      */
       
    65     void GetHelpContext( TCoeHelpContext& aContext ) const;
       
    66     
       
    67     /**
       
    68      * Returns the Selected List box item
       
    69      *
       
    70      * @return TInt Index corresponding selected List box item.
       
    71      */
       
    72     TInt GetFocussedItem();     
       
    73  
       
    74     /**
       
    75      * Updates the Container object with a new list of Location based Applications
       
    76      * and Contents/Services.
       
    77      *
       
    78      * @param[in] aListBoxModel, New List box model object.
       
    79      */
       
    80  	void UpdateL( CLcListBoxModel&	aListBoxModel );
       
    81  	
       
    82  	/**
       
    83  	 * Updates the listbox icons for Location Centre List Box.
       
    84  	 */
       
    85 	void UpdateIconsL(); 	
       
    86  	
       
    87 protected: // Inherited from Base classes
       
    88 
       
    89   	/**
       
    90   	 * Inherited from CCoeControl
       
    91   	 */  
       
    92     void SizeChanged();
       
    93 
       
    94   	/**
       
    95   	 * Inherited from CCoeControl
       
    96   	 */
       
    97     TInt CountComponentControls() const;
       
    98 
       
    99   	/**
       
   100   	 * Inherited from CCoeControl
       
   101   	 */
       
   102     CCoeControl* ComponentControl( TInt aIndex ) const;
       
   103     
       
   104   	/**
       
   105   	 * Inherited from CCoeControl
       
   106   	 */    
       
   107     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
       
   108                          			   TEventCode aType );
       
   109                          			   
       
   110 	/**
       
   111 	 * Inherited from CCoeControl
       
   112 	 */
       
   113 	void HandleResourceChange( TInt aType );	                         			                    			                   			   
       
   114                          			           
       
   115     /**
       
   116      * Inherited from MEikListBoxObserver
       
   117      */
       
   118     void HandleListBoxEventL( CEikListBox*      aListBox, 
       
   119                               TListBoxEvent     aEventType );
       
   120                               
       
   121     /**
       
   122      * Handles Focus Change to list 
       
   123      */
       
   124     void FocusChanged( TDrawNow aDrawNow );                              
       
   125                                                            			            
       
   126 private:
       
   127 	
       
   128 	/**
       
   129 	 * C++ Default constructor
       
   130 	 */
       
   131     CLcContainer( MLcEventHandler&	aEventHandler,
       
   132     			  CLcListBoxModel&	aListBoxModel );
       
   133     
       
   134 	/**
       
   135 	 * Second phase of the two phase constructor
       
   136 	 */     
       
   137     void ConstructL( const TRect& 	aRect );
       
   138     
       
   139     /**
       
   140      * Sets the Title text
       
   141      * @param aResourceText Resource to create title
       
   142      */
       
   143     void MakeTitleL( TInt aResourceText );
       
   144             
       
   145 	/**
       
   146 	 * Creates the List box and List box model.
       
   147 	 */     
       
   148     void CreateListboxL();
       
   149             
       
   150 public:
       
   151 	/**
       
   152 	 * List box
       
   153 	 * Owns
       
   154 	 */
       
   155 	CAknSingleLargeStyleListBox*	iListBox;
       
   156 
       
   157     /**
       
   158      * Help context
       
   159      */
       
   160     TCoeContextName                 iContextName;
       
   161     
       
   162     /**
       
   163      * Location Centre Event handler
       
   164      */
       
   165     MLcEventHandler&				iEventHandler;
       
   166     
       
   167     /**
       
   168      * Location Centre list box model
       
   169      */    
       
   170     CLcListBoxModel*				iListBoxModel;	    
       
   171 	};
       
   172 
       
   173 #endif  // C_LCCONTAINER_H
       
   174 
       
   175 // End of File