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