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