tacticonserver/server/tacticonpluginfw/tacticonhapticsplugin/inc/tacticonhapticsplayer.h
changeset 0 d54f32e146dd
equal deleted inserted replaced
-1:000000000000 0:d54f32e146dd
       
     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: Class for producing haptics tacticon.
       
    15 * Part of:     Tacticon Server
       
    16 */
       
    17 
       
    18 #ifndef C_TACTICONHAPTICSPLAYER_H
       
    19 #define C_TACTICONHAPTICSPLAYER_H
       
    20 
       
    21 #include <cenrepnotifyhandler.h>
       
    22 #include <tacticon.hrh>
       
    23 
       
    24 #include "tacticonprivatecrkeys.h"
       
    25 #include "tacticonplayer.h"
       
    26 
       
    27 class CHWRMHaptics;
       
    28 
       
    29 /**
       
    30  *  Ecom plugin for playing haptics tacticons.
       
    31  *
       
    32  *  @lib tactilehapticsplugin.lib
       
    33  *  @since S60 5.2
       
    34   */
       
    35 
       
    36 NONSHARABLE_CLASS( CTacticonHapticsPlayer ): public CTacticonPlayer,
       
    37                                              public MCenRepNotifyHandlerCallback
       
    38     {
       
    39 public:
       
    40     /**
       
    41      * 2-phased constructor.
       
    42      * @return An instance of haptics tacticon player.
       
    43      */
       
    44     static CTacticonHapticsPlayer* NewL( CRepository& aRepository );
       
    45 
       
    46     /**
       
    47      * Destructor.
       
    48      */
       
    49     virtual ~CTacticonHapticsPlayer();
       
    50 
       
    51  // from base class CTacticonPlayer
       
    52 
       
    53     /**
       
    54     * Plays tacticon according to aTacticonType
       
    55     * @since S60 5.2 
       
    56     * @param aTacticonType, Tacticon type to be played
       
    57     */
       
    58     void PlayTacticon( TTacticonType aTacticonType ); 
       
    59     
       
    60     /**
       
    61     * Stops playing tacticon
       
    62     * @since S60 5.2 
       
    63     */    
       
    64     void StopTacticon(); 
       
    65         
       
    66 private: // From MCenRepNotifyHandlerCallback.
       
    67 
       
    68     void HandleNotifyGeneric( TUint32 aId );
       
    69 
       
    70 private:
       
    71     /**
       
    72      * Reads IVT data from file to buffer. 
       
    73      */    
       
    74     HBufC8* IVTBufAllocL( const TDesC& aFileName );
       
    75     
       
    76     /**
       
    77      * Change effect file in haptics instance.
       
    78      */        
       
    79     void ChangeIVTFileL( const TDesC& aFileName );
       
    80     
       
    81     /**
       
    82      * Handle Central Repository settings changes.
       
    83      */    
       
    84     void DoHandleNotifyGenericL( TUint32 aId );
       
    85 private:
       
    86 
       
    87     /**
       
    88      * Constructor.
       
    89      */
       
    90     CTacticonHapticsPlayer( CRepository& aRepository );
       
    91 
       
    92     /**
       
    93      * 2nd phase constructor.
       
    94      */
       
    95     void ConstructL();
       
    96     
       
    97 
       
    98 private: // data
       
    99 
       
   100     /**
       
   101      * Access to vibra functionality
       
   102      * Own.  
       
   103      */
       
   104     CHWRMHaptics* iHaptics;
       
   105 
       
   106     /**
       
   107      * Handle of effect file, which is loaded to haptics instance. 
       
   108      */
       
   109     TInt iIVTHandle;
       
   110     
       
   111     /**
       
   112      * Haptics strength.
       
   113      */
       
   114     TInt iStrength;
       
   115     
       
   116      /**
       
   117      * Access to settings.
       
   118      * Not own.
       
   119      */    
       
   120     CRepository& iRepository;
       
   121     
       
   122     /**
       
   123      * Utility for listening to changes in configurable parameters.
       
   124      * Own.  
       
   125      */
       
   126     CCenRepNotifyHandler* iCenRepNotifier;    
       
   127     
       
   128     };
       
   129 
       
   130 
       
   131 #endif // C_TACTICONHAPTICSPLAYER_H