terminalsecurity/SCP/SCPClient/src/SCPClient.cpp
changeset 73 ae69c2e8bc34
parent 60 eb6690d0d439
equal deleted inserted replaced
71:d2517372cc44 73:ae69c2e8bc34
    19 
    19 
    20 // INCLUDE FILES
    20 // INCLUDE FILES
    21 #include <e32svr.h>
    21 #include <e32svr.h>
    22 #include <e32math.h>
    22 #include <e32math.h>
    23 #include <e32uid.h>
    23 #include <e32uid.h>
    24 #include <AknGlobalNote.h>
       
    25 #include <aknnotewrappers.h> 
       
    26 #include <AknQueryDialog.h>
       
    27 #include <AknGlobalConfirmationQuery.h>
       
    28 
    24 
    29 #include "SCPClient.h"
    25 #include "SCPClient.h"
    30 #include "SCPParamObject.h"
    26 #include "SCPParamObject.h"
    31 
    27 
    32 #include <scpnotifier.rsg>
       
    33 #include "SCP_IDs.h"
    28 #include "SCP_IDs.h"
    34 
    29 
    35 #include <centralrepository.h>
    30 #include <centralrepository.h>
    36 #include "SCPLockCode.h"
    31 #include "SCPLockCode.h"
    37 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS
    32 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS
    38 #include <TerminalControl3rdPartyAPI.h>
    33 #include <TerminalControl3rdPartyAPI.h>
    39 #include <SCPServerInterface.h>
    34 #include <SCPServerInterface.h>
    40 #include <secui.hrh>
    35 #include <secui.hrh>
    41 #include <StringLoader.h>
       
    42 #include <bautils.h>
       
    43 //#endif // DEVICE_LOCK_ENHANCEMENTS
    36 //#endif // DEVICE_LOCK_ENHANCEMENTS
    44 
    37 
    45 #include <featmgr.h>
    38 #include <featmgr.h>
    46 #include "SCPDebug.h"
    39 #include "SCPDebug.h"
    47 #include <e32property.h>
    40 #include <e32property.h>
    61 
    54 
    62 static const TUint KDefaultMessageSlots = 3;
    55 static const TUint KDefaultMessageSlots = 3;
    63 static const TInt KSCPConnectRetries( 2 );
    56 static const TInt KSCPConnectRetries( 2 );
    64 
    57 
    65 
    58 
    66 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS
       
    67 _LIT( KDriveZ, "Z:" );
       
    68 _LIT( KSCPResourceFilename, "\\Resource\\SCPNotifier.RSC" );
       
    69 _LIT( KSCPSecUIResourceFilename, "\\Resource\\SecUi.RSC" );
       
    70 //#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS
       
    71 
       
    72 // Uid for the application; this should match the mmp file
    59 // Uid for the application; this should match the mmp file
    73 const TUid KServerUid3 = {0x10207836};
    60 const TUid KServerUid3 = {0x10207836};
    74 
    61 
    75 #ifdef __WINS__
    62 #ifdef __WINS__
    76 static const TUint KServerMinHeapSize =  0x1000;  //  4K
    63 static const TUint KServerMinHeapSize =  0x1000;  //  4K
   164     server.Close();
   151     server.Close();
   165 
   152 
   166     Dprint( (_L("<-- SCPClient::CreateServerProcess(): %d"), result ));
   153     Dprint( (_L("<-- SCPClient::CreateServerProcess(): %d"), result ));
   167     return result;
   154     return result;
   168     }
   155     }
   169 
       
   170 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS
       
   171 
       
   172 
       
   173 // ---------------------------------------------------------
       
   174 // LoadResources() Resource loader
       
   175 // Load the resources for the library
       
   176 // Returns: TInt: A generic error code.
       
   177 //
       
   178 // Status : Approved
       
   179 // ---------------------------------------------------------
       
   180 //
       
   181 TInt LoadResources( TInt& aRes1, TInt& aRes2 )
       
   182     {
       
   183     
       
   184    TRAPD ( err, FeatureManager::InitializeLibL() );   
       
   185    if ( err == KErrNone )
       
   186    {
       
   187     if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
       
   188 	{
       
   189 			FeatureManager::UnInitializeLib();
       
   190 		return KErrNotSupported;
       
   191 	}
       
   192 		FeatureManager::UnInitializeLib();
       
   193     // Load the resource files for this DLL
       
   194     TInt err = KErrNone;
       
   195     TInt err2 = KErrNone;
       
   196        
       
   197     // Localize the file name, and load the SCP resources
       
   198     TFileName resFile;
       
   199     resFile.Copy( KDriveZ );
       
   200     resFile.Append( KSCPResourceFilename );
       
   201     BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resFile );    
       
   202     TRAP( err, aRes1 = CCoeEnv::Static()->AddResourceFileL( resFile ) );
       
   203     
       
   204     if ( err == KErrNone )
       
   205         {
       
   206         // Localize the file name, and load the SecUi resources
       
   207         resFile.Copy( KDriveZ );
       
   208         resFile.Append( KSCPSecUIResourceFilename );
       
   209         BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resFile );
       
   210         TRAP( err2, aRes2 = CCoeEnv::Static()->AddResourceFileL( resFile ) );
       
   211         }   
       
   212              
       
   213     if ( ( err != KErrNone ) || ( err2 != KErrNone ) )
       
   214         {        
       
   215         if ( err == KErrNone )             
       
   216             {
       
   217             // First resource was loaded OK, remove it
       
   218             CCoeEnv::Static()->DeleteResourceFile( aRes1 );
       
   219             err = err2;
       
   220             }
       
   221         } 
       
   222     }        
       
   223     return err;           
       
   224     }     
       
   225 
       
   226 //#endif //  __SAP_DEVICE_LOCK_ENHANCEMENTS
       
   227 
   156 
   228 // ================= MEMBER FUNCTIONS =======================
   157 // ================= MEMBER FUNCTIONS =======================
   229 
   158 
   230 // C++ default constructor can NOT contain any code, that
   159 // C++ default constructor can NOT contain any code, that
   231 // might leave.
   160 // might leave.