resourcemgmt/hwresourcesmgr/vibra/inc/HWRMVibraStatusObserver.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2005-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 
       
    21 /**
       
    22  @file
       
    23  @internalTechnology 
       
    24 */
       
    25 
       
    26 #ifndef HWRMVIBRASTATUSOBSERVER_H
       
    27 #define HWRMVIBRASTATUSOBSERVER_H
       
    28 
       
    29 // INCLUDES
       
    30 #include <e32base.h>
       
    31 #include <hwrmvibra.h>
       
    32 #include <e32property.h>
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 // None
       
    36 
       
    37 /**
       
    38 * Active object wrapper for Publish and Subscribe one-shot notification handling.
       
    39 * Listens for changes in light status and notifies the client.
       
    40 *
       
    41 */
       
    42 NONSHARABLE_CLASS(CHWRMVibraStatusObserver) : public CActive
       
    43     {
       
    44     public:
       
    45 
       
    46         /**
       
    47         * This is a two-phase constructor method that is used to
       
    48         * create a new instance of CHWRMVibraStatusObserver.
       
    49         * A newly created instance immediately starts listening to vibra status changes.
       
    50         *
       
    51         * @param aCallback Pointer to a callback instance. Can be NULL.
       
    52         * @return          A pointer to a new instance of the CHWRMVibraStatusObserver class.
       
    53         */
       
    54         static CHWRMVibraStatusObserver* NewL(MHWRMVibraObserver* aCallback);
       
    55 
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         virtual ~CHWRMVibraStatusObserver();
       
    60 
       
    61         /**
       
    62         * This method retrieves the current vibra status. 
       
    63         *
       
    64         * @return TVibraStatus indicating the current vibra status
       
    65         */
       
    66         CHWRMVibra::TVibraStatus CurrentStatus() const;
       
    67 
       
    68     protected:
       
    69 
       
    70         // From CActive
       
    71         void RunL();
       
    72         void DoCancel();
       
    73 
       
    74     private:
       
    75 
       
    76         /**
       
    77         * Constructor
       
    78         *
       
    79         * @param aCallback Pointer to a callback instance.
       
    80         */
       
    81         CHWRMVibraStatusObserver(MHWRMVibraObserver* aCallback);
       
    82                                                    
       
    83         /**
       
    84         * By default Symbian 2nd phase constructor is private.
       
    85         */
       
    86         void ConstructL();
       
    87 
       
    88         /*
       
    89         * Order notification
       
    90         */
       
    91         void OrderNotification();
       
    92        
       
    93     private:
       
    94         
       
    95         MHWRMVibraObserver* iCallback;         // not owned by this class. Can be NULL.
       
    96         RProperty iProperty;                   // P&S property
       
    97         CHWRMVibra::TVibraStatus iVibraStatus; // stores status
       
    98     };
       
    99 
       
   100 #endif      // HWRMVIBRASTATUSOBSERVER_H
       
   101 
       
   102 // End of File