radioapp/radiowidgets/inc/radiostationsview.h
changeset 13 46974bebc798
child 14 63aabac4416d
equal deleted inserted replaced
0:f3d95d9c00ab 13:46974bebc798
       
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef RADIOSTATIONSVIEW_H
       
    19 #define RADIOSTATIONSVIEW_H
       
    20 
       
    21 // System includes
       
    22 #include <hbicon.h>
       
    23 
       
    24 // User includes
       
    25 #include "radioviewbase.h"
       
    26 #include "radiowidgetsexport.h"
       
    27 
       
    28 // Forward declarations
       
    29 class RadioMainWindow;
       
    30 class RadioStationModel;
       
    31 class HbListView;
       
    32 class HbPushButton;
       
    33 class RadioBannerLabel;
       
    34 class HbAbstractViewItem;
       
    35 class RadioXmlUiLoader;
       
    36 class RadioStation;
       
    37 class RadioStationFilterModel;
       
    38 
       
    39 // Class declaration
       
    40 class WIDGETS_DLL_EXPORT RadioStationsView : public RadioViewBase
       
    41 {
       
    42     Q_OBJECT
       
    43     Q_PROPERTY(HbIcon nowPlayingIcon READ nowPlayingIcon WRITE setNowPlayingIcon)
       
    44     Q_PROPERTY(HbIcon favoriteIcon READ favoriteIcon WRITE setFavoriteIcon)
       
    45 
       
    46 public:
       
    47 
       
    48     explicit RadioStationsView( RadioXmlUiLoader* uiLoader );
       
    49 
       
    50     void setNowPlayingIcon( const HbIcon& nowPlayingIcon );
       
    51     HbIcon nowPlayingIcon() const;
       
    52 
       
    53     void setFavoriteIcon( const HbIcon& favoriteIcon );
       
    54     HbIcon favoriteIcon() const;
       
    55 
       
    56 private slots:
       
    57 
       
    58     void listItemClicked( const QModelIndex& index );
       
    59     void listItemLongPressed( HbAbstractViewItem* item, const QPointF& coords );
       
    60     void updateHeadsetStatus( bool connected );
       
    61     void updateCurrentStation();
       
    62     void deckButtonPressed();
       
    63     void startScanAndSavePresets();
       
    64     void updateControlVisibilities();
       
    65 
       
    66 private:
       
    67 
       
    68 // from base class RadioViewBase
       
    69 
       
    70     void init( RadioMainWindow* aMainWindow, RadioStationModel* aModel );
       
    71 
       
    72 // from base class QGraphicsWidget
       
    73 
       
    74     void showEvent( QShowEvent* event );
       
    75 
       
    76 // New functions
       
    77 
       
    78     void initListView();
       
    79 
       
    80     void updateHeading();
       
    81 
       
    82 private: //data
       
    83 
       
    84     RadioStationFilterModel*    mFilterModel;
       
    85 
       
    86     HbAction*                   mScanStationsAction;
       
    87     HbAction*                   mRemoveAllPresetsAction;
       
    88 
       
    89     HbListView*                 mStationsList;
       
    90 
       
    91     RadioBannerLabel*           mHeadingBanner;
       
    92 
       
    93     HbAction*                   mFavoritesButton;
       
    94     HbAction*                   mLocalStationsButton;
       
    95 
       
    96     HbIcon                      mFavoriteIcon;
       
    97 
       
    98     HbIcon                      mNowPlayingIcon;
       
    99 
       
   100 };
       
   101 
       
   102 #endif // RADIOSTATIONSVIEW_H