internetradio2.0/uiinc/irmainview.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 CIRMainView
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CIRMAINVIEW_H
       
    20 #define CIRMAINVIEW_H
       
    21 
       
    22 
       
    23 #include "irbaseview.h"
       
    24 #include <akntoolbarobserver.h>
       
    25 #include <aknbutton.h>
       
    26 #include <pspresetobserver.h>
       
    27 
       
    28 #include "irpreset.h"
       
    29 #include "MViewsResponseAndErrorObserver.h"
       
    30 #include "IRActiveNetworkObserver.h"
       
    31 #include "msyncpresetobserver.h"	// MSyncPresetObserver
       
    32 #include "MLogoDownloadObserver.h"
       
    33 
       
    34 class CIRMainContainer;
       
    35 class CAknWaitDialog;
       
    36 class MLogoDownloadObserver;
       
    37 
       
    38 
       
    39 /**
       
    40  * SearchResults View
       
    41  */
       
    42 class CIRMainView : public CIRBaseView,
       
    43 						   public MAknToolbarObserver,
       
    44 	   				       public MPSPresetObserver,
       
    45 	   				       public MIRActiveNetworkObserver,
       
    46 	   				       public MSyncPresetObserver,
       
    47 					       public MLogoDownloadObserver,
       
    48 					       public MViewsResponseAndErrorObserver
       
    49 
       
    50     {
       
    51     
       
    52 public: //Methods
       
    53     /**
       
    54      * NewL()
       
    55      * Static constructor.
       
    56      */
       
    57     static CIRMainView* NewL();
       
    58 
       
    59     /**
       
    60      * NewLC()
       
    61      * Static constructor.
       
    62      */
       
    63     static CIRMainView* NewLC();
       
    64     
       
    65     /**
       
    66      *~CIRMainView()
       
    67      * Destructor.
       
    68      */
       
    69     ~CIRMainView();
       
    70     /**
       
    71      * ConstructL()
       
    72      * 2nd phase constructor
       
    73      */
       
    74     void ConstructL();
       
    75 
       
    76 	/**
       
    77      * CIRMainView()
       
    78      * C++ default constructor.
       
    79      */
       
    80     CIRMainView();
       
    81 
       
    82     // from base class CAknView
       
    83 	/**
       
    84 	 * From CAknView
       
    85 	 *
       
    86 	 * @see CAknView::Id() const
       
    87 	 */
       
    88     TUid Id() const;
       
    89 
       
    90 	/**
       
    91 	 * From CAknView
       
    92 	 *
       
    93 	 * @see CAknView::HandleCommandL( TInt aCommand )
       
    94 	 */
       
    95 	void HandleCommandL( TInt aCommand );
       
    96 	
       
    97 	
       
    98 	/**
       
    99 	* DynInitMenuPaneL
       
   100 	* Dynamically initialises a menu pane
       
   101 	*/
       
   102 	void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
       
   103     
       
   104     /**
       
   105     * ConstructToolbarL()
       
   106     * Constructs a touch toolbar
       
   107     */         
       
   108    	virtual void ConstructToolbarL();
       
   109    	
       
   110    	
       
   111     /**
       
   112      * From CAknView
       
   113      *
       
   114      * @see CAknView::HandleForegroundEventL( TBool aForeground )
       
   115      */
       
   116    	void HandleForegroundEventL( TBool aForeground );
       
   117 
       
   118     /**
       
   119      * From CAknView
       
   120      */
       
   121 	void HandleStatusPaneSizeChange();
       
   122 
       
   123 	/*
       
   124 	* OfferToolbarEventL
       
   125 	* 
       
   126 	*/
       
   127 	void OfferToolbarEventL(TInt aCommand );
       
   128 	/*
       
   129 	* SetToolbarItems
       
   130 	* Sets the  touch tool bar items
       
   131 	*/
       
   132     void SetToolbarItems();
       
   133     
       
   134 	//from MIRActiveNetworkObserver
       
   135 	/**
       
   136 	 * Notifies all observers whose network request is active
       
   137 	 * to reissue the request  
       
   138 	 * NotifyActiveNetworkObserversL()
       
   139 	 */	
       
   140 	 void NotifyActiveNetworkObserversL(TIRNetworkEvent aEvent);
       
   141 	 
       
   142  	 /**
       
   143 	 * Notifies all observers whose network request is active
       
   144 	 * to reset the pending request status  
       
   145 	 * ResetPendingRequests()
       
   146 	 */	
       
   147 	 void ResetPendingRequests(TBool aValue);
       
   148 
       
   149 	/**
       
   150 	 * HandlePresetChangedL
       
   151 	 * whenever their is any change in preset
       
   152 	 * the function will get invoked.
       
   153 	 */
       
   154 	 void HandlePresetChangedL( TInt aId, TUid aDataHandler, MPSPresetObserver::TPSReason aReason );
       
   155 	 /**
       
   156 	 * ConnectToLastPlayedStationL()
       
   157 	 * Connects to the last played station.
       
   158 	 */
       
   159     void ConnectToLastPlayedStationL();
       
   160 	/*
       
   161 	* GetMainContainer()
       
   162 	* returns pointer to main container
       
   163 	*/
       
   164 	CIRMainContainer* GetMainContainer();
       
   165 	/**
       
   166 	 * SetUrlFromPresetL.
       
   167 	 */
       
   168     void SetUrlFromPresetL(TInt aUrlIndex);
       
   169 	/**
       
   170 	 * DoConnectToChannelL
       
   171 	 * Connects to the  station .
       
   172 	 */
       
   173     void DoConnectToChannelL( TInt aUrlIndex );
       
   174 	/**
       
   175 	 * SyncPresetL.
       
   176 	 */
       
   177     void SyncPresetL(TInt aChid,const TDesC &aModifiedTime);
       
   178 	/**
       
   179 	* SetListBoxMarkedCount()
       
   180 	* sets the marked item count in the listbox
       
   181 	*/ 
       
   182 	void SetListBoxMarkedCount(TInt aMarkedItemCount);
       
   183 	/**
       
   184 	* SetMarkedFlag()
       
   185 	* sets the marked flag
       
   186 	*/ 
       
   187 	void SetMarkedFlag(TInt aMarkedFlag);
       
   188 	/**
       
   189 	* SetMarkedAllFlag()
       
   190 	* sets the marked All flag value.
       
   191 	*/ 
       
   192 	void SetMarkedAllFlag(TInt aMarkedAllFlag);
       
   193 	/*
       
   194 	* SetRequestPendingStatus()
       
   195 	* Sets the request pending state
       
   196 	*/
       
   197 	void SetRequestPendingStatus(TBool aRequestPending);
       
   198 	/*
       
   199 	* SetFavListen()
       
   200 	* Sets the listen is from favourites or not
       
   201 	*/
       
   202 	void SetFavListen(TBool aFavListen);
       
   203 	/*
       
   204 	* SetActualFilteredItemIndex()
       
   205 	* sets the original index of the filtered item
       
   206 	*/
       
   207 	void SetActualFilteredItemIndex(TInt aFilteredIndex);
       
   208  	/**
       
   209 	* SetMovingFlag()
       
   210 	* Sets the view is in move mode .
       
   211 	*/ 
       
   212     void SetMovingFlag(TBool aValue);
       
   213 	/**
       
   214 	* GetMarkedIndexArray()
       
   215 	* returns the array of elements marked  in the listbox
       
   216 	*/ 
       
   217 	RArray<TInt> GetMarkedIndexArray();
       
   218 	/**
       
   219 	* GetListBoxMarkedCount()
       
   220 	* returns the number of elements marked  in the listbox
       
   221 	*/ 
       
   222 	TInt GetListBoxMarkedCount();
       
   223 	/**
       
   224 	* GetMarkedFlag()
       
   225 	* returns the iMarkedflag value
       
   226 	*/ 
       
   227 	TInt GetMarkedFlag();
       
   228 	/**
       
   229 	* GetMarkedAllFlag()
       
   230 	* returns the iMarkedAllflag value
       
   231 	*/ 
       
   232 	TInt GetMarkedAllFlag();
       
   233 	/**
       
   234 	* GetCurrentIndex()
       
   235 	* returns the index of the station.
       
   236 	*/ 
       
   237 	TInt GetCurrentIndex();
       
   238 	/**
       
   239 	* GetLastPlayedStatus()
       
   240 	* returns the iLastplayed value
       
   241 	*/ 
       
   242 	TBool GetLastPlayedStatus();
       
   243 	/**
       
   244 	* GetAddToFavouratesFlag()
       
   245 	* returns whether any station is added to favourates or not.
       
   246 	*/ 
       
   247   	TBool GetAddToFavouratesFlag();
       
   248 	/*
       
   249 	* GetRequestPendingStatus()
       
   250 	* returns whether an active request is pending
       
   251 	*/
       
   252 	TBool GetRequestPendingStatus();
       
   253 	/*
       
   254 	* GetFavListen()
       
   255 	* returns /Checks whether request is listen to favorites.
       
   256 	*/
       
   257 	TBool GetFavListen();
       
   258     /**
       
   259 	* GetAddDimmingStatus()
       
   260 	* returns the dimming status value for Enable/Disabling Add to favourites option
       
   261 	*/ 
       
   262     TBool GetAddDimmingStatus();
       
   263    
       
   264     /**
       
   265 	* GetEditDimmingStatus()
       
   266 	* returns the dimming status value for Enable/Disabling Edit option
       
   267 	*/ 
       
   268   	TBool GetEditDimmingStatus();
       
   269  	/**
       
   270 	* GetMovingFlag()
       
   271 	* Gets the view is in move mode or not.
       
   272 	*/ 
       
   273     TBool GetMovingFlag();
       
   274     
       
   275 	/**
       
   276 	 * from MSyncPresetObserver
       
   277 	 * SyncPresetRemovedL()
       
   278 	 * called back when the preset that is synced was removed from isds
       
   279 	 * @param TInt,the preset id
       
   280 	 */
       
   281 	void SyncPresetRemovedL(TInt aId);
       
   282 
       
   283 	/**
       
   284 	 * from MSyncPresetObserver	
       
   285 	 * SyncPresetChangedL()
       
   286 	 * called back when the preset that is synced has been changed in the isds
       
   287 	 * @param CIRIsdsPreset&,the new preset data
       
   288 	 */
       
   289 	void SyncPresetChangedL(CIRIsdsPreset& aPreset);
       
   290 	
       
   291 	/**
       
   292 	 * from MSyncPresetObserver	
       
   293 	 * SyncPresetNoChangeL()
       
   294 	 * called back when the preset that is synced has not been changed
       
   295 	 */
       
   296 	 void SyncPresetNoChangeL();
       
   297 	 
       
   298 	/**
       
   299 	 * ConnectToSelectedStationL()
       
   300 	 * Used to synchronize the LastPlayed preset before listen
       
   301 	 */
       
   302 	 void ConnectToSelectedStationL();
       
   303 	 
       
   304 	/**
       
   305 	 * AddStationtoFavoritesL()
       
   306 	 * Called when user selects AddtoStations cmd from the MainView options
       
   307 	 */ 
       
   308 	 void AddStationtoFavoritesL();
       
   309     
       
   310 	/**
       
   311     * PresetLogoDownloadedL()
       
   312     * CallBack Function Returning the Preset With Logo
       
   313     */
       
   314 	void PresetLogoDownloadedL(CIRIsdsPreset* aPreset);
       
   315 	
       
   316 	/**
       
   317     * PresetLogoDownloadError()
       
   318     * CallBack Function Returning the Preset With no Logo/Error while downloading
       
   319     */
       
   320 	void PresetLogoDownloadError(CIRIsdsPreset* /*aPreset*/);
       
   321 	
       
   322 	/**
       
   323 	* LogoRequestL()
       
   324 	* Called by the container of this view
       
   325 	*/
       
   326 	void LogoRequestL();
       
   327 	
       
   328 	/**
       
   329 	* ResponseL()
       
   330 	* From the class MViewsResponseAndErrorObserver
       
   331 	*/
       
   332 	void ResponseL(CIRIsdsPreset* aPreset = NULL );
       
   333 
       
   334 	/**
       
   335 	* PresetResponseL()
       
   336 	* From the class MViewsResponseAndErrorObserver
       
   337 	*/
       
   338 	void PresetResponseL(CIRIsdsPreset* aPreset);
       
   339 
       
   340 	/**
       
   341 	* ErrorL()
       
   342 	* From the class MViewsResponseAndErrorObserver
       
   343 	*/
       
   344 	void ErrorL();
       
   345 	
       
   346 	
       
   347 	
       
   348 	
       
   349     
       
   350 protected:  //Methods
       
   351 
       
   352     // from base class CAknView
       
   353     /**
       
   354      * From CAknView
       
   355      *
       
   356      * @see CAknView::DoActivateL(const TVwsViewId& aPrevViewId, 
       
   357      *    TUid aCustomMessageId, 
       
   358      *    const TDesC8& aCustomMessage)
       
   359      */
       
   360     void DoActivateL( const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
       
   361     			 const TDesC8& aCustomMessage );
       
   362 
       
   363 	/**
       
   364      * From CAknView
       
   365      *
       
   366      * @see CAknView::DoDeactivate()
       
   367      */
       
   368 	void DoDeactivate();
       
   369 
       
   370   	
       
   371 private:
       
   372 	/** 
       
   373 	* iContainer
       
   374 	* Container for this view. 
       
   375 	*/
       
   376 	CIRMainContainer* iContainer;
       
   377 	/** 
       
   378 	* iMarkedFlag
       
   379 	* returns bool value depending on mark/unmark state. 
       
   380 	*/    
       
   381 	TBool iMarkedFlag;
       
   382 	/** 
       
   383 	* iMarkedAllFlag
       
   384 	* returns bool value depending on whether all the elements are marked/unmarked state. 
       
   385 	*/    
       
   386 	TBool iMarkedAllFlag;
       
   387 	/*
       
   388 	* iAddToFavouratesFlag
       
   389 	* returns whether any station is added to favourates or not.
       
   390 	*/
       
   391 	TBool iAddToFavouratesFlag;
       
   392 	
       
   393  	/*
       
   394 	* iIndexExisting
       
   395 	*/
       
   396 	TBool iIndexExisting;
       
   397 	/*
       
   398 	 * iRequestPending
       
   399 	 * Checks whether an active request is pending
       
   400 	 */
       
   401 	TBool iRequestPending;
       
   402 	/*
       
   403 	 * iFavListen
       
   404 	 * Checks whether request is listen to favorites 
       
   405 	 */
       
   406 	TBool iFavListen;
       
   407 	/*
       
   408 	 * iStationDetailsCmd
       
   409 	 *  
       
   410 	 */
       
   411     TBool iStationDetailsCmd;
       
   412 	
       
   413 	/** 
       
   414 	* iMoveMarkedFlag
       
   415 	* boolean flag to set the moving state 
       
   416 	*/
       
   417 	TBool iMoveMarkedFlag;
       
   418 	/**
       
   419 	* iMarkedItemCount
       
   420 	* Data to count the no.of items marked
       
   421 	* Used to Handle multiselection
       
   422 	*/
       
   423 	TInt iMarkedItemCount; 
       
   424 	/*
       
   425 	 * iFilteredIndex
       
   426 	 * the index that is obtained after the dynamic filtering of a station
       
   427 	 */
       
   428 	TInt iFilteredIndex;
       
   429 	/** 
       
   430 	* iMovedItemIndex
       
   431 	* flag to get the marked item 
       
   432 	*/
       
   433     TInt iMovedItemIndex;
       
   434 	/** 
       
   435 	* iIndexTo
       
   436 	* Index of moved place 
       
   437 	*/
       
   438     TInt iIndexTo;
       
   439 	/** 
       
   440 	* iIndexFrom
       
   441 	* Index of moving place
       
   442 	*/
       
   443     TInt iIndexFrom;
       
   444 	/** 
       
   445 	* iChannelIdTo
       
   446 	* Id of the moved channel
       
   447 	*/
       
   448     TInt iChannelIdTo;
       
   449 	/** 
       
   450 	* iChannelIdFrom
       
   451 	* Id of the moving channel
       
   452 	*/
       
   453     TInt iChannelIdFrom;
       
   454     
       
   455      /* iListenRequest
       
   456 	 * Checks whether request is for listen
       
   457 	 */
       
   458 	TBool iListenRequest;
       
   459 	
       
   460 	/* iAddtoStationsCmd
       
   461 	* Checks whether request is for AddtoStations
       
   462 	*/
       
   463 	TBool iAddtoStationsCmd;
       
   464   
       
   465 
       
   466 public:
       
   467 	/*
       
   468 	* iInvalidIconIndices
       
   469 	* instance of RArray
       
   470 	*/
       
   471 	RArray<TInt> iMarkedIndexArray;
       
   472 	/*
       
   473 	* iInvalidIconIndices
       
   474 	* instance of RArray
       
   475 	*/
       
   476 	RArray<TInt> iUnMarkedArray;
       
   477 	/*
       
   478 	* iEditStation
       
   479 	* instance for getting the Edit station index
       
   480 	*/
       
   481 	TBool iEditStation;
       
   482 	
       
   483 	/*
       
   484 	* iSyncReq
       
   485 	* to know the status whether the sync request is completed or not
       
   486 	*/	
       
   487     TBool iSyncReq;
       
   488     
       
   489     
       
   490     
       
   491    };
       
   492 
       
   493 #endif      // CIRMAINVIEW_H
       
   494             
       
   495 
       
   496             
       
   497