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