browserplugins/browseraudiovideoplugin/inc/BavpHwKeyEvents.h
branchRCL_3
changeset 65 8e6fa1719340
parent 0 84ad3b177aa3
equal deleted inserted replaced
64:6385c4c93049 65:8e6fa1719340
       
     1 /*
       
     2 * Copyright (c) 2006 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 the License "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 which implements handling Hardware Key events.
       
    15 *                This class implements methods of MRemConCoreApiTargetObserver
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef BAVPHWKEYEVENTS_H
       
    21 #define BAVPHWKEYEVENTS_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <RemConCoreApiTargetObserver.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CRemConInterfaceSelector;
       
    28 class CRemConCoreApiTarget;
       
    29 class MRemConCoreApiTargetObserver;
       
    30 
       
    31 // CONSTANTS
       
    32 
       
    33 // CLASS DECLARATION
       
    34 /**
       
    35 *  MBavpHwKeyEventsObserver class for hardware key events
       
    36 *  This class implements methods of MRemConCoreApiTargetObserver
       
    37 *  @lib npBrowserVideoPlugin.lib
       
    38 *  @since 3.2
       
    39 */
       
    40 class MBavpHwKeyEventsObserver
       
    41     {
       
    42     public:
       
    43         /**
       
    44         * Called when volume level should be changed.
       
    45         * @since 3.2
       
    46     	* @param aVolumeChange: +1 change volume up
       
    47         *                       -1 change volume down
       
    48         * @return void
       
    49         */
       
    50         virtual void BavpHwKeyVolumeChange( TInt aVolumeChange ) = 0;
       
    51 
       
    52         /**
       
    53         * Called when a media hardware key (play, pause...) was presed.
       
    54         * @since 3.2
       
    55     	* @param aCommand: Command ID representing Play, Pause, ...
       
    56         * @return void
       
    57         */
       
    58         // Incr15 SCO item that was cancelled.
       
    59         // virtual void BavpHwKeyCommand( TBavpCommandIds aCommand ) = 0;
       
    60     };
       
    61     
       
    62 /**
       
    63 *  CBavpHwKeyEvents class to handle Side Volume Key events
       
    64 *  @lib npBrowserVideoPlugin.lib
       
    65 *  @since 3.2
       
    66 */
       
    67 class CBavpHwKeyEvents : public CBase,
       
    68 					     public MRemConCoreApiTargetObserver
       
    69     {
       
    70     public: // Constructors and destructor
       
    71 
       
    72         /**
       
    73         * Symbian constructor
       
    74         * @param aObserver observer to implement callback functions
       
    75         */
       
    76         static CBavpHwKeyEvents* NewL( MBavpHwKeyEventsObserver& aObserver );
       
    77 
       
    78         /**
       
    79         * Destructor.
       
    80         */
       
    81         ~CBavpHwKeyEvents();
       
    82 
       
    83     private: // Constructors and destructor
       
    84 
       
    85     	/**
       
    86     	* Default constructor.
       
    87         * @since 3.2
       
    88         */
       
    89         CBavpHwKeyEvents( MBavpHwKeyEventsObserver& aObserver );
       
    90 
       
    91         /**
       
    92         * Constructor.
       
    93         * @since 3.2
       
    94         */
       
    95          void ConstructL();
       
    96          
       
    97     protected: // From MRemConCoreApiTargetObserver
       
    98     
       
    99 		/* Handles hardware key events
       
   100         * @since 3.2
       
   101     	*/
       
   102     	void MrccatoCommand( TRemConCoreApiOperationId aOperationId, 
       
   103     	 					 TRemConCoreApiButtonAction aButtonAct );
       
   104 
       
   105     private:
       
   106 
       
   107         /**
       
   108         * Change volume depending on the level of increase or decrease
       
   109         * @since 3.2
       
   110         */
       
   111         void DoChangeVolume( );
       
   112 
       
   113         /**
       
   114         * VolumeTimerCallback is the callback function called from change volume timer.
       
   115         * @since 3.2
       
   116         */
       
   117         static TInt VolumeTimerCallback( TAny* aThis );
       
   118 
       
   119     private:    // data
       
   120     
       
   121         MBavpHwKeyEventsObserver& iObserver;
       
   122         
       
   123         CRemConInterfaceSelector* iInterfaceSelector;
       
   124         
       
   125         CRemConCoreApiTarget* iCoreTarget;
       
   126         
       
   127         CPeriodic* iVolumeTimer;
       
   128             
       
   129         // Indicates size of volume level change
       
   130         TInt iChange;
       
   131         };
       
   132 
       
   133 #endif // BAVPHWKEYEVENTS_H
       
   134 
       
   135 // End of File