|
1 /* |
|
2 * Copyright (c) 2000 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: Implementation of terminalsecurity components |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CSCPPATTERNPLUGIN_H |
|
19 #define __CSCPPATTERNPLUGIN_H (0x1) |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 #include "SCPPlugin.h" |
|
24 |
|
25 #include <TerminalControl3rdPartyAPI.h> |
|
26 |
|
27 |
|
28 // For the Localization |
|
29 #include <eikenv.h> |
|
30 #include <bautils.h> |
|
31 #include <f32file.h> |
|
32 #include <barsread.h> |
|
33 |
|
34 |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class CSCPParamObject; |
|
38 |
|
39 |
|
40 // CONSTANTS |
|
41 _LIT(SCPPatternPluginSrcFile, "\\Resource\\SCPPatternPluginLang.rsc"); |
|
42 _LIT( KDriveZ, "z:" ); |
|
43 |
|
44 // The max. value for EPasscodeMaxRepeatedCharacters |
|
45 const TInt KSCPMaxRepeatAmount( 4 ); |
|
46 |
|
47 // The max. value for EPasscodeMinSpecialCharacters |
|
48 const TInt KSCPMinSpecialAmount( 255 ); |
|
49 |
|
50 // CLASS DECLARATION |
|
51 |
|
52 /** |
|
53 * CSCPPatternPlugin |
|
54 |
|
55 */ |
|
56 class CSCPPatternPlugin : public CSCPPlugin |
|
57 { |
|
58 public: // Constructors, Destructor |
|
59 /** |
|
60 * 2-phased constructor |
|
61 * @return Instance of Plug-in |
|
62 */ |
|
63 static CSCPPatternPlugin* NewL(); |
|
64 |
|
65 /** |
|
66 * Destructor |
|
67 */ |
|
68 virtual ~CSCPPatternPlugin(); |
|
69 |
|
70 /** |
|
71 * Event handler... |
|
72 */ |
|
73 CSCPParamObject* HandleEvent( TInt aID, CSCPParamObject& aParam ); |
|
74 |
|
75 void SetEventHandler( MSCPPluginEventHandler* aHandler ); |
|
76 |
|
77 private: // Constructors, Destructor |
|
78 /** |
|
79 * Constructor |
|
80 */ |
|
81 CSCPPatternPlugin(); |
|
82 |
|
83 /** |
|
84 * 2nd phase constructor |
|
85 */ |
|
86 void ConstructL(); |
|
87 |
|
88 |
|
89 private : // Own internal implementation |
|
90 TBool TooManySameCharsL ( TDes& aParam, TInt aMaxRepeatedCharacters ); |
|
91 TBool consecutivelyCheck ( TDes& aParam ); |
|
92 HBufC16* LoadResourceLC( TInt aResId ); |
|
93 HBufC* LoadAndFormatResL( TInt aResId, TInt* aParam1 = NULL, TInt* aParam2 = NULL ); |
|
94 TInt GetResource(); |
|
95 void FormatResourceString(HBufC16 &aResStr); |
|
96 |
|
97 |
|
98 |
|
99 private: // Data |
|
100 /* A pointer to the event handler object on the server, not owned */ |
|
101 MSCPPluginEventHandler* iEventHandler; |
|
102 |
|
103 RFs* iFs; // Eventhandler's session ptr (not owned) |
|
104 RResourceFile iRf; |
|
105 |
|
106 |
|
107 }; |
|
108 |
|
109 #endif // __CSCPPATTERNPLUGIN_H |
|
110 |
|
111 // End of File |