resourceinterfaces/fmtransmittercontrol/inc/HWRMFmTxFrequencyObserver.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2006-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 
       
    19 
       
    20 #ifndef HWRMFMTXFREQUENCYOBSERVER_H
       
    21 #define HWRMFMTXFREQUENCYOBSERVER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <cenrepnotifyhandler.h>
       
    26 #include <centralrepository.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MHWRMFmTxObserver;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 *  This class observes the FM Tx frequency
       
    35 *
       
    36 */
       
    37 NONSHARABLE_CLASS(CHWRMFmTxFrequencyObserver): public CBase,
       
    38                                    public MCenRepNotifyHandlerCallback
       
    39     {
       
    40     public: // Constructors and Destructor
       
    41     
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         */
       
    45         static CHWRMFmTxFrequencyObserver* NewL(MHWRMFmTxObserver* aCallback);
       
    46         
       
    47         /**
       
    48         * Destructor.
       
    49         */
       
    50         virtual ~CHWRMFmTxFrequencyObserver();
       
    51         
       
    52     public: // New functions
       
    53     
       
    54         /**
       
    55         * This method retrieves the current FM Tx state. 
       
    56         *
       
    57         * @return TInt indicating the current FM Tx frequency.
       
    58         */
       
    59         TInt Frequency() const;    
       
    60     
       
    61         /**
       
    62         * This method retrieves the minimum FM Tx frequency
       
    63         *
       
    64         * @return TInt The lower boundary of the FM range (kHz)
       
    65         */
       
    66         TInt MinFrequency() const; 
       
    67 
       
    68         /**
       
    69         * This method retrieves the maximum FM Tx frequency
       
    70         *
       
    71         * @return TInt The upper boundary of the FM range (kHz)
       
    72         */
       
    73         TInt MaxFrequency() const; 
       
    74 
       
    75         /**
       
    76         * This method retrieves the FM Tx frequency step size
       
    77         *
       
    78         * @return TInt The step size (kHz) 
       
    79         */
       
    80         TInt StepSize() const; 
       
    81         
       
    82         /**
       
    83         * This method queries whether the frequency range has been updated.
       
    84         * Initially CenRep does not contain valid frequency range settings.
       
    85         *
       
    86         * @return TBool ETrue if frequency range has been updated.
       
    87         */
       
    88         TBool FrequencyRangeUpdated() const;
       
    89 
       
    90     public: // Functions from base classes
       
    91 
       
    92         // From MCenRepNotifyHandlerCallback
       
    93         void HandleNotifyInt(TUint32 aId, TInt aNewValue);
       
    94         void HandleNotifyError(TUint32 aId, TInt error, CCenRepNotifyHandler* aHandler);
       
    95 
       
    96     private:
       
    97     
       
    98         /**
       
    99         * C++ default constructor.
       
   100         */
       
   101         CHWRMFmTxFrequencyObserver();
       
   102 
       
   103         /**
       
   104         * By default Symbian 2nd phase constructor is private.
       
   105         */
       
   106         void ConstructL(MHWRMFmTxObserver*  aCallback);        
       
   107 
       
   108     private:
       
   109     
       
   110         CRepository*          iRepository;          // Cenrep client
       
   111 
       
   112         // Cenrep notifications
       
   113         CCenRepNotifyHandler* iFreqNotify;
       
   114         CCenRepNotifyHandler* iMinFreqNotify;       
       
   115         CCenRepNotifyHandler* iMaxFreqNotify;
       
   116         CCenRepNotifyHandler* iStepSizeNotify;
       
   117         
       
   118         MHWRMFmTxObserver*    iCallback;            // Callback object for passing FM Tx frequency changes. Not owned
       
   119         TInt                  iFrequency;           // Current FM Tx frequency
       
   120         
       
   121         // FM frequency range
       
   122         TInt iMinFrequency;
       
   123         TInt iMaxFrequency;
       
   124         TInt iStepSize;
       
   125     };
       
   126 
       
   127 #endif  // HWRMFMTXFREQUENCYOBSERVER_H
       
   128             
       
   129 // End of File