secsrv_plat/devenccommonutils_api/inc/DevEncSession.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2007 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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DEVENC_SESSION_H
       
    20 #define DEVENC_SESSION_H
       
    21 
       
    22 #include <f32file.h>
       
    23 #include <e32property.h>
       
    24 
       
    25 #include "DevEncSessionBase.h"
       
    26 class CDevEncEngineBase;
       
    27 // CONSTANTS
       
    28 
       
    29 
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33 * A session object for communication between the UI and NFE extension.
       
    34 */
       
    35 class CDevEncSession: public CDevEncSessionBase
       
    36     {
       
    37     public:
       
    38         IMPORT_C explicit CDevEncSession();
       
    39         IMPORT_C explicit CDevEncSession( TDriveNumber aNumber );
       
    40         ~CDevEncSession();
       
    41 
       
    42         IMPORT_C TInt Connect();
       
    43         IMPORT_C void Close();
       
    44         IMPORT_C TInt StartDiskEncrypt();
       
    45         IMPORT_C TInt StartDiskDecrypt();
       
    46         IMPORT_C TInt StartDiskWipe();
       
    47         IMPORT_C TInt DiskStatus( TInt& aStatus ) const;
       
    48         IMPORT_C TInt Progress( TInt& aProgress ) const;
       
    49         IMPORT_C TBool Connected() const;
       
    50         IMPORT_C TDriveNumber DriveNumber() const;
       
    51         IMPORT_C void SetDrive( TDriveNumber aNumber );   
       
    52         /**
       
    53          * Sets the access control for device encryption
       
    54          * @param aValue is of type TDevEncControl
       
    55          * @return KErrNone or system wide error
       
    56          */
       
    57         IMPORT_C TInt SetDevEncControlL(TInt aValue);
       
    58 
       
    59         /**
       
    60          * Gets the access control value for device encryption
       
    61          * @param aValue is set when the function returns
       
    62          * @return KErrNone or system wide error
       
    63          */
       
    64         IMPORT_C TInt GetDevEncControlL(TInt& aValue);
       
    65         
       
    66     private:
       
    67         TInt StartDiskOperation( TInt aOp );
       
    68         void LoadDevEncEngineL();
       
    69         void UnloadDevEncEngine();
       
    70 
       
    71     private:
       
    72         TBool iConnected;
       
    73         TDriveNumber iDriveNumber;
       
    74         mutable RProperty iToNfe;
       
    75         mutable RProperty iFromNfe;
       
    76         mutable RProperty iProgress;
       
    77         mutable RProperty iNfeStatusToUi;
       
    78         CDevEncEngineBase* iDevEncEngine;
       
    79         RLibrary iLibrary;
       
    80     };
       
    81 
       
    82 #endif // DEVENC_SESSION_H
       
    83 
       
    84 // End of file