secsrv_plat/devicelock_access_api/inc/devicelockaccessapi.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:  Interface to access devicelock.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __DEVICELOCKACCESSAPI_H__
       
    20 #define __DEVICELOCKACCESSAPI_H__
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class RLockAccessExtension;
       
    25 
       
    26 /**
       
    27  *  Three possible reason for devicelock: manual, remote, timer
       
    28  *
       
    29  *  @lib   lockapp
       
    30  *  @since 5.0
       
    31  */
       
    32 enum TDevicelockReason
       
    33     {
       
    34     EDevicelockManual = 1,
       
    35     EDevicelockRemote
       
    36     };
       
    37 
       
    38 /**
       
    39  *  RDevicelockAccessApi class.
       
    40  *  Client used to access/configure devicelock features.
       
    41  *
       
    42  *  @lib   lockapp
       
    43  *  @since 5.0
       
    44  */
       
    45 class CDevicelockAccessApi : public CBase
       
    46     {
       
    47     public:
       
    48 
       
    49         /**
       
    50          * Two-phased constructor.
       
    51          */
       
    52         IMPORT_C static CDevicelockAccessApi* NewL( );
       
    53 
       
    54         /**
       
    55          * Destructor.
       
    56          */
       
    57         IMPORT_C ~CDevicelockAccessApi( );
       
    58 
       
    59     private:
       
    60 
       
    61         /**
       
    62          * Constructor for performing 1st stage construction
       
    63          */
       
    64         CDevicelockAccessApi( );
       
    65 
       
    66         /**
       
    67          * Default constructor for performing 2nd stage construction
       
    68          */
       
    69         void ConstructL( );
       
    70 
       
    71     public:
       
    72 
       
    73         /**
       
    74          * Returns true if phone is keys are locked. Both keyguard
       
    75          * and devicelock cannot be simultaneously enabled.
       
    76          * @return ETrue if either keyguard or devicelock is enabled.
       
    77          */
       
    78         IMPORT_C TBool IsKeylockEnabled( );
       
    79 
       
    80         /**
       
    81          * Has devicelock been activated.
       
    82          * @return ETrue if devicelock is enabled.
       
    83          */
       
    84         IMPORT_C TBool IsDevicelockEnabled( );
       
    85 
       
    86         /**
       
    87          * Enable devicelock.
       
    88          * @return KErrNone if succeeded
       
    89          *         KErrAlreadyExists if already enabled
       
    90          *         KErrPermissionDenied if no required capabilities
       
    91          */
       
    92         IMPORT_C TInt EnableDevicelock( TDevicelockReason aReason = EDevicelockManual );
       
    93 
       
    94         /**
       
    95          * Currently not implemented !
       
    96          * Offer to enable devicelock. Shows a query note to user.
       
    97          */
       
    98         IMPORT_C TInt OfferDevicelock( );
       
    99 
       
   100         /**
       
   101          * Remove this method eventually!
       
   102          *
       
   103          * Disable devicelock.
       
   104          * @return KErrNone if succeeded
       
   105          *         KErrAlreadyExists if already enabled
       
   106          *         KErrPermissionDenied if no required capabilities
       
   107          */
       
   108         IMPORT_C TInt DisableDevicelock( );
       
   109 
       
   110     private:
       
   111 
       
   112         RLockAccessExtension* iLockAccessExtension;
       
   113 
       
   114     };
       
   115 
       
   116 #endif // __DEVICELOCKACCESSAPI_H__