remotelock/RemoteLockEngine/Inc/RLLockObserver.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 26 Jan 2010 15:20:08 +0200
changeset 0 164170e6151a
permissions -rw-r--r--
Revision: 201004

/*
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  The header file of unlocking event observer
*
*/


#ifndef     RLLOCKOBSERVER_H
#define     RLLOCKOBSERVER_H

#include    <e32base.h>
#include    <e32property.h>

// CONSTANTS 

// MACROS 

// FORWARD DECLARATIONS 
class MRLLockObserverHandler;

// LOCAL FUNCTION PROTOTYPES 

// MEMBER FUNCTIONS 


// CLASS DECLARATION
/**
* Observe the unlocking event
*
* @since S60 3.2
*/
class CRLLockObserver: public CActive
    {
    public:
       /**
        * Two-Phased constructor
        *
        * @since S60 3.2
        * @param aHandler Client implemented observer handler that will be
        *                 called when phone are unlocked. 
        * @return
        */
        static CRLLockObserver* NewL( MRLLockObserverHandler* aHandler );
    
        ~CRLLockObserver();    
    
    private:
    
        /**
        * Starts asynchronic listening 
        * KCoreAppUIsAutolockStatus/
        * KPSUidAutolockStatusValue event
        *
        * @Since S60 3.2
        * @return KErrNone: if no errors
        *         KErrInUse: if already listening
        */
        TInt Start();            
    
    private: 

        CRLLockObserver( MRLLockObserverHandler* aHandler );
        
        void ConstructL();
        
    private: // from CActive
         
        void RunL();
    
        void DoCancel();
        
    private: // data
    
        RProperty                iProperty;
        MRLLockObserverHandler*  iHandler; //not owned
    };

// CLASS DECLARATION

/**
* Abstract interface class declares a callback function for 
* remotelock observer to call when the phone is unlocked. User
* derives his class from this and implements HandleUnlockEvent().
*
* @since S60 3.2
*/
class MRLLockObserverHandler 
    {
    public:
    
    /**
    * The function is called when the phone is unlocked.
    *
    * @since S60 3.2
    */
    virtual void HandleUnlockEvent() = 0;
    };

#endif //RLLOCKOBSERVER_H
// End of file