internetradio2.0/uiinc/irstationdirectoryview.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 CIRStationsDirectoryView
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CIRSTATIONDIRECTORYVIEW_H
       
    20 #define C_CIRSTATIONDIRECTORYVIEW_H
       
    21 
       
    22 
       
    23 
       
    24 #include "irbaseview.h"
       
    25 #include "MViewsResponseAndErrorObserver.h"
       
    26 #include "IRActiveNetworkObserver.h"
       
    27 
       
    28 class CIRStationDirectoryContainer;
       
    29 class MIRActiveNetworkObserver;
       
    30 
       
    31 class CIRStationDirectoryView : public CIRBaseView ,
       
    32 								public MViewsResponseAndErrorObserver,
       
    33 								public MIRActiveNetworkObserver
       
    34 {
       
    35 public:
       
    36 
       
    37 	//ENums to indicate the currently selected item in the listbox.
       
    38 	enum TCurrentSelectedItem
       
    39 		{
       
    40 		EGenreData=0,
       
    41 		ELanguageData,
       
    42 		ECountryData,
       
    43 		ETopStationData
       
    44 		};
       
    45 	
       
    46     /**
       
    47      * NewL()
       
    48      * Static constructor.
       
    49      */
       
    50     static CIRStationDirectoryView* NewL();
       
    51 
       
    52     /**
       
    53      * NewLC()
       
    54      * Static constructor.
       
    55      */
       
    56 	static CIRStationDirectoryView* NewLC();
       
    57 
       
    58 	/**
       
    59 	* ~CIRStationDirectoryView()
       
    60 	* Destructor 
       
    61 	*/
       
    62 	~CIRStationDirectoryView();
       
    63 
       
    64 	// from base class CIRBaseView    
       
    65 
       
    66 	/**
       
    67 	 * From CAknView
       
    68 	 *
       
    69 	 * @see CAknView::Id() const
       
    70 	 */
       
    71 	TUid Id() const;
       
    72 
       
    73 	/**
       
    74 	 * From CAknView
       
    75 	 *
       
    76 	 * @see CAknView::HandleCommandL( TInt aCommand )
       
    77 	 */
       
    78 	void HandleCommandL( TInt aCommand );
       
    79 
       
    80 	/**
       
    81 	* DoCategoryRequestL()
       
    82 	* Issues a request ti Isds for the Stations
       
    83 	*/
       
    84 	void DoCategoryRequestL();
       
    85 	
       
    86 	/**
       
    87 	* ResponseL()
       
    88 	* Activates the Category view after getting the IsdsResponse
       
    89 	*/
       
    90 	void ResponseL( CIRIsdsPreset* aPreset = NULL );
       
    91 	
       
    92 	/**
       
    93 	* ErrorL()
       
    94 	* Handles the errors from Isds
       
    95 	*/
       
    96 	void ErrorL();
       
    97 	
       
    98 	/**
       
    99 	* PresetResponseL
       
   100 	* Issues a listen request
       
   101 	*/
       
   102 	void PresetResponseL(CIRIsdsPreset* aPreset);
       
   103 	
       
   104 	/**
       
   105 	* DynInitMenuPaneL
       
   106 	* Dynamically initialises a menu pane
       
   107 	*/
       
   108 	void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
       
   109 	
       
   110 	/**
       
   111 	* ActivateCategoryViewL
       
   112 	* Activates the Stations view
       
   113 	*/
       
   114 	void ActivateCategoryViewL();
       
   115 	/*
       
   116 	* RefreshView()
       
   117 	* Refreshes the view when layout changes.
       
   118 	*/
       
   119 	void RefreshView();
       
   120 protected:  
       
   121 
       
   122 	// from base class CIRBaseView
       
   123 
       
   124     /**
       
   125      * From CAknView
       
   126      *
       
   127      * @see CAknView::DoActivateL(const TVwsViewId& aPrevViewId, 
       
   128      *    TUid aCustomMessageId, 
       
   129      *    const TDesC8& aCustomMessage)
       
   130      */
       
   131     void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId,
       
   132     			 const TDesC8& aCustomMessage );
       
   133 
       
   134 	/**
       
   135      * From CAknView
       
   136      *
       
   137      * @see CAknView::DoDeactivate()
       
   138      */
       
   139     void DoDeactivate( );
       
   140     
       
   141     /**
       
   142      * From CAknView
       
   143      */
       
   144     void HandleStatusPaneSizeChange();  
       
   145     
       
   146     /**
       
   147      * From CAknView
       
   148      *
       
   149      * @see CAknView::HandleForegroundEventL( TBool aForeground )
       
   150      */
       
   151     void HandleForegroundEventL( TBool aForeground );
       
   152  	// from base class MIRSystemEventObserver
       
   153     void HandleSystemEventL( TIRSystemEventType aEventType );
       
   154     
       
   155 private:
       
   156 
       
   157     /**
       
   158      * By default Symbian 2nd phase constructor is private.
       
   159      */
       
   160     void ConstructL();
       
   161     
       
   162     /**
       
   163      * C++ default constructor.
       
   164      */
       
   165     CIRStationDirectoryView();
       
   166     
       
   167 public:
       
   168 			//from MIRActiveNetworkObserver
       
   169 	/**
       
   170 	 * Notifies all observers whose network request is active
       
   171 	 * to reissue the request  
       
   172 	 * NotifyActiveNetworkObserversL()
       
   173 	 */	
       
   174 	 void NotifyActiveNetworkObserversL(TIRNetworkEvent aEvent);
       
   175 	 
       
   176 	 /**
       
   177 	 * Notifies all observers whose network request is active
       
   178 	 * to reset the pending request status  
       
   179 	 * ResetPendingRequests()
       
   180 	 */	
       
   181 	 void ResetPendingRequests(TBool aValue);
       
   182 
       
   183 
       
   184 private:    
       
   185     
       
   186     /** 
       
   187      * Container for this view. 
       
   188      * Owned
       
   189      */
       
   190     CIRStationDirectoryContainer* iContainer;
       
   191     
       
   192 	/**
       
   193 	* iLoadingCancelled
       
   194 	* Data whether loading has been cancelled
       
   195 	*/
       
   196 	TBool iLoadingCancelled;
       
   197 	
       
   198 	/*
       
   199 	 * iRequestIssued
       
   200 	 * Checks whether the request has been issued
       
   201 	 */
       
   202 	TBool iRequestIssued;
       
   203 	
       
   204 	/*
       
   205 	 * iRequestPending
       
   206 	 * Checks whether an active request is pending
       
   207 	 */
       
   208 	TBool iRequestPending;
       
   209 	/*
       
   210 	 * iCallRequestPending
       
   211 	 * Indicates whether delayed activation of command is required (Call Handling)
       
   212 	 */
       
   213 	TBool iCallRequestPending;
       
   214 	/*
       
   215 	 * iCommand
       
   216 	 * Command to be executed (view activation) after Preset downloads
       
   217 	 */
       
   218 	TInt iCommand;
       
   219 
       
   220 };
       
   221 #endif /*C_CIRSTATIONDIRECTRORYVIEW_H_*/