resourceinterfaces/fmtransmittercontrol/inc/HWRMFmTxStatusObserver.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 HWRMFMTXSTATUSOBSERVER_H
       
    21 #define HWRMFMTXSTATUSOBSERVER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <hwrm/hwrmfmtx.h>
       
    26 #include <e32property.h>
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 * Active object wrapper for Publish and Subscribe one-shot notification handling.
       
    32 * Listens for changes in FM Tx status and notifies the client.
       
    33 */
       
    34 NONSHARABLE_CLASS(CHWRMFmTxStatusObserver) : public CActive
       
    35     {
       
    36     public:
       
    37 
       
    38         /**
       
    39         * This is a two-phase constructor method that is used to
       
    40         * create a new instance of CHWRMFmTxStatusObserver.
       
    41         * A newly created instance immediately starts listening to FM Tx status changes.
       
    42         *
       
    43         * @param aCallback Pointer to a callback instance. Can be NULL.
       
    44         * @return A pointer to a new instance of the CHWRMFmTxStatusObserver class.
       
    45         */
       
    46         static CHWRMFmTxStatusObserver* NewL(MHWRMFmTxObserver* aCallback);
       
    47 
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         virtual ~CHWRMFmTxStatusObserver();
       
    52         
       
    53         /**
       
    54         * This method retrieves the current FM Tx state. 
       
    55         *
       
    56         * @return TFMTxState indicating the current FM Tx state.
       
    57         */
       
    58         TFmTxState Status();
       
    59 
       
    60     protected:
       
    61 
       
    62         // From CActive
       
    63         void RunL();
       
    64         TInt RunError(TInt aError);
       
    65         void DoCancel();
       
    66 
       
    67     private:
       
    68 
       
    69         /**
       
    70         * Constructor
       
    71         *
       
    72         * @param aCallback Pointer to a callback instance.
       
    73         */
       
    74         CHWRMFmTxStatusObserver(MHWRMFmTxObserver* aCallback);
       
    75                                                    
       
    76         /**
       
    77         * By default Symbian 2nd phase constructor is private.
       
    78         */
       
    79         void ConstructL();
       
    80 
       
    81         /*
       
    82         * Order notification
       
    83         */
       
    84         void OrderNotification();
       
    85 
       
    86     private:
       
    87         
       
    88         MHWRMFmTxObserver* iCallback;      // Not owned by this class. Can be NULL.
       
    89         RProperty iProperty;               // P&S property
       
    90         
       
    91         TFmTxState iFmTxState; // Keeps track of last received status value
       
    92     };
       
    93 
       
    94 #endif      // HWRMFMTXSTATUSOBSERVER_H
       
    95 
       
    96 // End of File