systemswstubs/hwrmstubplugins/inc/LightPlugin.h
changeset 39 65e91466a14b
parent 31 931072794a66
child 40 b7e5ed8c1342
equal deleted inserted replaced
31:931072794a66 39:65e91466a14b
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  Hardware Resource Manager stub plugins Light plugin header
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __LIGHTPLUGIN_H_
       
    20 #define __LIGHTPLUGIN_H_
       
    21 
       
    22 #include <hwrmpluginservice.h>
       
    23 #include "PluginTimer.h"
       
    24 
       
    25 #ifdef PUBLISH_STATE_INFO
       
    26 #include <e32property.h>
       
    27 #include <HWRMLight.h>
       
    28 
       
    29 // Each target has own set of these two keys
       
    30 // Bytes 2-4 contain target  >-----------------------vvv
       
    31 const TUint32 KHWRMTestLightCommand             = 0x00000001;
       
    32 const TUint32 KHWRMTestLightDataPckg            = 0x00000002;
       
    33 
       
    34 const TUint32 KHWRMTestLightIntensityValue      = 0x10000007;
       
    35 const TUint32 KHWRMTestLightSensitivityValue    = 0x10000008;
       
    36 
       
    37 const TInt KHWRMLightMaxTargets(4);   
       
    38 #endif // PUBLISH_STATE_INFO
       
    39 
       
    40 class CPluginTimer;
       
    41 
       
    42 class CLightPlugin : public CHWRMPluginService,
       
    43                      public MPluginTimerCallback
       
    44     {
       
    45     public:
       
    46 
       
    47         static CLightPlugin* NewL();
       
    48         virtual ~CLightPlugin();
       
    49 
       
    50         /**
       
    51         * Method to invoke a particular command in the plugin
       
    52         * @param aCommandId Command ID
       
    53         * @param aTransId   Transaction ID
       
    54         * @param aData      Data associated with command
       
    55         */
       
    56         virtual void ProcessCommandL( const TInt aCommandId,
       
    57                                       const TUint8 aTransId,
       
    58                                       TDesC8& aData );
       
    59 
       
    60         /**
       
    61         * Method to cancel a particular command
       
    62         * @param aTransId   Transaction ID
       
    63         * @param aCommandId Command ID to optionally double check with the 
       
    64         *                   transaction ID
       
    65         */
       
    66         virtual void CancelCommandL( const TUint8 aTransId, 
       
    67                                      const TInt aCommandId);
       
    68 
       
    69         // From MPluginTimerCallback
       
    70         void GenericTimerFired(MHWRMPluginCallback* aService,
       
    71                          const TInt aCommandId,
       
    72                          const TUint8 aTransId,
       
    73                          TInt aRetVal);
       
    74 
       
    75     private: // Construction
       
    76 
       
    77         CLightPlugin();
       
    78         void ConstructL();
       
    79 
       
    80         RPointerArray<CPluginTimer> iTimers;
       
    81         
       
    82 #ifdef PUBLISH_STATE_INFO
       
    83         void PublishStateInfo(TInt aTargetMask,
       
    84                               const TInt aCommandId,
       
    85                               TDesC8& aData );
       
    86         RProperty iCmdProperty[KHWRMLightMaxTargets];   // for publishing command ID
       
    87         RProperty iDataProperty[KHWRMLightMaxTargets];  // for publishing data
       
    88         RProperty iIntensityProperty;
       
    89         RProperty iSensitivityProperty;
       
    90         TInt      iDefaultIntensity;
       
    91 #endif // PUBLISH_STATE_INFO        
       
    92 
       
    93         
       
    94     };
       
    95 
       
    96 #endif // __LIGHTPLUGIN_H_