|
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 keyguard. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __KEYGUARDACCESSAPI_H__ |
|
20 #define __KEYGUARDACCESSAPI_H__ |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class RLockAccessExtension; |
|
25 |
|
26 /** |
|
27 * RKeyguardAccessApi class. |
|
28 * Client used to access/configure keyguard features. |
|
29 * |
|
30 * @lib lockapp |
|
31 * @since 5.0 |
|
32 */ |
|
33 class CKeyguardAccessApi : public CBase |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 */ |
|
40 IMPORT_C static CKeyguardAccessApi* NewL( ); |
|
41 |
|
42 /** |
|
43 * Destructor. |
|
44 */ |
|
45 IMPORT_C ~CKeyguardAccessApi( ); |
|
46 |
|
47 private: |
|
48 |
|
49 /** |
|
50 * Constructor for performing 1st stage construction |
|
51 */ |
|
52 CKeyguardAccessApi( ); |
|
53 |
|
54 /** |
|
55 * Default constructor for performing 2nd stage construction |
|
56 */ |
|
57 void ConstructL( ); |
|
58 |
|
59 public: |
|
60 |
|
61 /** |
|
62 * Returns true if phone is keys are locked. Both keyguard |
|
63 * and devicelock cannot be simultaneously enabled. |
|
64 * @return true if either keyguard or devicelock is enabled. |
|
65 */ |
|
66 IMPORT_C TBool IsKeylockEnabled(); |
|
67 |
|
68 /** |
|
69 * Has keyguard been activated. |
|
70 * @return true if keyguard is enabled. |
|
71 */ |
|
72 IMPORT_C TBool IsKeyguardEnabled(); |
|
73 |
|
74 /** |
|
75 * Enable keyguard. Only works if devicelock is not enabled. |
|
76 * @param aWithNote should informing note be shown |
|
77 * @return KErrNone if succeeded |
|
78 * KErrAlreadyExists if already enabled |
|
79 * KErrPermissionDenied if devicelock is activated |
|
80 */ |
|
81 IMPORT_C TInt EnableKeyguard( TBool aWithNote ); |
|
82 |
|
83 /** |
|
84 * Disable keyguard. Only works if devicelock is not enabled. |
|
85 * @param aWithNote should informing note be shown |
|
86 * @return KErrNone if succeeded |
|
87 * KErrAlreadyExists if already disabled |
|
88 * KErrPermissionDenied if devicelock is activated |
|
89 */ |
|
90 IMPORT_C TInt DisableKeyguard( TBool aWithNote ); |
|
91 |
|
92 /** |
|
93 * Offer to enable keyguard. Shows a query note to user. |
|
94 * @return KErrNone if succeeded |
|
95 * KErrPermissionDenied if keyguard/devicelock already activated |
|
96 */ |
|
97 IMPORT_C TInt OfferKeyguard(); |
|
98 |
|
99 /** |
|
100 * Shows note informing that keys are locked. |
|
101 * Only works if keyguard is already enabled. |
|
102 * @return KErrNone if succeeded ' |
|
103 * KErrPermissionDenied if keyguard is not activated |
|
104 */ |
|
105 IMPORT_C TInt ShowKeysLockedNote(); |
|
106 |
|
107 |
|
108 /** |
|
109 * Test functions, return KErrNotSupported in release builds. |
|
110 */ |
|
111 IMPORT_C TInt TestInternal( ); |
|
112 |
|
113 IMPORT_C TInt TestDestruct( ); |
|
114 |
|
115 IMPORT_C TInt TestPanicClient( ); |
|
116 |
|
117 |
|
118 private: |
|
119 |
|
120 RLockAccessExtension* iLockAccessExtension; |
|
121 |
|
122 }; |
|
123 |
|
124 #endif // __KEYGUARDACCESSAPI_H__ |