javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/DriveAccessPolicy.h
changeset 21 2a9601315dfc
equal deleted inserted replaced
18:e8e63152f320 21:2a9601315dfc
       
     1 /*
       
     2 * Copyright (c) 2004 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 /**
       
    20  *
       
    21  * @file DriveAccessPolicy.h
       
    22  *
       
    23  * @internal
       
    24  *
       
    25  */
       
    26 
       
    27 #ifndef DRIVEACCESSPOLICY_H
       
    28 #define DRIVEACCESSPOLICY_H
       
    29 
       
    30 #include <e32base.h>
       
    31 #include <f32file.h>
       
    32 #include "MDriveAccessPolicy.h"
       
    33 
       
    34 namespace MIDP
       
    35 {
       
    36 class CPathAccessPolicy;
       
    37 
       
    38 class CDriveAccessPolicy: public CBase, public MDriveAccessPolicy
       
    39 {
       
    40 public:
       
    41     static CDriveAccessPolicy* NewL(const RFs& aFs, TDriveNumber aDrive);
       
    42     virtual ~CDriveAccessPolicy();
       
    43 
       
    44     // MVersionedInterface interface
       
    45     inline virtual TUint32 InterfaceVersion(void) const;
       
    46 
       
    47     // MDriveAccessPolicy interface
       
    48     virtual TBool DriveAccess() const;
       
    49     virtual void GetRootName(TDes& aRootName) const;
       
    50     virtual TAccessMode PathAccess(const TDesC& aPath) const;
       
    51     virtual const RPointerArray<HBufC>& RootDirectoryListL() const;
       
    52     virtual TBool MapPathL(const TDesC& aFrom, TDes& aTo) const;
       
    53 
       
    54     void SetPathAccessPolicy(CPathAccessPolicy* aPathAccessPolicy);
       
    55 
       
    56 private:
       
    57     CDriveAccessPolicy(const RFs& aFs, TDriveNumber aDriveNumber);
       
    58 
       
    59 private:
       
    60     const RFs& iFs;
       
    61     TDriveNumber iDrive;
       
    62     CPathAccessPolicy* iPathAccessPolicy;
       
    63 };
       
    64 
       
    65 inline TUint32 CDriveAccessPolicy::InterfaceVersion(void) const
       
    66 {
       
    67     return 0x0100;
       
    68 }
       
    69 
       
    70 } // end of namespace MIDP
       
    71 
       
    72 #endif // DRIVEACCESSPOLICY_H