remotelock/RemoteLockEngine/Inc/RLLockObserver.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     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:  The header file of unlocking event observer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef     RLLOCKOBSERVER_H
       
    20 #define     RLLOCKOBSERVER_H
       
    21 
       
    22 #include    <e32base.h>
       
    23 #include    <e32property.h>
       
    24 
       
    25 // CONSTANTS 
       
    26 
       
    27 // MACROS 
       
    28 
       
    29 // FORWARD DECLARATIONS 
       
    30 class MRLLockObserverHandler;
       
    31 
       
    32 // LOCAL FUNCTION PROTOTYPES 
       
    33 
       
    34 // MEMBER FUNCTIONS 
       
    35 
       
    36 
       
    37 // CLASS DECLARATION
       
    38 /**
       
    39 * Observe the unlocking event
       
    40 *
       
    41 * @since S60 3.2
       
    42 */
       
    43 class CRLLockObserver: public CActive
       
    44     {
       
    45     public:
       
    46        /**
       
    47         * Two-Phased constructor
       
    48         *
       
    49         * @since S60 3.2
       
    50         * @param aHandler Client implemented observer handler that will be
       
    51         *                 called when phone are unlocked. 
       
    52         * @return
       
    53         */
       
    54         static CRLLockObserver* NewL( MRLLockObserverHandler* aHandler );
       
    55     
       
    56         ~CRLLockObserver();    
       
    57     
       
    58     private:
       
    59     
       
    60         /**
       
    61         * Starts asynchronic listening 
       
    62         * KCoreAppUIsAutolockStatus/
       
    63         * KPSUidAutolockStatusValue event
       
    64         *
       
    65         * @Since S60 3.2
       
    66         * @return KErrNone: if no errors
       
    67         *         KErrInUse: if already listening
       
    68         */
       
    69         TInt Start();            
       
    70     
       
    71     private: 
       
    72 
       
    73         CRLLockObserver( MRLLockObserverHandler* aHandler );
       
    74         
       
    75         void ConstructL();
       
    76         
       
    77     private: // from CActive
       
    78          
       
    79         void RunL();
       
    80     
       
    81         void DoCancel();
       
    82         
       
    83     private: // data
       
    84     
       
    85         RProperty                iProperty;
       
    86         MRLLockObserverHandler*  iHandler; //not owned
       
    87     };
       
    88 
       
    89 // CLASS DECLARATION
       
    90 
       
    91 /**
       
    92 * Abstract interface class declares a callback function for 
       
    93 * remotelock observer to call when the phone is unlocked. User
       
    94 * derives his class from this and implements HandleUnlockEvent().
       
    95 *
       
    96 * @since S60 3.2
       
    97 */
       
    98 class MRLLockObserverHandler 
       
    99     {
       
   100     public:
       
   101     
       
   102     /**
       
   103     * The function is called when the phone is unlocked.
       
   104     *
       
   105     * @since S60 3.2
       
   106     */
       
   107     virtual void HandleUnlockEvent() = 0;
       
   108     };
       
   109 
       
   110 #endif //RLLOCKOBSERVER_H
       
   111 // End of file