mmserv/radioutility/radio_utility/src/RadioFmTunerUtilityBody.h
changeset 0 71ca22bcf22a
child 6 e35735ece90c
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Implementation header of the Radio FM Tuner Utility API
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_RADIOFMTUENRUTILITYBODY_H
       
    22 #define C_RADIOFMTUENRUTILITYBODY_H
       
    23 
       
    24 #include <radiofmtunerutility.h>
       
    25 
       
    26 class RRadioSession;
       
    27 
       
    28 /**
       
    29  *  This class encapsulates the implementation body of CRadioFmTunerUtility interface.
       
    30  *
       
    31  *  @lib Radio_Utility.lib
       
    32  *  @since S60 3.2
       
    33  */
       
    34 class CRadioFmTunerUtility::CBody : public CBase
       
    35     {
       
    36 
       
    37 public:
       
    38 
       
    39     static CBody* NewL( RRadioSession& aRadioSession, MRadioFmTunerObserver& aObserver );
       
    40 
       
    41     ~CBody();
       
    42 
       
    43      /**
       
    44      * Asynchronous request to get control of the FM tuner. User must be ready to receive
       
    45      * callback method MrftoRequestTunerControlComplete. Control to the tuner must be granted
       
    46      * before any functions that require control of the tuner (such as Tune) can be made.
       
    47      *
       
    48      * @since S60 3.2
       
    49      * @see MRadioFmTunerObserver::MrftoRequestTunerControlComplete
       
    50      */
       
    51     void RequestTunerControl();
       
    52 
       
    53     /**
       
    54      * Close the tuner and free all memory allocated. Any ongoing playing activity will be stopped,
       
    55      * control of the tuner will be released, and the hardware will be powered down if no other
       
    56      * clients need it.
       
    57      *
       
    58      * @since S60 3.2
       
    59      */
       
    60     void Close();
       
    61 
       
    62     /**
       
    63      * Get the capabilities of the FM tuner on the device.
       
    64      *
       
    65      * @since S60 3.2
       
    66      * @param aCaps The capabilities object to fill
       
    67      * @return A standard system error code or FM tuner error (TFmRadioTunerError).
       
    68      */
       
    69     TInt GetCapabilities( TFmTunerCapabilities& aCaps ) const;
       
    70 
       
    71     /**
       
    72      * Enable tuner functions when the device is in offline mode. Client
       
    73      * should first check the capabilities to see if this feature is supported.
       
    74      * Tuner functions are disabled in offline mode by default.
       
    75      *
       
    76      * @since S60 3.2
       
    77      * @param aEnable ETrue to enable tuner functions in offline mode, EFalse to disable.
       
    78      * @return A standard system error code or FM tuner error (TFmRadioTunerError).
       
    79      */
       
    80     TInt EnableTunerInOfflineMode( TBool aEnable );
       
    81 
       
    82     /**
       
    83      * Asynchronous request to set the frequency range. User must be ready to receive
       
    84      * callback method MrftoSetFrequencyRangeComplete. If not set, it will be defaulted
       
    85      * to EFmRangeEuroAmerica.
       
    86      *
       
    87      * @since S60 3.2
       
    88      * @param aRange Frequency range
       
    89      */
       
    90     void SetFrequencyRange( TFmRadioFrequencyRange aRange );
       
    91 
       
    92     /**
       
    93      * Cancels an ongoing set frequency range operation, as initiated by a call to
       
    94      * SetFrequencyRange. The usual callback will not occur if this has been called.
       
    95      *
       
    96      * Has not effect if no set frequency range operation is ongoing.
       
    97      *
       
    98      * @since S60 3.2
       
    99      */
       
   100     void CancelSetFrequencyRange();
       
   101 
       
   102     /**
       
   103      * Get the current frequency range. It also returns the minimum and maximum frequencies (Hz)
       
   104      * for the returned range. Client should always use the minimum and maximum frequencies returned
       
   105      * by the tuner device, since it may vary slightly depending on the hardware.
       
   106      *
       
   107      * @since S60 3.2
       
   108      * @param aRange On return contains the current frequency range.
       
   109      * @param aMinFreq On return contains the minimum frequency for the current frequency range.
       
   110      * @param aMaxFreq On return contains the maximum frequency for the current frequency range.
       
   111      * @return A standard system error code or FM tuner error (TFmRadioTunerError).
       
   112      */
       
   113     TInt GetFrequencyRange( TFmRadioFrequencyRange& aRange, TInt& aMinFreq, TInt& aMaxFreq ) const;
       
   114 
       
   115     /**
       
   116      * Asynchronous request to tune the tuner to the speficied frequency (Hz). User must be
       
   117      * ready to receive callback method MrftoTuneComplete.
       
   118      *
       
   119      * @since S60 3.2
       
   120      * @param aFrequency The frequency to tune to
       
   121      * @see MRadioFmTunerObserver::MrftoTuneComplete
       
   122      */
       
   123     void SetFrequency( TInt aFrequency );
       
   124 
       
   125     /**
       
   126      * Cancels an ongoing tune operation, as initiated by a call to Tune.
       
   127      * The usual callback will not occur if this has been called.
       
   128      *
       
   129      * Has not effect if no tune operation is ongoing.
       
   130      *
       
   131      * @since S60 3.2
       
   132      */
       
   133     void CancelSetFrequency();
       
   134 
       
   135     /**
       
   136      * Get the currently tuned frequency.
       
   137      *
       
   138      * @since S60 3.2
       
   139      * @param aFrequency On return contains the current frequency (Hz).
       
   140      * @return A standard system error code or FM tuner error (TFmRadioTunerError).
       
   141      */
       
   142     TInt GetFrequency( TInt& aFrequency ) const;
       
   143 
       
   144     /**
       
   145      * Asynchronous request to find a radio station, starting from the currently tuned frequency and
       
   146      * searching in the direction specified (i.e. up or down). User must be ready to receive callback
       
   147      * method MrftoSeekComplete. The station found is returned in the callback.
       
   148      *
       
   149      * If no station is found after a complete loop, seek will stop and return KErrNotfound
       
   150      * in the callback method and frequency will not change.
       
   151      *
       
   152      * @since S60 3.2
       
   153      * @param aUpwards The direction to search in. Searches upwards if set to ETrue.
       
   154      * @see MRadioFmTunerObserver::MrftoStationSeekComplete
       
   155      */
       
   156     void StationSeek( TBool aUpwards );
       
   157 
       
   158     /**
       
   159      * Cancels an ongoing station seek operation, as initiated by a call to StationSeek.
       
   160      * The usual callback will not occur if this has been called.
       
   161      *
       
   162      * Has not effect if no station seek operation is ongoing.
       
   163      *
       
   164      * @since S60 3.2
       
   165      */
       
   166     void CancelStationSeek();
       
   167 
       
   168     /**
       
   169      * Get the signal strenth of the currently tuned frequency.
       
   170      *
       
   171      * @since S60 3.2
       
   172      * @param aSignalStrength On return contains the signal strength.
       
   173      * @return A standard system error code or FM tuner error (TFmRadioTunerError).
       
   174      */
       
   175     TInt GetSignalStrength( TInt& aSignalStrength ) const;
       
   176 
       
   177     /**
       
   178      * Get the maximum possible signal strength of a tuned frequency.
       
   179      *
       
   180      * @since S60 3.2
       
   181      * @param aMaxSignalStrength On return contains the maximum signal strength.
       
   182      * @return A standard system error code or FM tuner error (TFmRadioTunerError).
       
   183      */
       
   184     TInt GetMaxSignalStrength( TInt& aMaxSignalStrength ) const;
       
   185 
       
   186     /**
       
   187      * Get the current frequency's stereo mode (stereo or mono).
       
   188      *
       
   189      * @since S60 3.2
       
   190      * @param aStereo On return, will be ETrue if a stereo signal is currently being received.
       
   191      * @return A standard system error code or FM tuner error (TFmRadioTunerError).
       
   192      */
       
   193     TInt GetStereoMode( TBool& aStereo ) const;
       
   194 
       
   195     /**
       
   196      * Indicates whether the reception should be forced into monophonic mode.
       
   197      *
       
   198      * @since S60 3.2
       
   199      * @param aMono If ETrue, all reception will be in mono mode even if a stereo signal
       
   200      *              is available. If EFalse, a stereo signal will be received when possible.
       
   201      * @return A standard system error code or FM tuner error (TFmRadioTunerError).
       
   202      */
       
   203     TInt ForceMonoReception( TBool aForcedMono );
       
   204 
       
   205     /**
       
   206      * Find out whether reception is forced into monophonic mode or not.
       
   207      *
       
   208      * @since S60 3.2
       
   209      * @param aForcedMono On return, will be ETrue if a forced mono is currently enabled.
       
   210      * @return A standard system error code or FM tuner error (TFmRadioTunerError).
       
   211      */
       
   212     TInt GetForcedMonoReception( TBool& aForcedMono ) const;
       
   213 
       
   214     /**
       
   215      * Set the current squleching (muting in frequencies without reception) setting.
       
   216      * Squelching is enabled by default.
       
   217      *
       
   218      * @since S60 3.2
       
   219      * @param aEnabled ETrue to enable squelching, EFalse to disable it.
       
   220      * @return A standard system error code or FM tuner error (TFmRadioTunerError).
       
   221      */
       
   222     TInt SetSquelch( TBool aSquelch );
       
   223 
       
   224     /**
       
   225      * Get the current squelching (muting in frequencies without reception) setting.
       
   226      *
       
   227      * @since S60 3.2
       
   228      * @param aSquelch On return, will be ETrue if a squelching is currently enabled.
       
   229      * @return A standard system error code or FM tuner error (TFmRadioTunerError).
       
   230      */
       
   231     TInt GetSquelch( TBool& aSquelch ) const;
       
   232 
       
   233 private:
       
   234 
       
   235     void ConstructL();
       
   236     CBody();
       
   237 
       
   238 private: // data
       
   239 
       
   240     // The radio server session
       
   241     RRadioSession* iRadioSession; // not own
       
   242     // Tuner utility observer
       
   243     MRadioFmTunerObserver* iRadioFmTunerUtilityClient; // not own
       
   244     };
       
   245 
       
   246 #endif  // C_RADIOFMTUNERUTILITY_H
       
   247 
       
   248 // End of File