qtinternetradio/irhswidgetplugin/inc/irhswidget.h
branchGCC_SURGE
changeset 13 c9471d26c7f2
parent 12 608f67c22514
child 14 896e9dbc5f19
equal deleted inserted replaced
9:bfc95e24a059 13:c9471d26c7f2
       
     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:  Internet Radio home screen widget
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef IRHSWIDGET_H
       
    19 #define IRHSWIDGET_H
       
    20 
       
    21 // System includes
       
    22 #include <hbwidget.h>
       
    23 
       
    24 // User includes
       
    25 #include "irservicedef.h"
       
    26 
       
    27 // Forward declarations
       
    28 class QString;
       
    29 class QGraphicsLinearLayout;
       
    30 class IrHsWidgetTitleRow;
       
    31 class IrHsWidgetMetaDataRow;
       
    32 class IrServiceClient;
       
    33 
       
    34 class IrHsWidget : public HbWidget
       
    35 {
       
    36     Q_OBJECT
       
    37 
       
    38 public:
       
    39     explicit IrHsWidget(QGraphicsItem *aParent = 0, Qt::WindowFlags aFlags = 0);
       
    40     virtual ~IrHsWidget();
       
    41 
       
    42 
       
    43 public slots:
       
    44     // from KQTI widget model framework, must be slots
       
    45     void onInitialize();
       
    46     void onUninitialize();    
       
    47     void onShow();
       
    48     void onHide();
       
    49 
       
    50 private:
       
    51     void setupUi();
       
    52     void setupConnection();
       
    53 
       
    54     enum IrHsWidgetState
       
    55     {
       
    56         EUnknown   = -1,
       
    57         EInit      = 0,
       
    58         EPlaying   = 1,
       
    59         EStopped   = 2,
       
    60         ELoading   = 3
       
    61         
       
    62     };
       
    63     void handleHsWidgetStateChange(IrHsWidgetState aNewState);
       
    64     
       
    65        
       
    66     void initHomeSreenWidget();
       
    67     void resizeHomeScreenWidget();
       
    68     
       
    69     void loadInitLayout();
       
    70     void loadStoppedLayout();
       
    71     void loadPlayingLayout();
       
    72     void loadLoadingLayout();
       
    73     
       
    74     void enableUserAction();
       
    75     void disableUserAction();
       
    76 
       
    77 private slots:
       
    78     // handle user press event
       
    79     void handleCommonAreaAction();
       
    80     void handleControlAreaAction();
       
    81     
       
    82     void handleControlFailed();
       
    83 
       
    84     // for service notification
       
    85     void handleStationNameUpdated(const QString &aStationName);
       
    86     void handleStationLogoUpdated(bool aLogoAvailable);
       
    87     void handleMetaDataUpdated(const QString &aMetaData);
       
    88     void handleIrStateUpdated(IrAppState::Type aNewState);
       
    89 
       
    90 private:    
       
    91     bool mUserActionEnabled;
       
    92     
       
    93     QGraphicsLinearLayout   *mRowLayout;
       
    94     IrHsWidgetTitleRow      *mTitleRow;
       
    95     IrHsWidgetMetaDataRow   *mMetaDataRow;
       
    96 
       
    97     IrServiceClient *mServiceClient;
       
    98 
       
    99     IrAppState::Type mIrState;
       
   100     IrHsWidgetState  mIrHsWidgetState;
       
   101     
       
   102     Q_DISABLE_COPY(IrHsWidget)    
       
   103 };
       
   104 
       
   105 #endif // IRHSWIDGET_H