radioengine/engine/inc/cradiordsreceiverbase.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 CRADIORDSRECEIVERBASE_H
       
    19 #define CRADIORDSRECEIVERBASE_H
       
    20 
       
    21 // System includes
       
    22 #include <RadioRdsUtility.h>
       
    23 
       
    24 // User includes
       
    25 #include "mradioenginesettings.h"
       
    26 #include "mradiordsdataobserver.h"
       
    27 #include "mradiordsreceiver.h"
       
    28 
       
    29 // Forward declarations
       
    30 class CRadioUtility;
       
    31 
       
    32 // Class declaration
       
    33 NONSHARABLE_CLASS( CRadioRdsReceiverBase ) : public CBase
       
    34                                            , public MRadioRdsReceiver
       
    35                                            , public MRadioRdsObserver
       
    36     {
       
    37 public:
       
    38 
       
    39     /**
       
    40      * The destructor
       
    41      */
       
    42     virtual ~CRadioRdsReceiverBase();
       
    43 
       
    44     /**
       
    45      * Adds an observer wich will be notified of the new RDS data
       
    46      * If observer already exists, it is not added
       
    47      *
       
    48      * @param aObserver pointer of the observer instance.
       
    49      */
       
    50     void AddObserverL( MRadioRdsDataObserver* aObserver );
       
    51 
       
    52     /**
       
    53      * Removes the rds observer.
       
    54      */
       
    55     void RemoveObserver( MRadioRdsDataObserver* aObserver );
       
    56 
       
    57     /**
       
    58      * Getter for automatic switching state of alternate frequencies
       
    59      *
       
    60      * @return ETrue if automatic switching is enabled
       
    61      */
       
    62     TBool AutomaticSwitchingEnabled() const;
       
    63 
       
    64     /**
       
    65      * Getter for the programme service name
       
    66      *
       
    67      * @return Programme service name
       
    68      */
       
    69     const TDesC& ProgrammeService() const;
       
    70 
       
    71     /**
       
    72      * Getter for the radio text.
       
    73      *
       
    74      * @return Radio text.
       
    75      */
       
    76     const TDesC& RadioText() const;
       
    77 
       
    78     /**
       
    79      * Getter for the RDS signal availability
       
    80      *
       
    81      * @return ETrue if RDS signal is available, otherwise EFalse
       
    82      */
       
    83     TBool SignalAvailable() const;
       
    84 
       
    85     /**
       
    86      * Setter for automatic switching of alternate frequencies
       
    87      * If this method is overridden, the base implementation should be called
       
    88      *
       
    89      * @param aEnable ETrue, if automatic swithing is to be enabled
       
    90      */
       
    91     virtual void SetAutomaticSwitchingL( TBool aEnable );
       
    92 
       
    93     /**
       
    94      * Clears the RDS information
       
    95      */
       
    96     void ClearRdsInformation();
       
    97 
       
    98 protected:
       
    99 
       
   100     CRadioRdsReceiverBase( MRadioEngineSettings& aSettings );
       
   101 
       
   102     void BaseConstructL();
       
   103 
       
   104 // from base class MRadioRdsObserver
       
   105 
       
   106     void MrroStationSeekByPTYComplete( TInt aError, TInt aFrequency );
       
   107     void MrroStationSeekByTAComplete( TInt aError, TInt aFrequency );
       
   108     void MrroStationSeekByTPComplete( TInt aError, TInt aFrequency );
       
   109     void MrroGetFreqByPTYComplete( TInt aError, RArray<TInt>& aFreqList );
       
   110     void MrroGetFreqByTAComplete( TInt aError, RArray<TInt>& aFreqList );
       
   111     void MrroGetPSByPTYComplete( TInt aError, RArray<TRdsPSName>& aPsList );
       
   112     void MrroGetPSByTAComplete( TInt aError, RArray<TRdsPSName>& aPsList );
       
   113     void MrroRdsDataPI( TInt aPi );
       
   114     void MrroRdsDataPTY( TRdsProgrammeType aPty );
       
   115     void MrroRdsDataPS( TRdsPSName& aPs );
       
   116     void MrroRdsDataRT( TRdsRadioText& aRt );
       
   117     void MrroRdsDataCT( TDateTime& aCt );
       
   118     void MrroRdsDataTA( TBool aTaOn );
       
   119     void MrroRdsDataRTplus( TRdsRTplusClass aRtPlusClass, TRdsRadioText& aRtPlusData );
       
   120     void MrroRdsSearchBeginAF();
       
   121     void MrroRdsSearchEndAF( TInt aError, TInt aFrequency );
       
   122     void MrroRdsStationChangeTA( TInt aFrequency );
       
   123     void MrroRdsEventAutomaticSwitchingChange( TBool aAuto );
       
   124     void MrroRdsEventAutomaticTrafficAnnouncement( TBool aAuto );
       
   125     void MrroRdsEventSignalChange( TBool aSignal );
       
   126 
       
   127 protected: // data
       
   128 
       
   129     /**
       
   130      * The radio settings
       
   131      */
       
   132     MRadioEngineSettings&               iSettings;
       
   133 
       
   134 private: // data
       
   135 
       
   136     /**
       
   137      * Array of RDS observers.
       
   138      */
       
   139     RPointerArray<MRadioRdsDataObserver> iObservers;
       
   140 
       
   141     /**
       
   142      * The programme service name cache.
       
   143      * Own.
       
   144      */
       
   145     HBufC*                              iPsName;
       
   146 
       
   147     /**
       
   148      * The RDS radio text
       
   149      * Own.
       
   150      */
       
   151     RBuf                                iRadioText;
       
   152 
       
   153     /**
       
   154      * ETrue if the RDS signal is available
       
   155      */
       
   156     TBool                               iSignalAvailable;
       
   157 
       
   158     /**
       
   159      * ETrue if AF is enabled
       
   160      */
       
   161     TBool                               iAfEnabled;
       
   162 
       
   163     };
       
   164 
       
   165 #endif // CRADIORDSRECEIVERBASE_H