terminalsecurity/SCP/SCPClient/inc/SCPLockObserver.h
changeset 0 b497e44ab2fc
child 2 5594fba90824
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2005 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: Obsererver for Set System Locked event 
       
    15 *
       
    16 */
       
    17 #ifndef     __SCPLOCKOBSERVER_H
       
    18 #define     __SCPLOCKOBSERVER_H
       
    19 
       
    20 #include <e32svr.h>
       
    21 #include <e32property.h>
       
    22 #include "SecUi.hrh"
       
    23 
       
    24  
       
    25 class CSCPQueryDialog;
       
    26 
       
    27 NONSHARABLE_CLASS(CSCPLockObserver): public CActive
       
    28     {
       
    29     public:
       
    30 		/**
       
    31         * Creates instance of the CLockObserver class.
       
    32         *
       
    33 		* @param aDialog (pointer to code dialog)
       
    34 		* @return Returns the instance just created.
       
    35         */
       
    36         static CSCPLockObserver* NewL(CSCPQueryDialog* aDialog, TInt aType  = ESecUiDeviceLockObserver);
       
    37 		/**
       
    38         * Destructor.
       
    39         */
       
    40 		~CSCPLockObserver();
       
    41 		/**
       
    42         * Stops listenig PubSub events.
       
    43         */
       
    44 		void StopObserver(); 
       
    45 		/**
       
    46         * Starts listenig PubSub events.
       
    47         */
       
    48 		void StartObserver();
       
    49 		/**
       
    50         * Sets the dialog's address.
       
    51         */
       
    52 		void SetAddress(CSCPQueryDialog* aDialog);    
       
    53 	private:
       
    54         /**
       
    55         * Starts asynchronic listening KUidAutolockStatus event
       
    56         *
       
    57 		* @return KErrNone: if no errors
       
    58         * @return KErrInUse: if already listening
       
    59 		*/
       
    60 		TInt Start();            
       
    61     private: // constructors
       
    62 		/**
       
    63         * C++ default constructor.
       
    64 		*
       
    65 		* @param aDialog (pointer to code dialog)
       
    66         */
       
    67         CSCPLockObserver(CSCPQueryDialog* aDialog, TInt aType);
       
    68 		 /**
       
    69         * Symbian OS constructor.
       
    70         */
       
    71         void ConstructL();
       
    72     private: // from CActive
       
    73          /** @see CActive::RunL() */
       
    74 		void RunL();
       
    75 		/** @see CActive::DoCancel() */
       
    76         void DoCancel();
       
    77     private: // data
       
    78         CSCPQueryDialog*      iDialog; //not owned!
       
    79         RProperty            iProperty;
       
    80         TBool				 iSubscribedToEvent;
       
    81         TInt                 iType; //Type of the observer
       
    82     };
       
    83 
       
    84 #endif 
       
    85 // End of file