|
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 for controls that want to modify lock status |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __LOCKAPPSTATECONTROLINTERFACE_H__ |
|
20 #define __LOCKAPPSTATECONTROLINTERFACE_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include "lockapp.hrh" |
|
24 |
|
25 /** |
|
26 * MLockAppStateControl class offers safe interface methods for lockapp controls. |
|
27 * All internal child controls should use this interface for modifying |
|
28 * the phone lock state. |
|
29 * |
|
30 * @lib lockapp |
|
31 * @since 5.0 |
|
32 * @author Joona Petrell |
|
33 * @author Tamas Koteles |
|
34 */ |
|
35 class MLockAppStateControl |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Activate keyguard lock. |
|
41 * |
|
42 * @param aWithNote if "keys locked" note is shown |
|
43 * @return KErrAlreadyExists if already enabled |
|
44 * KErrPermissionDenied if devicelock is activated |
|
45 * KErrNone if succeeded |
|
46 */ |
|
47 virtual TInt EnableKeyguardL( TBool aWithNote ) = 0; |
|
48 |
|
49 /** |
|
50 * Dectivate keyguard lock. |
|
51 * |
|
52 * @param aWithNote if "keys active" note is shown. |
|
53 * @return KErrAlreadyExists if already disabled |
|
54 * KErrPermissionDenied if devicelock is activated |
|
55 * KErrNone if succeeded |
|
56 */ |
|
57 virtual TInt DisableKeyguardL( TBool aWithNote ) = 0; |
|
58 |
|
59 /** |
|
60 * Activate devicelock. |
|
61 * |
|
62 * @param aReason the device locking reason. |
|
63 * @return KErrAlreadyExists if already enabled. |
|
64 * KErrNone if succeeded |
|
65 */ |
|
66 virtual TInt EnableDevicelockL( TDevicelockReason aReason = EDevicelockManual ) = 0; |
|
67 |
|
68 /** |
|
69 * Dectivate devicelock. |
|
70 * |
|
71 * @return KErrAlreadyExists if already disabled |
|
72 * KErrPermissionDenied if keyguard is activated |
|
73 * KErrNone if succeeded |
|
74 */ |
|
75 virtual TInt DisableDevicelockL( ) = 0; |
|
76 |
|
77 /** |
|
78 * Offer to enable keyguard by showing "offerkeylock" note. |
|
79 * |
|
80 * @return KErrPermissionDenied if keyguard/devicelock already activated |
|
81 * KErrNone if succeeded |
|
82 */ |
|
83 virtual TInt OfferKeyguard( ) = 0; |
|
84 |
|
85 /** |
|
86 * Offer to enable keyguard by showing "offerkeylock" note. |
|
87 * |
|
88 * @return KErrNone if succeeded |
|
89 * KErrPermissionDenied if keyguard is not enabled |
|
90 */ |
|
91 virtual TInt ShowKeysLockedNote( ) = 0; |
|
92 |
|
93 /** |
|
94 * External access to lock state |
|
95 * |
|
96 * @return Current lock state |
|
97 */ |
|
98 virtual TLockStatus LockStatus( ) const = 0; |
|
99 |
|
100 /** |
|
101 * External access to lock environment |
|
102 * |
|
103 * @return Current environment state |
|
104 */ |
|
105 virtual TUint EnvironmentStatus( ) const = 0; |
|
106 |
|
107 /** |
|
108 * Used for internal testing only, disabled normally |
|
109 * |
|
110 * @return error code |
|
111 */ |
|
112 virtual TInt ExecuteInternalTest( ) = 0; |
|
113 |
|
114 }; |
|
115 |
|
116 #endif // __LOCKAPPSTATECONTROLINTERFACE_H__ |
|
117 // End of File |