fotaapplication/fotaserver/FotaServer/inc/DevEncController.h
branchRCL_3
changeset 26 19bba8228ff0
child 27 5cc2995847ea
equal deleted inserted replaced
25:b183ec05bd8c 26:19bba8228ff0
       
     1 /*
       
     2 * Copyright (c) 2009 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:   CDevEncController class declaration
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __DEVENCCONTROLLER_H__
       
    19 #define __DEVENCCONTROLLER_H__
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32base.h>
       
    23 
       
    24 #include <DevEncConstants.h>
       
    25 #include "DevEncProgressDlg.h"
       
    26 #define KDevEncUIUid 0x2000259A
       
    27 
       
    28 //Forward declaration
       
    29 class CFotaServer;
       
    30 class CDevEncSessionBase;
       
    31 class CDevEncStarterStarter;
       
    32 class CDevEncProgressObserver;
       
    33 
       
    34 class CDevEncController : public CBase
       
    35     {
       
    36     public:
       
    37         static CDevEncController* NewL( CFotaServer* aCallback );
       
    38         static CDevEncController* NewLC( CFotaServer* aCallback );
       
    39         ~CDevEncController();
       
    40 
       
    41     public:
       
    42         TBool NeedToDecryptL(const TDriveNumber &aDrive);
       
    43     
       
    44         void DoStartDecryptionL(const TDriveNumber &aDrive);
       
    45         
       
    46         TBool NeedToEncryptL(TDriveNumber &aDrive);
       
    47         
       
    48         void DoStartEncryptionL(const TDriveNumber &aDrive );
       
    49         
       
    50         void ReportDevEncStartCompleteL(TInt aResult);
       
    51         
       
    52         void ReportDevEncOpnCompleteL(TInt aResult);
       
    53         
       
    54         TInt GetDEOperation();
       
    55         
       
    56     private:
       
    57     // Functions
       
    58         CDevEncController(CFotaServer* aCallback);
       
    59 
       
    60         void ConstructL();
       
    61         
       
    62         TBool IsDeviceEncryptionSupportedL();
       
    63         
       
    64         void LoadDevEncSessionL();
       
    65         
       
    66         void UnloadDevEncSession();
       
    67         
       
    68         void StartDecryptionL();
       
    69         
       
    70         void StartEncryptionL();
       
    71         
       
    72         TBool CheckBatteryL();
       
    73         
       
    74     // Data
       
    75         CFotaServer* iCallback; // parent
       
    76         
       
    77 		RLibrary iLibrary;
       
    78                 
       
    79         CDevEncSessionBase*     iEncMemorySession; // Device Encryption engine session
       
    80 
       
    81         CDevEncProgressObserver* iDevEncObserver; //Observer for the encryption/decryption operation
       
    82         
       
    83         TDriveNumber iStorageDrive; //Holds the storage drive id
       
    84         
       
    85         TInt iDevEncOperation; //TOperations values
       
    86         
       
    87     };
       
    88 
       
    89 #endif //__DEVENCCONTROLLER_H__
       
    90 
       
    91 // End of file