radioapp/radiouiengine/inc/radiostationmodel_p.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 RADIOSTATIONMODEL_P_H_
       
    19 #define RADIOSTATIONMODEL_P_H_
       
    20 
       
    21 // System includes
       
    22 #include <qlist>
       
    23 #include <qmap>
       
    24 #include <qscopedpointer>
       
    25 #include <qicon>
       
    26 
       
    27 // User includes
       
    28 //#include "radiostation.h"
       
    29 #include "radiostationhandlerif.h"
       
    30 
       
    31 // Forward declarations
       
    32 class RadioUiEngine;
       
    33 class RadioPresetStorage;
       
    34 class RadioEngineWrapper;
       
    35 class QTimer;
       
    36 
       
    37 // Class declaration
       
    38 class RadioStationModelPrivate : public RadioStationHandlerIf
       
    39 {
       
    40     Q_DECLARE_PUBLIC( RadioStationModel )
       
    41     Q_DISABLE_COPY( RadioStationModelPrivate )
       
    42 
       
    43 public:
       
    44 
       
    45     explicit RadioStationModelPrivate( RadioStationModel* model, RadioUiEngine& uiEngine );
       
    46 
       
    47     virtual ~RadioStationModelPrivate();
       
    48 
       
    49 private:
       
    50 
       
    51 // from base class RadioStationHandlerIf
       
    52 
       
    53     uint currentFrequency() const;
       
    54     int currentPresetIndex() const;
       
    55     void setCurrentStation( uint frequency );
       
    56     bool containsFrequency( uint frequency );
       
    57     bool containsPresetIndex( int presetIndex );
       
    58     void startDynamicPsCheck();
       
    59     void addScannedFrequency( uint frequency );
       
    60     void removeLocalStations();
       
    61     void setCurrentPsName( uint frequency, const QString& name );
       
    62     void setCurrentRadioText( uint frequency, const QString& radioText );
       
    63     void setCurrentRadioTextPlus( uint frequency, int rtClass, const QString& rtItem );
       
    64     void setCurrentPiCode( uint frequency, int piCode );
       
    65     void setCurrentGenre( uint frequency, int genre );
       
    66 
       
    67 private: // data
       
    68 
       
    69     /**
       
    70      * Pointer to the public class
       
    71      * Not own.
       
    72      */
       
    73     RadioStationModel*          q_ptr;
       
    74 
       
    75     /**
       
    76      * Reference to the ui engine
       
    77      */
       
    78     RadioUiEngine&              mUiEngine;
       
    79 
       
    80     /**
       
    81      * Pointer to the preset storage
       
    82      */
       
    83     RadioPresetStorage*         mPresetStorage;
       
    84 
       
    85     /**
       
    86      * Pointer to the radio engine wrapper
       
    87      */
       
    88     RadioEngineWrapper*         mEngine;
       
    89 
       
    90     /**
       
    91      * List of station items
       
    92      */
       
    93     Stations                    mStations;
       
    94 
       
    95     /**
       
    96      * Station used to store information of manually tuned frequencies
       
    97      */
       
    98     RadioStation                mManualStation;
       
    99 
       
   100     /**
       
   101      * Pointer to the current station
       
   102      * Not own.
       
   103      */
       
   104     RadioStation*               mCurrentStation;
       
   105 
       
   106     /**
       
   107      * Dynamic PS timer
       
   108      * Own.
       
   109      */
       
   110     QScopedPointer<QTimer>      mDynamicPsTimer;
       
   111 
       
   112     /**
       
   113      * Level of detail shown in Qt::DisplayRole and Qt::DecorationRole roles
       
   114      */
       
   115     RadioStationModel::Detail   mDetailLevel;
       
   116 
       
   117     /**
       
   118      * Pointer to favorite icon.
       
   119      * Not own.
       
   120      */
       
   121     QIcon                       mFavoriteIcon;
       
   122 
       
   123     /**
       
   124      * Pointer to the now playing marker icon
       
   125      * Not own.
       
   126      */
       
   127     QIcon                       mNowPlayingIcon;
       
   128 
       
   129 };
       
   130 
       
   131 #endif // RADIOSTATIONMODEL_P_H_