24 #include "SCPPlugin.h" |
24 #include "SCPPlugin.h" |
25 #include <f32file.h> |
25 #include <f32file.h> |
26 #include <barsc.h> |
26 #include <barsc.h> |
27 |
27 |
28 #include <TerminalControl3rdPartyAPI.h> |
28 #include <TerminalControl3rdPartyAPI.h> |
29 #include "SCPUserInf.h" |
29 |
30 |
30 |
31 // LOCAL CONSTANTS |
31 // LOCAL CONSTANTS |
32 const TInt KSCPMaxExpiration = 365; |
32 const TInt KSCPMaxExpiration = 365; |
33 const TInt KSCPMaxTolerance = 8; |
33 const TInt KSCPMaxTolerance = 8; |
34 const TInt KSCPMaxInterval = 1000; |
34 const TInt KSCPMaxInterval = 1000; |
49 |
49 |
50 const TInt KSCPTypeMinutes = 0; |
50 const TInt KSCPTypeMinutes = 0; |
51 const TInt KSCPTypeHours = 1; |
51 const TInt KSCPTypeHours = 1; |
52 const TInt KSCPTypeDays = 2; |
52 const TInt KSCPTypeDays = 2; |
53 |
53 |
54 const TInt KSCPNoteTimeout = 2000000; |
|
55 |
|
56 _LIT( KSCPTSConfigFile, "SCPTimestampPlugin.ini"); |
54 _LIT( KSCPTSConfigFile, "SCPTimestampPlugin.ini"); |
57 _LIT( KDriveZ, "Z:" ); |
55 _LIT( KDriveZ, "Z:" ); |
58 _LIT(KSCPTimestampPluginResFilename, "\\Resource\\SCPTimestampPluginLang.rsc"); |
56 _LIT(KSCPTimestampPluginResFilename, "\\Resource\\SCPTimestampPluginLang.rsc"); |
59 |
57 |
60 _LIT(KSCPFormatScript, "FORMAT %c:"); |
58 _LIT(KSCPFormatScript, "FORMAT %c:"); |
86 virtual ~CSCPTimestampPlugin(); |
84 virtual ~CSCPTimestampPlugin(); |
87 |
85 |
88 /** |
86 /** |
89 * Event handler |
87 * Event handler |
90 */ |
88 */ |
91 CSCPParamObject* HandleEvent( TInt aID, CSCPParamObject& aParam ); |
89 void HandleEventL( TInt aID, CSCPParamObject& aParam, CSCPParamObject& aOutParam ); |
92 |
90 |
93 void SetEventHandler( MSCPPluginEventHandler* aHandler ); |
91 void SetEventHandler( MSCPPluginEventHandler* aHandler ); |
94 |
92 |
95 private: // Constructors, Destructor |
93 private: // Constructors, Destructor |
96 /** |
94 /** |
107 private : // Methods |
105 private : // Methods |
108 |
106 |
109 /** |
107 /** |
110 * Checks if the minimum timeout has expired since the last change |
108 * Checks if the minimum timeout has expired since the last change |
111 */ |
109 */ |
112 void IsChangeAllowedL( CSCPParamObject& aParam, CSCPParamObject*& aRetParams ); |
110 void IsChangeAllowedL( CSCPParamObject& aParam, CSCPParamObject& aRetParams ); |
113 |
111 |
114 /** |
112 /** |
115 * Updates the status when the password is changed |
113 * Updates the status when the password is changed |
116 */ |
114 */ |
117 void PasswordChanged( CSCPParamObject& aParam, CSCPParamObject*& aRetParams ); |
115 void PasswordChanged( CSCPParamObject& aParam, CSCPParamObject& aRetParams ); |
118 |
116 |
119 /** |
117 /** |
120 * Updates the status when after an authentication attempt |
118 * Updates the status when after an authentication attempt |
121 */ |
119 */ |
122 void AuthenticationAttempt( TBool aIsSuccessful, |
120 void AuthenticationAttempt( TBool aIsSuccessful, |
123 CSCPParamObject& aParam, |
121 CSCPParamObject& aParam, |
124 CSCPParamObject*& aRetParams ); |
122 CSCPParamObject& aRetParams ); |
125 |
123 |
126 /** |
124 /** |
127 * Updates the status after successful authentication |
125 * Updates the status after successful authentication |
128 */ |
126 */ |
129 void SuccessfulAuthenticationL( CSCPParamObject& aParam, |
127 void SuccessfulAuthenticationL( CSCPParamObject& aParam, |
130 CSCPParamObject*& aRetParams ); |
128 CSCPParamObject& aRetParams ); |
131 |
129 |
132 |
130 |
133 /** |
131 /** |
134 * Checks if the given time interval is after the saved time (aConfID) |
132 * Checks if the given time interval is after the saved time (aConfID) |
135 */ |
133 */ |
139 /** |
137 /** |
140 * Handles the Configuration Query event |
138 * Handles the Configuration Query event |
141 */ |
139 */ |
142 void ConfigurationQuery( TInt aParamID, |
140 void ConfigurationQuery( TInt aParamID, |
143 CSCPParamObject& aParam, |
141 CSCPParamObject& aParam, |
144 CSCPParamObject*& aRetParams ); |
142 CSCPParamObject& aRetParams ); |
145 |
143 |
146 /** |
144 /** |
147 * Initiates RFS Deep (device wipe) |
145 * Initiates RFS Deep (device wipe) |
148 */ |
146 */ |
149 void WipeDeviceL( CSCPParamObject*& aRetParams ); |
147 void WipeDeviceL( CSCPParamObject& aRetParams ); |
150 |
148 |
151 /** |
149 /** |
152 * Read the configuration from flash. |
150 * Read the configuration from flash. |
153 */ |
151 */ |
154 TInt ReadConfiguration(); |
152 TInt ReadConfiguration(); |