voiceui/vcommand/inc/headsetbuttonmonitor.h
changeset 0 bf1d17376201
equal deleted inserted replaced
-1:000000000000 0:bf1d17376201
       
     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 "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:  DOS Server Monitor Class is used to monitor Audio Accessorries,
       
    15 *                and encapsulate the interfaces with DOS Server.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CHeadsetButtonMonitor_H
       
    22 #define CHeadsetButtonMonitor_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <dossvrservices.h>
       
    26 #include <psvariables.h>		// Property values
       
    27 
       
    28 
       
    29 /**
       
    30 * DOS Server Monitor Class is used to monitor Audio Accessorries,
       
    31 * and encapsulate the interfaces with DOS Server.
       
    32 */
       
    33 class CVoiceProgressDialog;
       
    34 class CPlaybackVoiceDialog;
       
    35 class CHeadsetButtonMonitor : public CDosEventListenerBase
       
    36     {
       
    37     public: // Constructors and destructor
       
    38 
       
    39         /**
       
    40         * The CVoiceTagHeadsetButtonMonitor destructor
       
    41         * @param 
       
    42         * @return 
       
    43         */   
       
    44         virtual ~CHeadsetButtonMonitor();
       
    45 
       
    46 
       
    47         /**
       
    48         * 2nd phase CVoiceTagHeadsetButtonMonitor constructor
       
    49         * @param aObserver - an observer to be notified when the disruption occurred.
       
    50         * @return a pointer to the new CActiveClass0SMSMonitor object
       
    51         */   
       
    52         static CHeadsetButtonMonitor* NewLC();
       
    53 
       
    54 
       
    55         /**
       
    56         * 2nd phase CVoiceTagHeadsetButtonMonitor constructor
       
    57         * @param aObserver - an observer to be notified when the disruption occurred.
       
    58         * @return a pointer to the new CActiveClass0SMSMonitor object
       
    59         */   
       
    60         static CHeadsetButtonMonitor* NewL();
       
    61 
       
    62     public:
       
    63     
       
    64         /**
       
    65         * Method to handle the registration for Audio Accessories disruption monitor.
       
    66         * @param aDisruptionType - a disruption type to be monitored
       
    67         * @return - Symbian standard error response
       
    68         */   
       
    69         TInt ActivateMonitorL();
       
    70 
       
    71 
       
    72         /**
       
    73         * Method to handle the deregistration of monitoring class 0 SMS
       
    74         * @param aDisruptionType - a disruption type to be stopped monitoring
       
    75         * @return 
       
    76         */  
       
    77         TInt DeActivateMonitor();
       
    78 
       
    79         /**
       
    80         * Method to handle the deregistration of monitoring class 0 SMS
       
    81         * @param aDisruptionType - a disruption type to be stopped monitoring
       
    82         * @return 
       
    83         */  
       
    84         void Register(CVoiceProgressDialog* aProgressObserver,CPlaybackVoiceCommandDialog* aPlaybackObserver);
       
    85 
       
    86         /**
       
    87         * Method to handle the deregistration of monitoring class 0 SMS
       
    88         * @param aDisruptionType - a disruption type to be stopped monitoring
       
    89         * @return 
       
    90         */  
       
    91         void DeRegister(CVoiceProgressDialog* aProgressObserver,CPlaybackVoiceCommandDialog* aPlaybackObserver);
       
    92 
       
    93 
       
    94         /**
       
    95         * Method to cancel the monitoring operation from Dos Server
       
    96         * @param 
       
    97         * @return 
       
    98         */   
       
    99         void CancelMonitor();
       
   100 
       
   101     protected:
       
   102 
       
   103         /**
       
   104         * It notifies about a change in the status of the headset.
       
   105         * @param aStatus The new status.
       
   106         * @return void
       
   107         */ 
       
   108 		void HeadsetButtonChangedL(EPSButtonState aState);
       
   109 
       
   110         /**
       
   111         * Handles headset button down operation
       
   112         * @return void
       
   113         */
       
   114         void HandleButtonDown();
       
   115         
       
   116         /**
       
   117         * Handles head set button up operation
       
   118         * return void
       
   119         */
       
   120         void HandleButtonUp();
       
   121         
       
   122         /**
       
   123         * Handles head set button long press down operation
       
   124         * return void
       
   125         */
       
   126         void HandleButtonDownLong();
       
   127 
       
   128       private:
       
   129 
       
   130         /**
       
   131         * 2nd phase CVoiceTagHeadsetButtonMonitor constructor
       
   132         * @param 
       
   133         * @return 
       
   134         */   
       
   135         void ConstructL();
       
   136 
       
   137        /**
       
   138         * The CVoiceTagHeadsetButtonMonitor constructor
       
   139         * @param aObserver - an observer to be notified when the disruption occurred.
       
   140         * @return 
       
   141         */   
       
   142         CHeadsetButtonMonitor ();
       
   143 
       
   144     private: // data
       
   145 
       
   146         RDosServer                   iDosServerSession;
       
   147         CVoiceProgressDialog*        iProgressObserver;
       
   148         CPlaybackVoiceCommandDialog* iPlaybackObserver;
       
   149         TBool                        iButtonDown;
       
   150     };
       
   151 
       
   152 
       
   153 #endif // CHeadsetButtonMonitor_H
       
   154 
       
   155 
       
   156 // End of File