internetradio2.0/uiinc/irplscontainer.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 CIRPlsContainer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CIRPLSCONTAINER_H
       
    20 #define CIRPLSCONTAINER_H
       
    21 
       
    22 #include <aknlists.h>
       
    23 #include <eikclb.h>
       
    24 #include <eikclbd.h>
       
    25 
       
    26 class CIRPlsView;
       
    27 class CIRIsdsPreset;
       
    28 class CIRDialogLauncher;
       
    29 class CEikColumnListBox ;
       
    30 
       
    31 class CIRPlsContainer : public CCoeControl,public MEikListBoxObserver
       
    32 					
       
    33     
       
    34     {
       
    35     
       
    36 public:  // Methods
       
    37 
       
    38 	/**
       
    39 	* NewL.
       
    40 	* Two-phased constructor.
       
    41 	* Create a CIRPlsContainer object, which will draw itself to aRect.
       
    42 	* @param aRect The rectangle this view will be drawn to.
       
    43     * @param aView which is a plsview's reference
       
    44     * @return a pointer to the created instance of CIRPlsContainer.
       
    45 	*/
       
    46 	static CIRPlsContainer* NewL(const TRect& aRect ,CIRPlsView &aView );
       
    47 
       
    48 	/**
       
    49 	* NewLC.
       
    50 	* Two-phased constructor.
       
    51 	* Create a CIRPlsContainer object, which will draw itself
       
    52 	* to aRect.
       
    53 	* @param aRect Rectangle this view will be drawn to.
       
    54 	* @param aView which is a plsview's reference
       
    55 	* @return A pointer to the created instance of CIRPlsContainer.
       
    56 	*/
       
    57 	static CIRPlsContainer* NewLC(const TRect& aRect,CIRPlsView &aView);
       
    58 	/**
       
    59 	* ~CIRPlsViewContainer
       
    60 	* Destructor.
       
    61 	*/
       
    62 	~CIRPlsContainer();
       
    63 	
       
    64     
       
    65 	/*
       
    66 	* 2nd phase constructor.
       
    67 	*/
       
    68 	void ConstructL( const TRect& aRect );
       
    69 	
       
    70 	/**
       
    71 	* CIRPlsContainer()
       
    72 	* Default Constructor.
       
    73 	*/
       
    74 	
       
    75 	CIRPlsContainer(CIRPlsView& aView);
       
    76 	
       
    77     /**
       
    78 	* GetCurrentItemIndex()
       
    79 	* To get the current Item index.
       
    80 	*/
       
    81 	TInt GetCurrentItemIndex() const;
       
    82 	
       
    83     /**
       
    84 	* ListenToStationL()
       
    85 	* Function to listening to a station.
       
    86 	*/
       
    87 	void ListenToStationL();
       
    88 	
       
    89     /**
       
    90 	* CreatePresetL()
       
    91 	* Creating a preset object
       
    92 	*/
       
    93 	CIRIsdsPreset* CreatePresetL();
       
    94 	
       
    95     /**
       
    96 	* CreatePresetListL()
       
    97 	* Creating a Preset List
       
    98 	*/
       
    99 	void CreatePresetListL();
       
   100 	
       
   101     /**
       
   102 	* SaveL()
       
   103 	* Save a channel name to favorites DB.
       
   104 	*/
       
   105 	void SaveL();
       
   106 	
       
   107 	/**
       
   108 	* SaveAllL()
       
   109 	* Save  channel names to favorites DB.
       
   110 	*/
       
   111 	void SaveAllL();
       
   112     
       
   113 	/**
       
   114 	* Updates all items of the list by reading data from preset data base.
       
   115 	*/
       
   116 	void UpdateAllL() ;
       
   117 
       
   118     /**
       
   119 	* OfferKeyEventL() from CCoeControl
       
   120 	* 
       
   121 	*/
       
   122 	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   123 	
       
   124 	/**
       
   125 	* HandlePointerEventL
       
   126 	* Handles all the Pointer events
       
   127 	*/
       
   128 	void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
   129 	
       
   130 
       
   131 	/**
       
   132 	* From CCoeControl
       
   133 	*
       
   134 	* @see CCoeControl::GetHelpContext( TCoeHelpContext& aContext ) const
       
   135 	*/
       
   136 	void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   137 	
       
   138     /**
       
   139 	* HandleListBoxEventL()
       
   140 	* Handles any event on the List Box.
       
   141 	*/
       
   142 	void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
       
   143 	
       
   144     /**
       
   145 	* GetCount()
       
   146 	* Gets the count of the List.
       
   147 	*/
       
   148 	TInt GetCount() const;
       
   149 	
       
   150     /**
       
   151 	* GetListBoxTopIndex()
       
   152 	* Gets the TopItemIndex.
       
   153 	*/
       
   154 	TInt GetListBoxTopIndex() const;
       
   155     
       
   156     /**
       
   157 	* SecondPls()
       
   158 	*/
       
   159 	void SecondPls();
       
   160 	
       
   161     /**
       
   162 	* Handles a change to the control's resources.
       
   163 	*/
       
   164     void HandleResourceChange(TInt aType);
       
   165 
       
   166 
       
   167 
       
   168 private: //Methods
       
   169 
       
   170 	// from base class CCoeControl
       
   171 	/**
       
   172 	* From CCoeControl
       
   173 	*
       
   174 	* @see CCoeControl::Draw( const TRect& aRect ) const
       
   175 	*/
       
   176 	void Draw( const TRect& aRect ) const;
       
   177 	
       
   178     /**
       
   179 	* DisplayErroronDBL()
       
   180 	* Displays error if favorites db is full.
       
   181 	*/ 
       
   182 	void DisplayErroronDBL();
       
   183 	
       
   184     /**
       
   185 	* DisplayErrorOnNoItemsL()
       
   186 	* Displays error if no streaming links
       
   187 	*/
       
   188 	void DisplayErrorOnNoItemsL();
       
   189 	
       
   190 	/**
       
   191 	* CountComponentControls() const
       
   192 	* returns the number of components in the view.
       
   193 	*/
       
   194 	TInt CountComponentControls() const;
       
   195 	
       
   196 	/**
       
   197 	* ComponentControl()
       
   198 	* returns the pointer to the control
       
   199 	*/
       
   200 	CCoeControl* ComponentControl(TInt aIndex) const ;
       
   201 
       
   202 	/**
       
   203 	* SizeChanged()
       
   204 	* Called by framework when the view size is changed.
       
   205 	*/
       
   206     void SizeChanged();
       
   207     
       
   208 
       
   209 
       
   210 
       
   211 private:    // Data
       
   212 
       
   213 	/** 
       
   214 	* Parent view of this container. 
       
   215 	*/
       
   216 	CIRPlsView&	iPlsView;
       
   217 
       
   218 	// bool to check if all stations saved	
       
   219 	TBool iSavedAllUrl;    
       
   220 
       
   221 	/**
       
   222 	* This array holds the list of preset objects to be saved
       
   223 	*/    
       
   224 	RPointerArray<CIRIsdsPreset> iPresetList;
       
   225 
       
   226 	/**
       
   227 	* Indicates if the preset list is present or not
       
   228 	*/
       
   229 	TBool iPresetListPresent;
       
   230     
       
   231 	/*
       
   232 	* iIsPresetSaved
       
   233 	* array used to check whether the preset is saved
       
   234 	*/
       
   235 	RArray<TInt> iIsPresetSaved;
       
   236 	
       
   237 	/*
       
   238 	* iPlsListBox
       
   239 	* CAknSingleStyleListBox listbox for the PLS list.
       
   240 	*/
       
   241 	CEikColumnListBox *iPlsListBox;
       
   242 	/*
       
   243 	* iListArray
       
   244 	* Pls List 
       
   245 	*/
       
   246 	CDesCArray* iListArray;   
       
   247 
       
   248 	
       
   249 	};
       
   250 
       
   251 #endif      // CIRPlsContainer_H