securitydialogs/lockapp/inc/lockappecsdetector.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Provides emergency call support for keyguard/devicelock
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __LOCKAPPSTATEDETECTOR_H__
       
    20 #define __LOCKAPPSTATEDETECTOR_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include "lockappstateobserver.h"
       
    24 #include <AknEcs.h> // MAknEcsObserver and CAknEcsDetector
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CLockAppEcsNote;
       
    28 
       
    29 /**
       
    30  *  CLockAppEcsDetector class owns emergency note and emergency detector.
       
    31  *  Taps directly to AppUi windowserver event source for receiving key events.
       
    32  *  If user presses emergency numbers defined in SIM, emergency note is shown.
       
    33  *  Only works when keyguard or devicelock is activated.
       
    34  *
       
    35  *  @lib    lockapp
       
    36  *  @since  5.0
       
    37  *  @author Joona Petrell
       
    38  *  @author Tamas Koteles
       
    39  */
       
    40 class CLockAppEcsDetector : public CBase, public MLockAppStateObserver, public MAknEcsObserver
       
    41     {
       
    42     public:
       
    43 
       
    44         /**
       
    45          * Two-phased constructor.
       
    46          */
       
    47         static CLockAppEcsDetector* NewL( );
       
    48 
       
    49         /**
       
    50          * Destructor
       
    51          */
       
    52         ~CLockAppEcsDetector( );
       
    53 
       
    54     private:
       
    55 
       
    56         /**
       
    57          * C++ default constructor.
       
    58          */
       
    59         CLockAppEcsDetector( );
       
    60 
       
    61         /**
       
    62          * Second constructor that can fail (leave).
       
    63          */
       
    64         void ConstructL( );
       
    65 
       
    66     public:
       
    67 
       
    68         /**
       
    69          * From @c CLockAppStateObserver. Method handles the lock state changes.
       
    70          *
       
    71          * @param aLockStatus The new lock state
       
    72          */
       
    73         virtual void HandleLockStatusChangedL( TLockStatus aLockStatus );
       
    74 
       
    75     private:
       
    76 
       
    77         /**
       
    78          * From @c MAknEcsObserver. Handles changes in emergency call detector.
       
    79          * @param aEcsDetector a pointer to ecsdetector component
       
    80          * @param aState the new emergency detector state.
       
    81          */
       
    82         void HandleEcsEvent( CAknEcsDetector* aEcsDetector, CAknEcsDetector::TState aState );
       
    83 
       
    84     public:
       
    85 
       
    86         /**
       
    87          * Emergency note is visible.
       
    88          *
       
    89          * @return true if emergency note is on the screen.
       
    90          */
       
    91         TBool EcsNoteOnScreen( ) const;
       
    92 
       
    93         /**
       
    94          * Internal Method only used for testing since emergency number
       
    95          * detection does not work in emulator.
       
    96          *
       
    97          * @return KErrNone if there were no problems
       
    98          */
       
    99         TInt TestEcsNote( );
       
   100 
       
   101     private:
       
   102 
       
   103         /**
       
   104          * Receives emergency number key events and handles emergency dialing.
       
   105          * Own.
       
   106          */
       
   107         CAknEcsDetector* iEcsDetector;
       
   108 
       
   109         /**
       
   110          * Emergency note to be shown when user has dialed emergency number.
       
   111          * Own.
       
   112          */
       
   113         CLockAppEcsNote* iEcsNote;
       
   114 
       
   115     };
       
   116 
       
   117 #endif // __LOCKAPPSTATEDETECTOR_H__
       
   118 // End of File
       
   119