remotemgmt_plat/scp_server_api/inc/SCPClient.h
branchRCL_3
changeset 26 19bba8228ff0
parent 25 b183ec05bd8c
equal deleted inserted replaced
25:b183ec05bd8c 26:19bba8228ff0
   173         * <BR><B>Type of return value:</B> TInt
   173         * <BR><B>Type of return value:</B> TInt
   174         * <BR><B>Range of return value:</B> A system wide error code
   174         * <BR><B>Range of return value:</B> A system wide error code
   175         * <BR><B>Contents of return value:</B> The status code of the operation.        
   175         * <BR><B>Contents of return value:</B> The status code of the operation.        
   176         */        
   176         */        
   177         IMPORT_C TInt GetParamValue( TInt aParamID, TDes& aValue ); 
   177         IMPORT_C TInt GetParamValue( TInt aParamID, TDes& aValue ); 
       
   178     
       
   179         enum TSCPButtonConfig
       
   180             {
       
   181             SCP_OK,
       
   182             SCP_OK_CANCEL,
       
   183             SCP_OK_ETEL,
       
   184             SCP_OK_CANCEL_ETEL
       
   185             };            
       
   186         
       
   187         /**
       
   188         * Request the security code from the user.
       
   189         * 
       
   190         */        
       
   191         IMPORT_C TInt SecCodeQuery( RMobilePhone::TMobilePassword& aPassword, 
       
   192                                     TSCPButtonConfig aButtonsShown, 
       
   193                                     TBool aECSSupport,
       
   194                                     TInt aFlags );
       
   195         
       
   196         /**
       
   197         * Prompt the user to change the security code.
       
   198         */        
       
   199         IMPORT_C TInt ChangeCodeRequest(); 
   178         
   200         
   179         /**
   201         /**
   180         * Checks the server configuration and reports the status.
   202         * Checks the server configuration and reports the status.
   181         * @param aMode The check mode, initial or complete. The initial mode only checks if the
   203         * @param aMode The check mode, initial or complete. The initial mode only checks if the
   182         * configuration has already been validated.        
   204         * configuration has already been validated.        
   215       */
   237       */
   216       IMPORT_C TInt SetParamValue( TInt aParamID, TDes& aValue, TUint32 aCallerID );        
   238       IMPORT_C TInt SetParamValue( TInt aParamID, TDes& aValue, TUint32 aCallerID );        
   217 
   239 
   218 
   240 
   219 	  IMPORT_C TInt SetAutoLockPeriod( TInt aValue );
   241 	  IMPORT_C TInt SetAutoLockPeriod( TInt aValue );
   220 	  
       
   221 	/**
       
   222 	* This function would return if the Lock Code of the device is allowed to be changed at the given moment.
       
   223 	*
       
   224 	* The outcome of this function would depend on two of the policies enforced at TARM, EPasscodeMinChangeTolerance and
       
   225 	* EPasscodeMinChangeInterval. These two policies would determine how often the user is allowed to change the Lock Code
       
   226 	* of the device between a specified time interval. If the user has exceeded the maximum number of times he is allowed
       
   227 	* to change the Lock Code of the device then this function would return a non-KErrNone status
       
   228 	*
       
   229 	* @param 	aFailedPolicies: On completion of the call, If the Lock Code is not allowed to be changed at this point in time
       
   230 				then this array would contain the two policies (mentioned earlier) that failed.
       
   231 
       
   232 				The policy ID's are available in SCPServerInterface.h under TDevicelockPolicies
       
   233 	*
       
   234 	*
       
   235 	* @return The status, see below
       
   236 	* <BR><B>Name of return value:</B> Operation status
       
   237 	* <BR><B>Type of return value:</B> TInt
       
   238 	* <BR><B>Range of return value:</B> A system wide error code
       
   239 	* <BR><B>Contents of return value:</B> The status code of the operation.
       
   240 	*
       
   241 	*/
       
   242 	IMPORT_C TBool IsLockcodeChangeAllowedNow(RArray<TDevicelockPolicies> &aDevicelockPolicies);
       
   243 
       
   244 	/**
       
   245 	* Get values for all the policies that are maintained at the server
       
   246 	*
       
   247 	* @param aDevicelockPolicies: Upon completion of the call, this array would contain the values
       
   248 								for each of the parameter that is maintained at the server. The values can be
       
   249 								accessed using the policy ID's as index to the aDevicelockPolicies array
       
   250 
       
   251 								Ex: aDevicelockPolicies[TDevicelockPolicies :: EDeviceLockMaxlength];
       
   252 
       
   253 								The policy ID's are available in SCPServerInterface.h
       
   254 	*
       
   255 	*
       
   256 	* @return The status, see below
       
   257 	* <BR><B>Name of return value:</B> Operation status
       
   258 	* <BR><B>Type of return value:</B> TInt
       
   259 	* <BR><B>Range of return value:</B> A system wide error code
       
   260 	* <BR><B>Contents of return value:</B> The status code of the operation.
       
   261 	*
       
   262 	*/
       
   263 	IMPORT_C TInt GetPolicies(RArray<TInt>& aDevicelockPolicies);
       
   264 
       
   265 	/**
       
   266 	* Verifies if a new Lock Code is in compliance with the policies enforced at TARM. Ideally this should be invoked
       
   267 	*	before a call to StoreLockCode.
       
   268 	*
       
   269 	* @param 	aNewLockcode: The new Lock Code that is to be verified against TARM policies
       
   270 
       
   271 				aFailedPolicies: On completion of the call, if the return value is other than KErrNone, this array
       
   272 				would contain the policies that were not satisfied by Lock Code provided in aLockCode
       
   273 
       
   274 				The policy ID's are available in SCPServerInterface.h under TDevicelockPolicies
       
   275 	*
       
   276 	*
       
   277 	* @return The status, see below
       
   278 	* <BR><B>Name of return value:</B> Operation status
       
   279 	* <BR><B>Type of return value:</B> TInt
       
   280 	* <BR><B>Range of return value:</B> A system wide error code
       
   281 	* <BR><B>Contents of return value:</B> The status code of the operation.
       
   282 	*
       
   283 	*/
       
   284 	IMPORT_C TInt VerifyNewLockcodeAgainstPolicies(TDesC& aNewLockcode, RArray<TDevicelockPolicies>& aFailedPolicies);
       
   285 
       
   286 	/**
       
   287 	* Sets a new device Lock Code
       
   288 	*
       
   289 	* @param 	aNewLockCode: The new Lock Code that is to be set on the device
       
   290 
       
   291 				aFailedPolicies: On completion of the call, if the New Lock Code is not compliant with the TARM policies
       
   292 				(if the return value is other than KErrNone) this array
       
   293 				would contain the policies that were not satisfied by Lock Code provided in aNewLockCode
       
   294 
       
   295 				The policy ID's are available in SCPServerInterface.h under TDevicelockPolicies
       
   296 	*
       
   297 	*
       
   298 	* @return The status, see below
       
   299 	* <BR><B>Name of return value:</B> Operation status
       
   300 	* <BR><B>Type of return value:</B> TInt
       
   301 	* <BR><B>Range of return value:</B> A system wide error code
       
   302 	* <BR><B>Contents of return value:</B> The status code of the operation.
       
   303 	*
       
   304 	*/
       
   305 	IMPORT_C TInt StoreLockcode(TDesC& aNewLockcode, TDesC& aOldLockcode, RArray<TDevicelockPolicies>& aFailedPolicies);
       
   306 
       
   307 	/**
       
   308 	* Verifies if the Lock Code enforced on the device is the same as the one mentioned in the argument.
       
   309 	*
       
   310 	* @param 	aLockCode: The Lock Code that is to be verified against the current device LockCode
       
   311 
       
   312 			aISACode: The Lock Code enforced through a call to StoreLockCode would hash the New Lock Code before storing
       
   313 			at the ISA (RMobilePhone) side.
       
   314 
       
   315 			On successful completion of a call to VerifyCurrentLockCode, aISACode would return
       
   316 			the Hashed code value equivalent to the current Lock Code enforced on the device
       
   317 
       
   318 			aFailedPolicies: On completion of the call, this array may contain EDeviceLockPasscodeExpiration depending on
       
   319 			if the Lock Code is marked as expired due to the current value of the policy at TARM
       
   320 
       
   321 			The policy ID's are available in SCPServerInterface.h under TDevicelockPolicies
       
   322 	*
       
   323 	*
       
   324 	* @return The status, see below
       
   325 	* <BR><B>Name of return value:</B> Operation status
       
   326 	* <BR><B>Type of return value:</B> TInt
       
   327 	* <BR><B>Range of return value:</B> A system wide error code
       
   328 	* <BR><B>Contents of return value:</B> The status code of the operation.
       
   329 	*
       
   330 	*/
       
   331 	IMPORT_C TInt VerifyCurrentLockcode(TDesC& aLockcode, RMobilePhone :: TMobilePassword& aISACode,
       
   332 		  RArray<TDevicelockPolicies>& aFailedPolicies, TInt aFlags);
       
   333 		  
       
   334     private: // Methods
   242     private: // Methods
   335 	
   243 
   336 	
   244         /**
   337 	    /**
   245         * Request the security code from the user (encapsulates functionalities of SecCodeQuery()).
       
   246         *
       
   247         */
       
   248     	TInt SetSecurityCodeL(RMobilePhone::TMobilePassword& aPassword, TSCPButtonConfig aButtonsShown,
       
   249                              TBool aECSSupport, TInt aFlags, TInt& aResFileSCP, TInt& aResFileSecUi);
       
   250 
       
   251         /**
       
   252         * Request the new code from the user and try to change the code
       
   253         */         
       
   254         TInt GetNewCodeAndChange( TDes& aOldCode, TInt aMode, TSCPSecCode* aNewDOSCode = NULL, HBufC** aNewCodePptr = NULL );
       
   255     
       
   256         /**
       
   257         * Process the server's response-commands
       
   258         */         
       
   259         void ProcessServerCommandsL( TDes8& aInParams, 
       
   260                                     CSCPParamObject** aOutParams = NULL,
       
   261                                     TBool isNotifierEvent = EFalse );
       
   262         
       
   263         /**
       
   264         * Show UI controls based on server commands
       
   265         */          
       
   266         void ShowUIL( CSCPParamObject& aContext );
       
   267         
       
   268         /**
   338         * Fetch the limit-values for code length
   269         * Fetch the limit-values for code length
   339         */          
   270         */          
   340         void FetchLimits( TInt& aMin, TInt& aMax );
   271         void FetchLimits( TInt& aMin, TInt& aMax );
   341 		
   272 		void InformAutolockTask();
   342         void ReadFailedPoliciesL(TDes8& aFailedPolicyBuf, RArray< TDevicelockPolicies > &aFailedPolicies);
       
   343 		
       
   344         TBool isFlagEnabled;        
   273         TBool isFlagEnabled;        
   345     };
   274     };
   346 
   275 
   347 #endif      //SCPCLIENT_H   
   276 #endif      //SCPCLIENT_H   
   348             
   277