mmfenh/progressivedownload/ProgressiveDownloadUtility/src/ContentFile.h
changeset 16 43d09473c595
parent 14 80975da52420
child 22 128eb6a32b84
equal deleted inserted replaced
14:80975da52420 16:43d09473c595
     1 /*
       
     2 * Copyright (c) 2006 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:  Progressive Download Utility  Header of ContentFile Classes.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CONTENT_FILE_H__
       
    19 #define __CONTENT_FILE_H__
       
    20 
       
    21 #include <content.h>
       
    22 #include <data.h>
       
    23 #include <mmf/common/mmcaf.h>
       
    24 
       
    25 // Provides content access framework based file access
       
    26 class CContentFile : public CBase
       
    27     {
       
    28     public:
       
    29         static CContentFile* NewL(RFs& aSession, const TDesC& aPath, const TDesC& aUniqueId, TUint aMode, TBool aEnableUI);
       
    30         void ConstructL(RFs& aSession, const TDesC& aPath, const TDesC& aUniqueId, TUint aMode, TBool aEnableUI);
       
    31 
       
    32         static CContentFile* NewL(RFile& aFile, const TDesC& aUniqueId, TBool aEnableUI);
       
    33         void ConstructL(RFile& aFile, const TDesC& aUniqueId, TBool aEnableUI);
       
    34 
       
    35         virtual ~CContentFile();
       
    36 
       
    37         // from MGenericFile
       
    38         virtual TInt Seek(TSeek aSeekMode, TInt& aPosition);
       
    39         virtual TInt Read(TDes8& aDes,TInt aLength);
       
    40         virtual void Read(TDes8& aDes, TInt aLength, TRequestStatus& aStatus);
       
    41         virtual TInt Write(const TDesC8& aDes,TInt aLength);
       
    42         virtual void Write(const TDesC8& aDes, TInt aLength, TRequestStatus& aStatus);
       
    43         virtual TInt Size(TInt& aSize);
       
    44         virtual TInt SetSize(TInt aSize);
       
    45         virtual TInt EvaluateIntent(const ContentAccess::TIntent aIntent) const;
       
    46         virtual TInt ExecuteIntent(const ContentAccess::TIntent aIntent);
       
    47         virtual TBool IsProtected() const;
       
    48         virtual RFile& FileL();
       
    49 
       
    50         virtual TInt SetAgentProperty(ContentAccess::TAgentProperty, TInt aValue);
       
    51 
       
    52     private:
       
    53         CContentFile();
       
    54 
       
    55 
       
    56     private:
       
    57         RFs* iSession; // not owned
       
    58         HBufC* iFilePath;
       
    59         ContentAccess::CData* iData;
       
    60 
       
    61         RFile iLegacyFile;
       
    62         TBool iLegacyFileOpen;
       
    63     };
       
    64 
       
    65 inline CContentFile::CContentFile()
       
    66     {
       
    67     }
       
    68 
       
    69 #endif //__CONTENT_FILE_H__