resourcemgmt/hwresourcesmgr/common/inc/HWRMVibraProfileObserver.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 HWRMVIBRAPROFILEOBSERVER_H
       
    27 #define HWRMVIBRAPROFILEOBSERVER_H
       
    28 
       
    29 //  INCLUDES
       
    30 #include <e32base.h>
       
    31 #include <centralrepository.h>
       
    32 #include "cenrepobserver.h"
       
    33 #include "HWRMVibra.h"
       
    34 
       
    35 
       
    36 /**
       
    37 * Callback interface for vibra status change passing.
       
    38 */
       
    39 class MHWRMVibraProfileObserver
       
    40     {
       
    41     public:
       
    42     
       
    43         /**
       
    44         * Notifies vibra mode setting changes in profile
       
    45         *
       
    46         * @param aNewState the new state of setting.
       
    47         */
       
    48         virtual void VibraModeChange(CHWRMVibra::TVibraModeState aNewState)=0;
       
    49         
       
    50 		/**
       
    51         * Notifies feedback vibration mode setting changes in profile
       
    52         *
       
    53         * @param aNewState the new state of setting.
       
    54         */
       
    55         virtual void VibraFeedbackModeChange(CHWRMVibra::TVibraFeedbackModeState aNewState)=0;
       
    56 
       
    57     };
       
    58 
       
    59 /**
       
    60 *  This class observes vibration feature setting in device profile
       
    61 *
       
    62 */
       
    63 class CHWRMVibraProfileObserver : public CBase,
       
    64                                   public MCenRepObserver
       
    65     {
       
    66     public: // Constructors and Destructor
       
    67     
       
    68         /**
       
    69         * Two-phased constructor.
       
    70         */
       
    71         IMPORT_C static CHWRMVibraProfileObserver* NewL(MHWRMVibraProfileObserver*  aCallback);
       
    72         
       
    73         /**
       
    74         * Destructor.
       
    75         */
       
    76         IMPORT_C virtual ~CHWRMVibraProfileObserver();
       
    77         
       
    78     public: // New functions
       
    79     
       
    80         // Get the current vibra mode state
       
    81         IMPORT_C CHWRMVibra::TVibraModeState GetVibraModeState();
       
    82 		
       
    83 		// Get the current vibra feedback-mode state
       
    84 		IMPORT_C CHWRMVibra::TVibraFeedbackModeState GetVibraFeedbackModeState();
       
    85     
       
    86     public: // Functions from base classes
       
    87 
       
    88         // From MCenRepObserver
       
    89         void HandleNotifyInt(TUint32 aId, TInt aNewValue);
       
    90         void HandleNotifyError(TUint32 aId, TInt error, CCenRepListener* aHandler);
       
    91 
       
    92     private:
       
    93     
       
    94         /**
       
    95         * C++ default constructor.
       
    96         */
       
    97         CHWRMVibraProfileObserver();
       
    98 
       
    99         /**
       
   100         * By default Symbian 2nd phase constructor is private.
       
   101         */
       
   102         void ConstructL(MHWRMVibraProfileObserver*  aCallback);        
       
   103 
       
   104     private:
       
   105     
       
   106         CRepository*                iRepository;          	// Cenrep client
       
   107         CCenRepListener*       		iNotifyHandler;       	// Cenrep notifyhandler
       
   108         CCenRepListener*       		iFeedbackNotifyHandler; // Cenrep notifyhandler
       
   109         MHWRMVibraProfileObserver*  iCallback;            	// Callback object for passing vibra mode changes. Not owned
       
   110     };
       
   111 
       
   112 
       
   113 
       
   114 #endif  // HWRMVIBRAPROFILEOBSERVER_H
       
   115             
       
   116 // End of File