qtinternetradio/irhswidgetplugin/src/irhswidget.cpp
changeset 12 608f67c22514
parent 11 f683e24efca3
child 14 896e9dbc5f19
equal deleted inserted replaced
11:f683e24efca3 12:608f67c22514
    14 * Description:  Internet Radio home screen widget
    14 * Description:  Internet Radio home screen widget
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // System includes
    18 // System includes
    19 #include <HbLabel>
       
    20 #include <HbDocumentLoader>
       
    21 #include <HbFrameDrawer>
    19 #include <HbFrameDrawer>
    22 #include <HbFrameItem>
    20 #include <HbFrameItem>
    23 #include <HbIconAnimationManager>
       
    24 #include <HbIconAnimationDefinition>
       
    25 #include <HbColorScheme>
       
    26 #include <HbStyleLoader>
       
    27 #include <QGraphicsLinearLayout>
    21 #include <QGraphicsLinearLayout>
    28 #include <QSettings>
       
    29 #include <QPixmap>
       
    30 
    22 
    31 // User includes
    23 // User includes
    32 #include "irhswidget.h"
    24 #include "irhswidget.h"
    33 #include "irserviceclient.h"
    25 #include "irserviceclient.h"
    34 
    26 #include "irhswidgettitlerow.h"
    35 // Defines
    27 #include "irhswidgetmetadatarow.h"
    36 static const QString KIrHsWidgetDocml  = ":/resource/irhswidget.docml";
    28 #include "irqlogger.h"
    37 static const QString KIrHsWidget       = "irhswidget";
    29 
    38 static const QString KLogoLabel        = "logoLabel";
    30 // Constants
    39 static const QString KGoToIrLabel      = "goToIrLabel";
    31 static const int KIrHsWidgetContentsMargin = 0;
    40 static const QString KControlLabel     = "controlLabel";
    32 static const QString KIrHsWidgetBackgroundImage = "qtg_fr_hswidget_normal";
    41 static const QString KFirstRowLabel    = "firstRowLabel";
       
    42 static const QString KSecondRowLabel   = "secondRowLabel";
       
    43 static const QString KInfoControlArea  = "info_control_area";
       
    44 static const QString KCentrolArea      = "infoLayout";
       
    45 
       
    46 static const QString KDefaultStationLogo = "qtg_large_internet_radio";
       
    47 static const QString KPlayButtonIcon     = "qtg_mono_play";
       
    48 static const QString KStopButtonIcon     = "qtg_mono_stop";
       
    49 
       
    50 static const QString KFrameGraphicsName  = "qtg_fr_hswidget_normal";
       
    51 static const QString KStationNameColor   = "qtc_hs_list_item_title";
       
    52 static const QString KMetaDataColor      = "qtc_hs_list_item_content";
       
    53 
       
    54 static const QString KLoadingAnimationPrefix  = "qtg_anim_loading_";
       
    55 static const QString KLoadingIconName = "LoadingAnimation";
       
    56 
       
    57 const int KIrHsWidgetLogoSize = 50; // hs widget logo size
       
    58 
    33 
    59 // ======== MEMBER FUNCTIONS ========
    34 // ======== MEMBER FUNCTIONS ========
    60 // Constructor
    35 // Constructor
    61 IrHsWidget::IrHsWidget(QGraphicsItem* aParent, Qt::WindowFlags aFlags)
    36 IrHsWidget::IrHsWidget(QGraphicsItem* aParent, Qt::WindowFlags aFlags)
    62     : HbWidget(aParent, aFlags),
    37     : HbWidget(aParent, aFlags),
    63       mLogoLabel(NULL),
    38       mUserActionEnabled(false),
    64       mControlLabel(NULL),
    39       mRowLayout(NULL),
    65       mGoToIrLabel(NULL),
    40       mTitleRow(NULL),
    66       mStationNameLabel(NULL),
    41       mMetaDataRow(NULL),
    67       mMetadataLabel(NULL),
       
    68       mInfoControlArea(NULL),
       
    69       mCentralArea(NULL),
       
    70       mServiceClient(NULL),
    42       mServiceClient(NULL),
    71       mIrState(IrAppState::Unknown),
    43       mIrState(IrAppState::Unknown),
    72       mIrHsWidgetState(EUnknown)
    44       mIrHsWidgetState(EUnknown)
    73 {
    45 {
    74     setupUi();
    46     setupUi();
    75     initHomeSreenWidget();
    47     initHomeSreenWidget();
    76     
    48     
    77     mServiceClient = new IrServiceClient(this);
    49     mServiceClient = IrServiceClient::openInstance();
    78     setupConnection();
    50     setupConnection();
    79 }
    51 }
    80 
    52 
    81 // Destructor
    53 // Destructor
    82 IrHsWidget::~IrHsWidget()
    54 IrHsWidget::~IrHsWidget()
    83 {
    55 {
       
    56     if (mServiceClient)
       
    57     {
       
    58         mServiceClient->closeInstance();
       
    59     } 
       
    60     
       
    61     if (mRowLayout->count() == 1)
       
    62     {
       
    63         delete mMetaDataRow;
       
    64         mMetaDataRow = NULL;
       
    65     }
    84 }
    66 }
    85 
    67 
    86 // Initializes the widget.
    68 // Initializes the widget.
    87 // called by kqti fw when widget is added to home screen
    69 // called by kqti fw when widget is added to home screen
    88 void IrHsWidget::onInitialize()
    70 void IrHsWidget::onInitialize()
    96 {
    78 {
    97 }
    79 }
    98 
    80 
    99 // Called when widget is shown in the home screen
    81 // Called when widget is shown in the home screen
   100 void IrHsWidget::onShow()
    82 void IrHsWidget::onShow()
   101 {
    83 { 
       
    84     if (mRowLayout->count() == 2)
       
    85     {
       
    86         mMetaDataRow->startMetaDataMarquee();
       
    87     }   
   102 }
    88 }
   103 
    89 
   104 // Called when widget is hidden from the home screen
    90 // Called when widget is hidden from the home screen
   105 void IrHsWidget::onHide()
    91 void IrHsWidget::onHide()
   106 {
    92 {
       
    93     if (mRowLayout->count() == 2)
       
    94     {
       
    95         mMetaDataRow->stopMetaDataMarquee();
       
    96     }  
   107 }
    97 }
   108 
    98 
   109 
    99 
   110 void IrHsWidget::setupUi()
   100 void IrHsWidget::setupUi()
   111 {
   101 {
   112     HbDocumentLoader *uiLoader = new HbDocumentLoader();
   102     setContentsMargins( KIrHsWidgetContentsMargin, KIrHsWidgetContentsMargin,
   113     uiLoader->reset();
   103             KIrHsWidgetContentsMargin, KIrHsWidgetContentsMargin);
   114 
   104     
   115     bool loaded = false;
   105     //Setup layout
   116     uiLoader->load(KIrHsWidgetDocml, &loaded);
   106     mRowLayout = new QGraphicsLinearLayout(Qt::Vertical);
   117 
   107 
   118     if (loaded)
   108     mRowLayout->setContentsMargins(KIrHsWidgetContentsMargin, KIrHsWidgetContentsMargin,
   119     {
   109             KIrHsWidgetContentsMargin, KIrHsWidgetContentsMargin);
   120         HbWidget *irHsWidget = qobject_cast<HbWidget *>(uiLoader->findWidget(KIrHsWidget));
   110     mRowLayout->setSpacing(KIrHsWidgetContentsMargin);
   121         HbFrameDrawer *irHsWidgetDrawer = new HbFrameDrawer(KFrameGraphicsName, HbFrameDrawer::NinePieces);
   111     setLayout(mRowLayout);
   122         HbFrameItem   *irHsWidgetBgItem = new HbFrameItem(irHsWidgetDrawer, irHsWidget);
   112    
   123         irHsWidgetBgItem->setPreferredSize(irHsWidget->preferredSize());
   113    //background
   124 
   114    HbFrameDrawer * backgroundFrameDrawer = new HbFrameDrawer(KIrHsWidgetBackgroundImage, HbFrameDrawer::NinePieces);
   125         QGraphicsLinearLayout *irHsWidgetLayout = new QGraphicsLinearLayout(Qt::Vertical, this);
   115    HbFrameItem* backgroundLayoutItem = new HbFrameItem(backgroundFrameDrawer); 
   126         irHsWidgetLayout->addItem(irHsWidget);
   116    setBackgroundItem( backgroundLayoutItem );
   127         setLayout(irHsWidgetLayout);
       
   128 
       
   129         mGoToIrLabel      = qobject_cast<HbLabel *>(uiLoader->findWidget(KGoToIrLabel));
       
   130         mLogoLabel        = qobject_cast<HbLabel *>(uiLoader->findWidget(KLogoLabel));
       
   131         mControlLabel     = qobject_cast<HbLabel *>(uiLoader->findWidget(KControlLabel));
       
   132         mInfoControlArea  = qobject_cast<HbWidget *>(uiLoader->findWidget(KInfoControlArea));
       
   133         mCentralArea      = qobject_cast<HbWidget *>(uiLoader->findWidget(KCentrolArea));
       
   134 
       
   135         // make system's hs backgourd item under logo
       
   136         irHsWidgetBgItem->stackBefore(mLogoLabel);
       
   137 
       
   138         // set font for station name line
       
   139         mStationNameLabel = qobject_cast<HbLabel *>(uiLoader->findWidget(KFirstRowLabel));
       
   140         mStationNameLabel->setTextColor(HbColorScheme::color(KStationNameColor));
       
   141 
       
   142         // set font for meta data line
       
   143         mMetadataLabel = qobject_cast<HbLabel *>(uiLoader->findWidget(KSecondRowLabel));
       
   144         mMetadataLabel->setTextColor(HbColorScheme::color(KMetaDataColor));
       
   145 
       
   146         // Create animation.
       
   147         HbIconAnimationManager *animationManager = HbIconAnimationManager::global();
       
   148         HbIconAnimationDefinition animationDefinition;
       
   149         HbIconAnimationDefinition::AnimationFrame animationFrame;
       
   150         QList<HbIconAnimationDefinition::AnimationFrame> animationFrameList;
       
   151         
       
   152         QString animationFrameIconName;
       
   153         for (int i = 1; i < 11; i++)
       
   154         {
       
   155             animationFrame.duration = 100;
       
   156             animationFrameIconName.clear();
       
   157             animationFrameIconName.append(KLoadingAnimationPrefix);
       
   158             animationFrameIconName.append(animationFrameIconName.number(i));
       
   159             animationFrame.iconName = animationFrameIconName;
       
   160             animationFrameList.append(animationFrame);
       
   161         }
       
   162         animationDefinition.setPlayMode(HbIconAnimationDefinition::Loop);
       
   163         animationDefinition.setFrameList(animationFrameList);
       
   164         animationManager->addDefinition(KLoadingIconName, animationDefinition);
       
   165 
       
   166         // Construct an icon using the animation definition.
       
   167         mLoadingIcon.setIconName(KLoadingIconName);        
       
   168         
       
   169         // install event filter to widget
       
   170         mGoToIrLabel->installEventFilter(this);
       
   171         mControlLabel->installEventFilter(this);
       
   172         mLogoLabel->installEventFilter(this);
       
   173         mCentralArea->installEventFilter(this);
       
   174     }
       
   175     
       
   176     delete uiLoader;
       
   177 }
   117 }
   178 
   118 
   179 void IrHsWidget::initHomeSreenWidget()
   119 void IrHsWidget::initHomeSreenWidget()
   180 {
   120 {
       
   121     mTitleRow = new IrHsWidgetTitleRow(); 
       
   122     mMetaDataRow = new IrHsWidgetMetaDataRow();
       
   123     
       
   124     mRowLayout->addItem(mTitleRow);
       
   125     resizeHomeScreenWidget();
       
   126                 
   181     if (mServiceClient->isStationPlayed())
   127     if (mServiceClient->isStationPlayed())
   182     {
   128     {
   183         loadStoppedLayout();
   129         loadStoppedLayout();
   184         QString stationName;
   130         QString stationName;
   185         if (mServiceClient->loadStationName(stationName))
   131         if (mServiceClient->loadStationName(stationName))
   186         {
   132         {
   187             mStationNameLabel->setPlainText(stationName);
   133             mTitleRow->setStationName(stationName);
   188         }
   134         }
   189         
   135         
   190         if (mServiceClient->loadStationLogoFlag())
   136         if (mServiceClient->loadStationLogoFlag())
   191         {
   137         {
   192             loadStationLogo();
   138             mTitleRow->loadStationLogo();
   193         }
   139         }
   194     }
   140     }
   195     else
   141     else
   196     {
   142     {
   197         loadInitLayout();
   143         loadInitLayout();
   198     }
   144     }
   199 }
   145 }
   200 
   146 
       
   147 void IrHsWidget::resizeHomeScreenWidget()
       
   148 {
       
   149     //resize here so homescreen will place widget correctly on screen
       
   150     setPreferredSize( mRowLayout->preferredSize() );
       
   151     if (parentWidget())
       
   152     {
       
   153         //to place widget properly after adding to homescreen
       
   154         parentWidget()->resize(preferredSize()); 
       
   155 	}
       
   156 }
       
   157     
   201 void IrHsWidget::setupConnection()
   158 void IrHsWidget::setupConnection()
   202 {
   159 {
   203     // signal - slot for service event
   160     // signal - slot for service event
   204     QObject::connect(mServiceClient, SIGNAL(stationNameUpdated(QString)),
   161     QObject::connect(mServiceClient, SIGNAL(stationNameUpdated(QString)),
   205         this, SLOT(handleStationNameUpdated(QString)));
   162         this, SLOT(handleStationNameUpdated(QString)));
   208     QObject::connect(mServiceClient, SIGNAL(metaDataUpdated(QString)),
   165     QObject::connect(mServiceClient, SIGNAL(metaDataUpdated(QString)),
   209         this, SLOT(handleMetaDataUpdated(QString)));
   166         this, SLOT(handleMetaDataUpdated(QString)));
   210     QObject::connect(mServiceClient, SIGNAL(irStateChanged(IrAppState::Type)),
   167     QObject::connect(mServiceClient, SIGNAL(irStateChanged(IrAppState::Type)),
   211         this, SLOT(handleIrStateUpdated(IrAppState::Type)));
   168         this, SLOT(handleIrStateUpdated(IrAppState::Type)));
   212     QObject::connect(mServiceClient, SIGNAL(controlFailed()),
   169     QObject::connect(mServiceClient, SIGNAL(controlFailed()),
   213         this, SLOT(handleControlFailed()));    
   170         this, SLOT(handleControlFailed()));  
   214 }
       
   215 
       
   216 bool IrHsWidget::eventFilter(QObject *aObject, QEvent *aEvent)
       
   217 {
       
   218     bool eventWasConsumed = false;
       
   219     QString objectName     = aObject->objectName();
       
   220     QEvent::Type eventType = aEvent->type();
       
   221     
       
   222     if (KGoToIrLabel == objectName)
       
   223     {
       
   224         if (QEvent::GraphicsSceneMousePress == eventType)
       
   225         {
       
   226             eventWasConsumed = true;
       
   227             handleGoToIrAreaAction();
       
   228         }
       
   229     }
       
   230     else if (KLogoLabel == objectName)
       
   231     {
       
   232         if (QEvent::GraphicsSceneMousePress == eventType)
       
   233         {
       
   234             eventWasConsumed = true;
       
   235             handleLogoAreaAction();
       
   236         }
       
   237     }
       
   238     else if (KControlLabel == objectName)
       
   239     {
       
   240         if (QEvent::GraphicsSceneMousePress == eventType)
       
   241         {
       
   242             eventWasConsumed = true;
       
   243             handleControlAreaAction();
       
   244         }
       
   245     }
       
   246     else if (KCentrolArea == objectName)
       
   247     {
       
   248         if (QEvent::GraphicsSceneMousePress == eventType)
       
   249         {
       
   250             eventWasConsumed = true;
       
   251             handleCentralAreaAction();
       
   252         }
       
   253     }
       
   254         
   171         
   255     return eventWasConsumed;
   172     enableUserAction();          
   256 }
   173 }
   257 
   174 
   258 // ================ handle user press event ===============
   175 // ================ handle user press event ===============
   259 void IrHsWidget::handleLogoAreaAction()
   176 void IrHsWidget::handleCommonAreaAction()
   260 {
   177 {
   261     switch (mIrState)
   178     switch (mIrState)
   262     {
   179     {
   263         case IrAppState::NoRunInit:
   180         case IrAppState::NoRunInit:
   264         case IrAppState::NoRunStopped:
   181         case IrAppState::NoRunStopped:
       
   182             disableUserAction();
   265             mServiceClient->launchIrNormally();
   183             mServiceClient->launchIrNormally();
   266             break;
   184             break;
   267             
   185             
   268         case IrAppState::RunningInit:
   186         case IrAppState::RunningInit:
   269         case IrAppState::RunningStopped:
   187         case IrAppState::RunningStopped:
   277     }
   195     }
   278 }
   196 }
   279 
   197 
   280 void IrHsWidget::handleControlAreaAction()
   198 void IrHsWidget::handleControlAreaAction()
   281 {
   199 {
       
   200     LOG("IrHsWidget::handleControlAreaAction()");
       
   201     //here, for we will control the application by homescreen, 
       
   202     //to avoid repeat actions, we disable all control event here
       
   203     //and enable them when state changed or failed.      
       
   204     disableUserAction();
       
   205     
   282     switch (mIrState)
   206     switch (mIrState)
   283     {
   207     {
   284         case IrAppState::NoRunStopped:          
   208         case IrAppState::NoRunStopped:
   285             mServiceClient->launchIrNowPlaying();
   209             mServiceClient->launchIrNowPlaying();           
   286             loadLoadingLayout();              
       
   287             break;
   210             break;
   288                     
   211                     
   289         case IrAppState::RunningStopped:
   212         case IrAppState::RunningStopped:
   290             mServiceClient->startPlaying();
   213             mServiceClient->startPlaying();        
   291             loadLoadingLayout();         
       
   292             break;
   214             break;
   293                     
   215                     
   294         case IrAppState::Playing:
   216         case IrAppState::Playing:
   295             mServiceClient->stopPlaying();
   217             mServiceClient->stopPlaying();         
   296             loadStoppedLayout();          
       
   297             break;
   218             break;
   298             
   219             
   299         case IrAppState::Loading: 
   220         case IrAppState::Loading: 
   300             mServiceClient->cancelLoading();
   221             mServiceClient->cancelLoading();                  
   301             loadStoppedLayout();                     
       
   302             break;       
   222             break;       
   303 
   223 
   304         default:
   224         default:
   305             break;
   225             break;
   306     }
   226     }
   307 }
   227 }
   308 
   228 
   309 void IrHsWidget::handleGoToIrAreaAction()
       
   310 {
       
   311     handleLogoAreaAction();
       
   312 }
       
   313 
       
   314 void IrHsWidget::handleCentralAreaAction()
       
   315 {
       
   316     handleLogoAreaAction();
       
   317 }
       
   318 
   229 
   319 void IrHsWidget::handleControlFailed()
   230 void IrHsWidget::handleControlFailed()
   320 {
   231 { 
       
   232     LOG("handleControlFailed()");
       
   233     enableUserAction();
   321     switch (mIrHsWidgetState)
   234     switch (mIrHsWidgetState)
   322     {
   235     {
   323         case EInit:     // LAF == [logo][go to interneat radio]
   236         case EInit:     // LAF == [logo][go to interneat radio]
   324             loadInitLayout();
   237             loadInitLayout();
   325             break;
   238             break;
   343 
   256 
   344 
   257 
   345 // ======== for service notification ========
   258 // ======== for service notification ========
   346 void IrHsWidget::handleStationNameUpdated(const QString &aStationName)
   259 void IrHsWidget::handleStationNameUpdated(const QString &aStationName)
   347 {
   260 {
   348     if (mStationNameLabel->plainText() != aStationName)
   261     mTitleRow->setStationName(aStationName);
   349     {
       
   350         mStationNameLabel->setPlainText(aStationName);
       
   351     }
       
   352 }
   262 }
   353 
   263 
   354 void IrHsWidget::handleStationLogoUpdated(bool aLogoAvailable)
   264 void IrHsWidget::handleStationLogoUpdated(bool aLogoAvailable)
   355 {    
   265 {    
   356     if (aLogoAvailable)
   266     if (aLogoAvailable)
   357     {
   267     {
   358         loadStationLogo();
   268         mTitleRow->loadStationLogo();
   359     }
   269     }
   360     else
   270     else
   361     {
   271     {
   362         mLogoLabel->setIcon(KDefaultStationLogo);
   272         mTitleRow->setDefaultLogo();
   363     }
   273     }
   364 }
   274 }
   365 
   275 
   366 void IrHsWidget::handleMetaDataUpdated(const QString &aMetaData)
   276 void IrHsWidget::handleMetaDataUpdated(const QString &aMetaData)
   367 {
   277 {
   368     if (mMetadataLabel->plainText() != aMetaData)
   278     mMetaDataRow->setMetaData(aMetaData); 
   369     {
       
   370         mMetadataLabel->setPlainText(aMetaData);
       
   371     }    
       
   372 }
   279 }
   373 
   280 
   374 
   281 
   375 void IrHsWidget::handleIrStateUpdated(IrAppState::Type aNewState)
   282 void IrHsWidget::handleIrStateUpdated(IrAppState::Type aNewState)
   376 {
   283 {
       
   284     LOG("IrHsWidget::handleIrStateUpdated()");
       
   285     enableUserAction();
   377     if (aNewState == mIrState)
   286     if (aNewState == mIrState)
   378     {
   287     {
   379         return;
   288         return;
   380     }
   289     }
   381     
   290     
   436     }
   345     }
   437 }
   346 }
   438 // LAF == [logo][go to interneat radio]
   347 // LAF == [logo][go to interneat radio]
   439 void IrHsWidget::loadInitLayout()
   348 void IrHsWidget::loadInitLayout()
   440 {
   349 {
   441     mInfoControlArea->hide();
   350     if (mRowLayout->count() == 2)
   442     mGoToIrLabel->show();
   351     {
       
   352         mRowLayout->removeItem(mMetaDataRow);
       
   353         resizeHomeScreenWidget();      
       
   354     }
       
   355     
       
   356     mTitleRow->setDefaultTitle();        
   443 }
   357 }
   444 
   358 
   445 // LAF == [logo][StationInfo][Play]
   359 // LAF == [logo][StationInfo][Play]
   446 void IrHsWidget::loadStoppedLayout()
   360 void IrHsWidget::loadStoppedLayout()
   447 {
   361 {
   448     mGoToIrLabel->hide();
   362     if (mRowLayout->count() == 1)
   449     mInfoControlArea->show();
   363     {
   450     mMetadataLabel->setPlainText(QString(""));
   364         mRowLayout->addItem(mMetaDataRow);
   451     mControlLabel->setIcon(KPlayButtonIcon);
   365         resizeHomeScreenWidget();      
       
   366     }
       
   367     
       
   368     mMetaDataRow->setPlayIcon();
   452 }
   369 }
   453 
   370 
   454 // LAF == [logo][StationInfo][Stop]
   371 // LAF == [logo][StationInfo][Stop]
   455 void IrHsWidget::loadPlayingLayout()
   372 void IrHsWidget::loadPlayingLayout()
   456 {
   373 {
   457     mGoToIrLabel->hide();
   374     if (mRowLayout->count() == 1)
   458     mInfoControlArea->show();
   375     {
   459     mControlLabel->setIcon(KStopButtonIcon);      
   376         mRowLayout->addItem(mMetaDataRow);
       
   377         resizeHomeScreenWidget();      
       
   378     }
       
   379     
       
   380     mMetaDataRow->setStopIcon();     
   460 }
   381 }
   461 
   382 
   462 // LAF == [logo][StationInfo][Loading]
   383 // LAF == [logo][StationInfo][Loading]
   463 void IrHsWidget::loadLoadingLayout()
   384 void IrHsWidget::loadLoadingLayout()
   464 {
   385 {
   465     mGoToIrLabel->hide();
   386     if (mRowLayout->count() == 1)
   466     mInfoControlArea->show();
   387     {
   467     mMetadataLabel->setPlainText(QString(""));
   388         mRowLayout->addItem(mMetaDataRow);
   468     mControlLabel->setIcon(mLoadingIcon);   
   389         resizeHomeScreenWidget();      
   469 }
   390     }
   470 
   391     
   471 void IrHsWidget::loadStationLogo()
   392     mMetaDataRow->setLoadingIcon(); 
   472 {
   393 }
   473     QSettings settings(KIrSettingOrganization, KIrSettingApplicaton);
   394 
   474     if (settings.value(KIrSettingStationLogo).canConvert<QPixmap>())
   395 
   475     {
   396 
   476         QPixmap logoPixmap = settings.value(KIrSettingStationLogo).value<QPixmap>();
   397 void IrHsWidget::enableUserAction()
   477         QPixmap newLogoPixmap = 
   398 {
   478              logoPixmap.scaled(QSize(KIrHsWidgetLogoSize,KIrHsWidgetLogoSize),Qt::KeepAspectRatio);
   399     if (!mUserActionEnabled)
   479         QIcon logoQIcon(newLogoPixmap);
   400     {
   480         HbIcon logoHbIcon(logoQIcon);            
   401         mUserActionEnabled = true;
   481         mLogoLabel->setIcon(logoHbIcon);
   402         // signal - slot for user click action
   482     }  
   403         QObject::connect(mTitleRow, SIGNAL(titleRowClicked()),
   483 }
   404             this, SLOT(handleCommonAreaAction()));
   484 
   405         QObject::connect(mMetaDataRow, SIGNAL(metaDataAreaClicked()),
       
   406             this, SLOT(handleCommonAreaAction()));     
       
   407         QObject::connect(mMetaDataRow, SIGNAL(controlAreaClicked()),
       
   408             this, SLOT(handleControlAreaAction()));      
       
   409     }
       
   410 }
       
   411 
       
   412 void IrHsWidget::disableUserAction()
       
   413 {
       
   414     if (mUserActionEnabled)
       
   415     {    
       
   416         mUserActionEnabled = false;
       
   417         // signal - slot for user click action
       
   418         QObject::disconnect(mTitleRow, SIGNAL(titleRowClicked()),
       
   419             this, SLOT(handleCommonAreaAction()));
       
   420         QObject::disconnect(mMetaDataRow, SIGNAL(metaDataAreaClicked()),
       
   421             this, SLOT(handleCommonAreaAction()));     
       
   422         QObject::disconnect(mMetaDataRow, SIGNAL(controlAreaClicked()),
       
   423             this, SLOT(handleControlAreaAction()));  
       
   424     }
       
   425 }
       
   426