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