radioapp/radioenginewrapper/inc/radiofrequencyscanninghandler.h
changeset 16 f54ebcfc1b80
parent 14 63aabac4416d
child 17 2cf3bab7c5c6
child 19 afea38384506
equal deleted inserted replaced
14:63aabac4416d 16:f54ebcfc1b80
     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 RADIOFREQUENCYSCANNINGHANDLER_H
       
    19 #define RADIOFREQUENCYSCANNINGHANDLER_H
       
    20 
       
    21 // System includes
       
    22 #include <QObject>
       
    23 #include <QMap>
       
    24 
       
    25 // User includes
       
    26 #include "mradioscanobserver.h"
       
    27 
       
    28 // Forward declarations
       
    29 class RadioEngineWrapperPrivate;
       
    30 
       
    31 // Constants
       
    32 
       
    33 // Class declaration
       
    34 class RadioFrequencyScanningHandler : public QObject
       
    35                                     , public MRadioScanObserver
       
    36     {
       
    37     Q_OBJECT
       
    38 public:
       
    39 
       
    40     explicit RadioFrequencyScanningHandler( RadioEngineWrapperPrivate& radioEngine );
       
    41 
       
    42 // from base class MRadioScanObserver
       
    43 
       
    44     void ScanFrequencyEventL( TUint32 aFrequency );
       
    45     void ScanCompletedEventL( TInt aError );
       
    46 
       
    47 // New functions
       
    48 
       
    49     /*!
       
    50      * Starts the scanning
       
    51      * @param muted flag to indicate if the audio was already muted when scanning began
       
    52      */
       
    53     void startScanning( bool muted );
       
    54 
       
    55     /*!
       
    56      * Adds a new station that was found
       
    57      * @param frequency Frequency of the found station
       
    58      */
       
    59     void addFoundStation( const uint frequency );
       
    60 
       
    61     /*!
       
    62      * Cancels the scanning process
       
    63      */
       
    64     void cancel();
       
    65 
       
    66 private slots:
       
    67 
       
    68     void delayedStart();
       
    69 
       
    70 private: // data
       
    71 
       
    72     /**
       
    73      * Reference to the engine
       
    74      */
       
    75     RadioEngineWrapperPrivate&  mEngine;
       
    76 
       
    77     /**
       
    78      * Last scanned frequency. Used to know when the scanning has looped around the
       
    79      * frequency band and it should stop
       
    80      */
       
    81     uint                        mLastFoundFrequency;
       
    82     };
       
    83 
       
    84 #endif // RADIOFREQUENCYSCANNINGHANDLER_H