|
1 /* |
|
2 * Copyright (c) 2003 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: SAP settings protection level handler. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __IMPSSAPPROTECTIONHANDLER_H |
|
19 #define __IMPSSAPPROTECTIONHANDLER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 #include "impssapsettings.h" |
|
24 |
|
25 |
|
26 |
|
27 // ENUMERATIONS |
|
28 enum TIMPSSAPOperation |
|
29 { |
|
30 EOperationSetSAPName = KIMPSSAPProtectionNULLOperation + 1, |
|
31 EOperationSetSAPAddress, |
|
32 EOperationSetSAPPort, |
|
33 EOperationSetSAPUserId, |
|
34 EOperationSetSAPUserPassword, |
|
35 EOperationSetHTTPProxyAddress, |
|
36 EOperationSetHTTPProxyPort, |
|
37 EOperationSetHTTPProxyUserId, |
|
38 EOperationSetHTTPProxyUserPassword, |
|
39 EOperationSetAP, |
|
40 EOperationSetClientId, |
|
41 EOperationSetServerAuthenticationName, |
|
42 EOperationSetServerAuthenticationPassword, |
|
43 EOperationSetServerAcceptedContentType, |
|
44 EOperationDeleteSAP, |
|
45 EOperationSetProtection, |
|
46 EOperationSetHighLevelServices, |
|
47 EOperationSetAuthorizationMode |
|
48 }; |
|
49 |
|
50 |
|
51 // CLASS DECLARATION |
|
52 /** |
|
53 *SAP protection handler. |
|
54 * |
|
55 * @lib IMPSSAPSettingsStore.dll |
|
56 * @since 3.0 |
|
57 */ |
|
58 NONSHARABLE_CLASS( IMPSSAPProtectionHandler ) |
|
59 { |
|
60 public: // new functions |
|
61 |
|
62 /** |
|
63 * Validates is the requested operation allowd on |
|
64 * given protection level. |
|
65 * |
|
66 * @param aProtection The used protection level. |
|
67 * @param aRequestedOperation The requested operation. |
|
68 * @return KErrNone if operation is allowed. If operation |
|
69 * isn't allowed returns KErrAccessDenied. |
|
70 * |
|
71 * @since 3.0 |
|
72 */ |
|
73 static TInt ValidateOperation( TIMPSSAPProtection aProtection, |
|
74 TInt aRequestedOperation ); |
|
75 |
|
76 /** |
|
77 * Validates is the requested operation allowd on |
|
78 * given protection level. Returns if operation is allowed. |
|
79 * If operation isn't allowed leaves with KErrAccessDenied. |
|
80 * |
|
81 * @param aProtection The used protection level. |
|
82 * @param aRequestedOperation The requested operation. |
|
83 * |
|
84 * @since 3.0 |
|
85 */ |
|
86 static void ValidateOperationL( TIMPSSAPProtection aProtection, |
|
87 TInt aRequestedOperation ); |
|
88 |
|
89 /** |
|
90 * Checks is passed integer OK protection level. |
|
91 * See TIMPSSAPProtection enumeration for currently |
|
92 * supported protection levels. |
|
93 * |
|
94 * Leaves with KErrArgument if protection level |
|
95 * isn't supported. |
|
96 * @param aProtectionEnumeration The protection level |
|
97 * enumeration to chechk. |
|
98 * |
|
99 * @since 3.0 |
|
100 */ |
|
101 static void ChechkIsProperProtectionLevelL( TInt32 aProtectionEnumeration ); |
|
102 |
|
103 private: // protection level helpers |
|
104 |
|
105 /** |
|
106 * Checks if the requested operation is allowed on the |
|
107 * "Brand Protection" mode. All other operations are |
|
108 * allowed except following prohibited operations: |
|
109 * - setting SAP name |
|
110 * - setting SAP address |
|
111 * - deleting SAP |
|
112 * @param aRequestedOperation Requested operation to chechk. |
|
113 * One of enumerations from TIMPSSAPOperation. |
|
114 * @return ETrue if operation is allowed, else EFalse. |
|
115 */ |
|
116 static TInt IsAllowedBrandProtectionOperation( TInt aRequestedOperation ); |
|
117 |
|
118 }; |
|
119 |
|
120 #endif // __IMPSSAPPROTECTIONHANDLER_H |
|
121 |
|
122 // End of File |