radioapp/radiowidgets/inc/radiowindow.h
branchRCL_3
changeset 19 cce62ebc198e
equal deleted inserted replaced
18:1a6714c53019 19:cce62ebc198e
       
     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 _RADIOWINDOW_H_
       
    19 #define _RADIOWINDOW_H_
       
    20 
       
    21 // System includes
       
    22 #include <HbMainWindow>
       
    23 #include <HbEffect>
       
    24 #include <QWeakPointer>
       
    25 #include <QScopedPointer>
       
    26 #include <QSharedPointer>
       
    27 
       
    28 // User includes
       
    29 #include "radiowidgetsexport.h"
       
    30 
       
    31 // Forward declarations
       
    32 class RadioViewBase;
       
    33 class RadioUiEngine;
       
    34 class HbVolumeSliderPopup;
       
    35 class HbMessageBox;
       
    36 
       
    37 typedef QScopedPointer<HbVolumeSliderPopup> VolumeSliderPtr;
       
    38 
       
    39 /**
       
    40  * QWeakPointer is used to store the views because it tracks the deletion of the object and nulls
       
    41  * the reference. Transient view like RadioHistoryView is destroyed after they are closed
       
    42  * and QWeakPointer will notice it.
       
    43  */
       
    44 typedef QWeakPointer<RadioViewBase> ViewPtr;
       
    45 
       
    46 // Class declaration
       
    47 class WIDGETS_DLL_EXPORT RadioWindow : public HbMainWindow
       
    48 {
       
    49     Q_OBJECT
       
    50     Q_DISABLE_COPY( RadioWindow )
       
    51 
       
    52 public:
       
    53 
       
    54     RadioWindow( QWidget* parent = 0 );
       
    55 
       
    56     ~RadioWindow();
       
    57 
       
    58     void showErrorMessage( const QString& text );
       
    59 
       
    60     void init();
       
    61 
       
    62     QString orientationSection();
       
    63 
       
    64 public slots:
       
    65 
       
    66     void activateMainView();
       
    67 
       
    68     void activateStationsView();
       
    69 
       
    70     void activateHistoryView();
       
    71 
       
    72 private slots:
       
    73 
       
    74     void initView();
       
    75     void updateOrientation( Qt::Orientation orientation );
       
    76     void showVolumeLevel( int volume );
       
    77     void updateAntennaStatus( bool connected );
       
    78 
       
    79 private:
       
    80 
       
    81 // New functions
       
    82 
       
    83     void activateView( RadioViewBase* aMember, const QString& docmlFile, Hb::ViewSwitchFlags flags = Hb::ViewSwitchDefault );
       
    84 
       
    85 private: // data
       
    86 
       
    87     /*!
       
    88      * Pointer to the UI engine
       
    89      * Own, shared with views
       
    90      */
       
    91     QSharedPointer<RadioUiEngine>       mUiEngine;
       
    92 
       
    93     /**
       
    94      * Tuning view.
       
    95      * Own.
       
    96      */
       
    97     ViewPtr                             mMainView;
       
    98 
       
    99     /**
       
   100      * Stations view
       
   101      * Own.
       
   102      */
       
   103     ViewPtr                             mStationsView;
       
   104 
       
   105     /**
       
   106      * Play history view
       
   107      * Own.
       
   108      */
       
   109     ViewPtr                             mHistoryView;
       
   110 
       
   111     /**
       
   112      * Pointer to the volume slider
       
   113      * Own.
       
   114      */
       
   115     VolumeSliderPtr                     mVolSlider;
       
   116 
       
   117     /**
       
   118      * Pointer to messagebox
       
   119      * Own.
       
   120      */
       
   121     QScopedPointer<HbMessageBox>        mMessageBox;
       
   122 
       
   123 };
       
   124 
       
   125 
       
   126 #endif // _RADIOWINDOW_H_