qtinternetradio/ui/src/irabstractlistviewbase.cpp
changeset 5 0930554dc389
parent 3 ee64f059b8e1
child 11 f683e24efca3
equal deleted inserted replaced
3:ee64f059b8e1 5:0930554dc389
    22 #include <hbabstractviewitem.h>
    22 #include <hbabstractviewitem.h>
    23 #include <hbscrollbar.h>
    23 #include <hbscrollbar.h>
    24 #include <HbGroupBox>
    24 #include <HbGroupBox>
    25 #include <HbMarqueeItem>
    25 #include <HbMarqueeItem>
    26 #include <HbLabel>
    26 #include <HbLabel>
       
    27 #include <hbframedrawer.h>
       
    28 #include <hbframeitem.h>
    27 
    29 
    28 #include "irviewmanager.h"
    30 #include "irviewmanager.h"
    29 #include "irabstractlistviewbase.h"
    31 #include "irabstractlistviewbase.h"
    30 #include "irplaycontroller.h"
    32 #include "irplaycontroller.h"
    31 #include "irapplication.h"
    33 #include "irapplication.h"
    34 #include "irqisdsclient.h"
    36 #include "irqisdsclient.h"
    35 #include "irqenums.h"
    37 #include "irqenums.h"
    36 #include "iruidefines.h"
    38 #include "iruidefines.h"
    37  
    39  
    38 const int KAnimationLoopTimes = 2; // Animation loop times
    40 const int KAnimationLoopTimes = 2; // Animation loop times
       
    41 //#define NOW_PLAYING_BANNER_FRAME "qtg_fr_multimedia_trans"
       
    42 #define NOW_PLAYING_BANNER_FRAME "qtg_fr_popup_list_highlight"
    39 
    43 
    40 IrAbstractListViewBase::IrAbstractListViewBase(IRApplication *aApplication, TIRViewId aViewId)
    44 IrAbstractListViewBase::IrAbstractListViewBase(IRApplication *aApplication, TIRViewId aViewId)
    41     : IRBaseView(aApplication, aViewId),
    45     : IRBaseView(aApplication, aViewId),
    42 	  iListView(NULL),
    46 	  iListView(NULL),
    43       iPlayingBanner(NULL),
    47       iPlayingBanner(NULL),
   115     iStationName->setFont(font);
   119     iStationName->setFont(font);
   116     iArtistSongName = qobject_cast<HbMarqueeItem *>(iLoader.findWidget(ABSTRACT_LIST_VIEW_BASE_OBJECT_ARTISTSONGNAME));
   120     iArtistSongName = qobject_cast<HbMarqueeItem *>(iLoader.findWidget(ABSTRACT_LIST_VIEW_BASE_OBJECT_ARTISTSONGNAME));
   117     iArtistSongName->setLoopCount(KAnimationLoopTimes);
   121     iArtistSongName->setLoopCount(KAnimationLoopTimes);
   118 
   122 
   119     iListView = qobject_cast<HbListView *>(iLoader.findObject(ABSTRACT_LIST_VIEW_BASE_OBJECT_LISTVIEW));
   123     iListView = qobject_cast<HbListView *>(iLoader.findObject(ABSTRACT_LIST_VIEW_BASE_OBJECT_LISTVIEW));
       
   124 
       
   125     // draw background for now playing banner
       
   126     HbFrameDrawer* drawer = new HbFrameDrawer(NOW_PLAYING_BANNER_FRAME, HbFrameDrawer::NinePieces);
       
   127     HbFrameItem* backgroundItem = new HbFrameItem(drawer, iPlayingBanner);
       
   128     if (backgroundItem)
       
   129     {
       
   130         // set item to fill the whole widget
       
   131         backgroundItem->setGeometry(QRectF(QPointF(0, 0), iPlayingBanner->size()));
       
   132         backgroundItem->setZValue(0);
       
   133         iPlayingBanner->setBackgroundItem(backgroundItem);
       
   134     }
   120 }
   135 }
   121 
   136 
   122 void IrAbstractListViewBase::initScrollBar()
   137 void IrAbstractListViewBase::initScrollBar()
   123 {
   138 {
   124     HbScrollBar *scrollbar = iListView->verticalScrollBar();
   139     HbScrollBar *scrollbar = iListView->verticalScrollBar();
   134 }
   149 }
   135 
   150 
   136 TIRViewParameter IrAbstractListViewBase::getViewParameter() const
   151 TIRViewParameter IrAbstractListViewBase::getViewParameter() const
   137 {
   152 {
   138     return iViewParameter;
   153     return iViewParameter;
       
   154 }
       
   155 
       
   156 void IrAbstractListViewBase::setPlayingBannerTextColor(const QString &aColor)
       
   157 {
       
   158     QColor color(aColor);
       
   159     iStationName->setTextColor(color);
       
   160     iArtistSongName->setTextColor(color);
   139 }
   161 }
   140 
   162 
   141 void IrAbstractListViewBase::setCheckedAction()
   163 void IrAbstractListViewBase::setCheckedAction()
   142 {       
   164 {       
   143     //default implementation
   165     //default implementation