htiui/HtiServicePlugins/HtiSysInfoServicePlugin/inc/HtiLightsController.h
changeset 0 d6fe6244b863
child 3 2703485a934c
equal deleted inserted replaced
-1:000000000000 0:d6fe6244b863
       
     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:  For controlling S60 device lights.
       
    15 *                Helper for SysInfoServicePlugin.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef HTILIGHTSCONTROLLER_H
       
    21 #define HTILIGHTSCONTROLLER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <HWRMLight.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MHtiDispatcher;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 /**
       
    32 * For controlling S60 device lights. Helper class for SysInfoServicePlugin.
       
    33 */
       
    34 class CHtiLightsController : public CBase,
       
    35                              public MHWRMLightObserver
       
    36     {
       
    37 public:
       
    38 
       
    39     static CHtiLightsController* NewL( MHtiDispatcher* aDispatcher );
       
    40 
       
    41     /**
       
    42     * Called by the plugin when there is a message to be processed by
       
    43     * the lights controller.
       
    44     * @param aMessage message body destinated to the servive
       
    45     * @param aReply on return contains the reply message (OK response)
       
    46     */
       
    47     void ProcessMessageL( const TDesC8& aMessage, TDes8& aReply );
       
    48 
       
    49     ~CHtiLightsController();
       
    50 
       
    51     // from MHWRMLightObserver
       
    52     void LightStatusChanged( TInt aTarget,
       
    53                              CHWRMLight::TLightStatus aStatus );
       
    54 
       
    55 protected:
       
    56 
       
    57     CHtiLightsController( MHtiDispatcher* aDispatcher );
       
    58     void ConstructL();
       
    59 
       
    60 private: // private helper methods
       
    61 
       
    62     void HandleLightStatusL( const TDesC8& aMessage );
       
    63     void HandleLightOnL( const TDesC8& aMessage );
       
    64     void HandleLightOffL( const TDesC8& aMessage );
       
    65     void HandleLightBlinkL( const TDesC8& aMessage );
       
    66 
       
    67 
       
    68 private: // private data
       
    69 
       
    70     // The message dispatcher interface for dispatching error messages.
       
    71     MHtiDispatcher* iDispatcher;
       
    72 
       
    73     // The reply message to dispatch.
       
    74     TBuf8<4> iReply;
       
    75 
       
    76     // Light client session.
       
    77     CHWRMLight* iLight;
       
    78 
       
    79     // The latest command
       
    80     TInt iCommand;
       
    81 
       
    82     // The light target bitmask of latest call
       
    83     TInt iTarget;
       
    84 
       
    85     // The duration given in latest call
       
    86     TInt iDuration;
       
    87 
       
    88     // The lights on duration given in latest blink lights call
       
    89     TInt iOnDuration;
       
    90 
       
    91     // The lights off duration given in latest blink lights call
       
    92     TInt iOffDuration;
       
    93 
       
    94     // The intensity value of latest call
       
    95     TInt iIntensity;
       
    96 
       
    97     // The fade value of latest call
       
    98     TBool iFade;
       
    99     };
       
   100 
       
   101 #endif // HTILIGHTSCONTROLLER_H