internetradio2.0/uiinc/irstationdirectorycontainer.h
changeset 0 09774dfdd46b
equal deleted inserted replaced
-1:000000000000 0:09774dfdd46b
       
     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:  Header for CIRStationDirectoryContainer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CIRSTATIONDIRECTORYCONTAINER_H_
       
    20 #define CIRSTATIONDIRECTORYCONTAINER_H_
       
    21 
       
    22 #include <aknlists.h>
       
    23 #include <EIKLBX.H>
       
    24 #include <aknsfld.h> 
       
    25 #include <eikclb.h> 
       
    26 
       
    27 class CIRStationDirectoryView;
       
    28 class CAknDoubleStyleListBox;
       
    29 /**
       
    30  * Container for Channel List View.
       
    31  */
       
    32 class CIRStationDirectoryContainer : public CCoeControl , public MEikListBoxObserver    
       
    33     {
       
    34     
       
    35 public:  // Methods
       
    36     
       
    37     /**
       
    38     * NewL.
       
    39     * Two-phased constructor.
       
    40     * Create a CIRStationDirectoryContainer object, which will draw itself to aRect
       
    41     * @param aRect The rectangle this view will be drawn to.
       
    42     * @param aStationsDirView The StationDirectory view's instance.
       
    43     * @return a pointer to the created instance of CIRStationDirectoryContainer.
       
    44     */
       
    45     static CIRStationDirectoryContainer* NewL( CIRStationDirectoryView& aStationsDirView,
       
    46     					 const TRect& aRect );
       
    47 
       
    48     /**
       
    49     * NewLC.
       
    50     * Two-phased constructor.
       
    51     * Create a CIRStationDirectoryContainer object, which will draw itself to aRect
       
    52     * @param aRect The rectangle this view will be drawn to.
       
    53     * @param aStationsDirView The StationDirectory view's instance.
       
    54     * @return a pointer to the created instance of CIRStationDirectoryContainer.
       
    55     */
       
    56     static CIRStationDirectoryContainer* NewLC( CIRStationDirectoryView& aStationsDirView,
       
    57     			 const TRect& aRect );
       
    58     /**
       
    59      * Second-phase constructor.
       
    60      * 
       
    61      * @param   aRect    Rect for Station  Direcotry Container
       
    62      */
       
    63     void ConstructL( const TRect& aRect );
       
    64 
       
    65     /**
       
    66      * C++ default constructor.
       
    67      */
       
    68     CIRStationDirectoryContainer(CIRStationDirectoryView& aStationsDirView );
       
    69 
       
    70     /**
       
    71      * Destructor.
       
    72      */
       
    73     ~CIRStationDirectoryContainer();   
       
    74     
       
    75     
       
    76     /**
       
    77       * From CCoeControl
       
    78       */
       
    79     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    80 
       
    81     /**
       
    82      * From CCoeControl
       
    83      */
       
    84     void GetHelpContext( TCoeHelpContext& aContext ) const;
       
    85     
       
    86     /**
       
    87     * GetCurrentItemIndex
       
    88     * Returns the Current Selected index of the ListBox
       
    89     */
       
    90 	TInt GetCurrentItemIndex() const;
       
    91 
       
    92     /**
       
    93      * From MEikListBoxObserver HandleListBoxEventL
       
    94      */ 
       
    95     void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
       
    96     
       
    97  	/**
       
    98 	* CountComponentControls() const
       
    99 	* returns the number of components in the view.
       
   100 	*/
       
   101 	TInt CountComponentControls() const;
       
   102 	
       
   103 	/**
       
   104 	* ComponentControl()
       
   105 	* returns the pointer to the control
       
   106 	*/
       
   107 	CCoeControl* ComponentControl(TInt aIndex) const ;
       
   108 	
       
   109 	/**
       
   110 	* SizeChanged()
       
   111 	* Responds to changes to the size and position of the contents of this control.
       
   112 	*/
       
   113 	void SizeChanged();
       
   114    
       
   115   	/**
       
   116 	* HandleResourceChange()
       
   117 	* Handles a change to the control's resources.
       
   118 	*/
       
   119 	void HandleResourceChange(TInt aType);
       
   120     
       
   121 private: //Methods
       
   122 
       
   123 
       
   124 	// from base class CCoeControl
       
   125 	/**
       
   126      * From CCoeControl
       
   127      *
       
   128      * @see Draw( const TRect& aRect ) const
       
   129 	 */
       
   130 	void Draw( const TRect& aRect) const;
       
   131 
       
   132 public: //Methods
       
   133 
       
   134     /**
       
   135      * 
       
   136      * Sets items to the listbox.
       
   137      */
       
   138     void PopulateStationListL();
       
   139     
       
   140     /**
       
   141     * CreateDiscoverStationDataL(TInt aTitle,TInt aDescription)
       
   142     * Fetches the data from stringloader that should be displayed
       
   143     * and sets it to the listbox.
       
   144     */
       
   145     void CreateDiscoverStationDataL(TInt aTitle,TInt aDescription);
       
   146 
       
   147 private:    // Data
       
   148     
       
   149     
       
   150     /**
       
   151      * List box used to display the list of items.
       
   152      * Owned.
       
   153      */
       
   154      CDesCArray* iItemArray;
       
   155      
       
   156     /**
       
   157     * iStationDirView
       
   158     * reference of the stations directory view
       
   159     */
       
   160     CIRStationDirectoryView &iStationDirView;
       
   161     
       
   162     /**
       
   163     * iListbox
       
   164     * Data for the StationDirectory Listbox
       
   165     */
       
   166     CAknDoubleStyleListBox* iListbox;
       
   167    
       
   168 };
       
   169 
       
   170 #endif /*CIRSTATIONDIRECTORYCONTAINER_H_*/