internetradio2.0/uiinc/ircategoryview.h
changeset 3 ee64f059b8e1
parent 2 2e1adbfc62af
child 4 3f2d53f144fe
child 5 0930554dc389
equal deleted inserted replaced
2:2e1adbfc62af 3:ee64f059b8e1
     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 CIRCategoryView
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CIRCATEGORYVIEW_H
       
    20 #define CIRCATEGORYVIEW_H
       
    21 
       
    22 #include "irbaseview.h"
       
    23 #include "MViewsResponseAndErrorObserver.h"
       
    24 
       
    25 #include "MLogoDownloadObserver.h"
       
    26 #include "IRActiveNetworkObserver.h"
       
    27 
       
    28 
       
    29 class CIRCategoryViewContainer;
       
    30 
       
    31 
       
    32 /**
       
    33  * SearchResults View
       
    34  */
       
    35 class CIRCategoryView : public CIRBaseView,public MViewsResponseAndErrorObserver,
       
    36 						public MLogoDownloadObserver,public MIRActiveNetworkObserver
       
    37     {
       
    38     
       
    39 public: //Methods
       
    40 
       
    41 	//ENums to indicate the currently selected item in the listbox.
       
    42  	enum TCurrentSelectedItem
       
    43 		{
       
    44 		EGenreData=0,
       
    45 		ELanguageData,
       
    46 		ECountryData,
       
    47 		ETopStationData
       
    48 		};
       
    49     /**
       
    50      * NewL()
       
    51      * Static constructor.
       
    52      */
       
    53     static CIRCategoryView* NewL();
       
    54 
       
    55     /**
       
    56      * NewLC()
       
    57      * Static constructor.
       
    58      */
       
    59     static CIRCategoryView* NewLC();
       
    60     
       
    61     /**
       
    62      *~CIRCategoryView()
       
    63      * Destructor.
       
    64      */
       
    65     ~CIRCategoryView();
       
    66 
       
    67     // from base class CAknView
       
    68 	/**
       
    69 	 * From CAknView
       
    70 	 *
       
    71 	 * @see CAknView::Id() const
       
    72 	 */
       
    73     TUid Id() const;
       
    74 
       
    75 	/**
       
    76 	 * From CAknView
       
    77 	 *
       
    78 	 * @see CAknView::HandleCommandL( TInt aCommand )
       
    79 	 */
       
    80 	void HandleCommandL( TInt aCommand );
       
    81 	
       
    82 	/**
       
    83 	 * void SetStatusPaneTextL()
       
    84 	 * Sets the title pane of the search results view
       
    85 	 */
       
    86 	void SetStatusPaneTextL();
       
    87 
       
    88 	/**
       
    89 	* DoChannelRequestL
       
    90 	* Issues a Request to Isds for getting the Channels
       
    91 	*/
       
    92 	void DoChannelRequestL();
       
    93 	
       
    94 	/**
       
    95 	* void CIRCategoryView::ResponseL()
       
    96 	* Activates the Stations view after getting the IsdsResponse
       
    97 	*/
       
    98 	void ResponseL( CIRIsdsPreset* aPreset = NULL );
       
    99 	
       
   100 	/**
       
   101 	* ErrorL()
       
   102 	* Handles the errors from Isds
       
   103 	*/
       
   104 	void ErrorL();
       
   105 	
       
   106 	/**
       
   107 	* PresetResponseL
       
   108 	* Issues a listen request
       
   109 	*/
       
   110 	void PresetResponseL(CIRIsdsPreset* aPreset);
       
   111 
       
   112 	/**
       
   113 	* DynInitMenuPaneL
       
   114 	* Dynamically initialises a menu pane
       
   115 	*/
       
   116 	void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
       
   117 
       
   118 
       
   119     /**
       
   120      * From CAknView
       
   121      */
       
   122 	void HandleStatusPaneSizeChange();
       
   123 	
       
   124     /**
       
   125      * From CAknView
       
   126      *
       
   127      * @see CAknView::HandleForegroundEventL( TBool aForeground )
       
   128      */
       
   129 	void HandleForegroundEventL( TBool aForeground );
       
   130 	/**
       
   131     * PresetLogoDownloadedL()
       
   132     * CallBack Function Returning the Preset With Logo
       
   133     */
       
   134 	void PresetLogoDownloadedL(CIRIsdsPreset* aPreset);
       
   135 	
       
   136 	/**
       
   137     * PresetLogoDownloadError()
       
   138     * CallBack Function Returning the Preset With no Logo/error while downloading logo
       
   139     */
       
   140 	void PresetLogoDownloadError(CIRIsdsPreset* aPreset);
       
   141 	
       
   142 	/**
       
   143 	* LogoRequestL()
       
   144 	* Called by the container of this view
       
   145 	*/
       
   146 	void AdRequestL();
       
   147 	/*
       
   148 	* SetActualFilteredItemIndex()
       
   149 	* sets the original index of the filtered item
       
   150 	*/
       
   151 	void SetActualFilteredItemIndex(TInt aIndex);
       
   152 	
       
   153 	/**
       
   154 	* GetFilteredIndex()
       
   155 	* Returns the filtered Index
       
   156 	*/
       
   157 	TInt GetFilteredIndex();
       
   158 	
       
   159 	/*
       
   160 	 * GetFirstLaunchFlag()
       
   161 	 * returns the whether the view is launching for the first time/
       
   162 	 * coming back from that has been activated from this view
       
   163 	 */
       
   164 	TBool GetFirstLaunchFlag() ;
       
   165 	// from base class MIRSystemEventObserver
       
   166     void HandleSystemEventL( TIRSystemEventType aEventType );
       
   167 	
       
   168 	
       
   169 public:
       
   170 	//from MIRActiveNetworkObserver
       
   171 	/**
       
   172 	 * Notifies all observers whose network request is active
       
   173 	 * to reissue the request  
       
   174 	 * NotifyActiveNetworkObserversL()
       
   175 	 */	
       
   176 	 void NotifyActiveNetworkObserversL(TIRNetworkEvent aEvent);
       
   177 	 
       
   178 	 /**
       
   179 	 * Notifies all observers whose network request is active
       
   180 	 * to reset the pending request status  
       
   181 	 * ResetPendingRequests()
       
   182 	 */	
       
   183 	 void ResetPendingRequests(TBool aValue);
       
   184 
       
   185 
       
   186 protected:  //Methods
       
   187 
       
   188     // from base class CAknView
       
   189     /**
       
   190      * From CAknView
       
   191      *
       
   192      * @see CAknView::DoActivateL(const TVwsViewId& aPrevViewId, 
       
   193      *    TUid aCustomMessageId, 
       
   194      *    const TDesC8& aCustomMessage)
       
   195      */
       
   196     void DoActivateL( const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/, const TDesC8& aCustomMessage );
       
   197 
       
   198 	/**
       
   199      * From CAknView
       
   200      *
       
   201      * @see CAknView::DoDeactivate()
       
   202      */
       
   203 	void DoDeactivate();
       
   204 
       
   205 	
       
   206 private: //Methods
       
   207 
       
   208     /**
       
   209      * ConstructL()
       
   210      * 2nd phase constructor
       
   211      */
       
   212     void ConstructL();
       
   213 
       
   214 	/**
       
   215      * CIRCategoryView()
       
   216      * C++ default constructor.
       
   217      */
       
   218     CIRCategoryView();
       
   219 
       
   220 
       
   221 private:    // Data
       
   222 
       
   223 	/** 
       
   224 	 * iContainer
       
   225 	 * Container for this view. 
       
   226 	 */
       
   227 	CIRCategoryViewContainer* iContainer;
       
   228 
       
   229  
       
   230 	/**
       
   231 	* iLoadingCancelled
       
   232 	* Data whether loading has been cancelled
       
   233 	*/
       
   234 	TBool iLoadingCancelled;
       
   235 	/*
       
   236 	 * iIndex
       
   237 	 *  
       
   238 	 */
       
   239 	 TInt iIndex;
       
   240 	TInt iFilteredIndex;
       
   241 	
       
   242 	TBool iFirstTimeLaunchFlag;
       
   243 	/*
       
   244 	 * iCallRequestPending
       
   245 	 * Indicates whether delayed activation of command is required (Call Handling)
       
   246 	 */
       
   247 	TBool iCallRequestPending;
       
   248 	/*
       
   249 	 * iCommand
       
   250 	 * Command to be executed (view activation) after Preset downloads
       
   251 	 */
       
   252 	TInt iCommand;
       
   253 	
       
   254 		
       
   255 	/*
       
   256 	 * iRequestPending
       
   257 	 * Checks whether an active request is pending
       
   258 	 */
       
   259 	TBool iRequestPending;
       
   260 	
       
   261 	/*
       
   262 	 * iRequestIssued
       
   263 	 * Checks whether the request has been issued
       
   264 	 */
       
   265 	TBool iRequestIssued;
       
   266 	
       
   267 	
       
   268 
       
   269 public:	
       
   270 	/**
       
   271 	 * iCategoryReqMade
       
   272 	 * boolean value to know whether the category request
       
   273 	 * has made to isds or not
       
   274 	 */
       
   275 	TBool iCategoryReqMade;
       
   276 	
       
   277 	 
       
   278 		
       
   279     };
       
   280 
       
   281 #endif      // CIRCATEGORYVIEW_H
       
   282             
       
   283