sl@0: /* sl@0: * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: sl@0: #ifndef __SUPPLIEROUTPUTFILE_H__ sl@0: #define __SUPPLIEROUTPUTFILE_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: class RReadStream; sl@0: class RWriteStream; sl@0: sl@0: #ifndef REMOVE_CAF1 sl@0: #include sl@0: #endif sl@0: sl@0: namespace ContentAccess sl@0: { sl@0: sl@0: /** sl@0: Holds the details of an output file produced by CAF. sl@0: sl@0: It stores: sl@0: sl@0: @li The filename sl@0: @li The type of file (receipt or content) sl@0: @li The mime type of the file sl@0: sl@0: */ sl@0: class CSupplierOutputFile : public CBase sl@0: { sl@0: public: sl@0: sl@0: #ifndef REMOVE_CAF1 sl@0: sl@0: /** Create a new CSupplierOutputFile used to describe output files produced by the CAF supply operation sl@0: sl@0: @note Receipt files should be generated in localised unicode sl@0: sl@0: @param aFileName The name of the file produced sl@0: @param aOutputType The type of output file produced sl@0: @return a new CSupplierOutputFile object sl@0: @deprecated sl@0: */ sl@0: sl@0: IMPORT_C static CSupplierOutputFile* NewL(const TDesC& aFileName, const TOutputType aOutputType); sl@0: #endif // REMOVE_CAF1 sl@0: sl@0: /** Create a new CSupplierOutputFile used to describe output files produced by the CAF supply operation sl@0: sl@0: @note Receipt files should be generated in localised unicode sl@0: sl@0: @param aFileName The name of the file produced sl@0: @param aOutputType The type of output file produced sl@0: @param aMimeType The mime type of the file produced sl@0: @return a new CSupplierOutputFile object sl@0: */ sl@0: IMPORT_C static CSupplierOutputFile* NewL(const TDesC& aFileName, const TOutputType aOutputType, const TDesC8& aMimeType); sl@0: sl@0: sl@0: /** Construct an instance of CSupplierOutputFile by reading from the stream sl@0: @param aStream A stream containing a CSupplierOutputFile sl@0: @return A new CSupplierOutputFile sl@0: */ sl@0: IMPORT_C static CSupplierOutputFile* NewL(RReadStream& aStream); sl@0: sl@0: virtual ~CSupplierOutputFile(); sl@0: sl@0: /** Finds out the name of the file. sl@0: sl@0: @return The name (with full path) of the output file produced. sl@0: */ sl@0: IMPORT_C TPtrC FileName() const; sl@0: sl@0: /** The type of the file, e.g., Content or a Receipt. sl@0: sl@0: @note Receipt files should be generated in localised unicode sl@0: sl@0: @return The type of output file. sl@0: */ sl@0: IMPORT_C TOutputType OutputType() const; sl@0: sl@0: /** The mime type of the output file. sl@0: sl@0: @return The mime type. sl@0: */ sl@0: IMPORT_C TPtrC8 MimeTypeL(); sl@0: sl@0: /** Write the CSupplierOutputFile object to a stream sl@0: sl@0: @param aStream The stream to write to. sl@0: */ sl@0: IMPORT_C void ExternalizeL(RWriteStream& aStream) const; sl@0: sl@0: #ifndef REMOVE_CAF1 sl@0: /** Create a CAttributeObject for the output file sl@0: @param aPreloaded ETrue to query all attribute values before returning the attribute object sl@0: @deprecated sl@0: */ sl@0: IMPORT_C CAttribute& AttributesL (TBool aPreloaded); sl@0: private: sl@0: CAttribute *iAttr; sl@0: #endif // REMOVE_CAF1 sl@0: sl@0: private: sl@0: CSupplierOutputFile(); sl@0: void ConstructL(const TDesC& aFileName, const TDesC8& aMimeType, const TOutputType aOutputType); sl@0: sl@0: void InternalizeL(RReadStream& aStream); sl@0: sl@0: HBufC* iFileName; sl@0: TBuf8 iMimeType; sl@0: TOutputType iOutputType; sl@0: }; sl@0: } sl@0: sl@0: #endif