2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
28 #ifndef __SUPPLIEROUTPUTFILE_H__
29 #define __SUPPLIEROUTPUTFILE_H__
33 #include <caf/caftypes.h>
39 #include <caf/attribute.h>
42 namespace ContentAccess
46 Holds the details of an output file produced by CAF.
51 @li The type of file (receipt or content)
52 @li The mime type of the file
57 class CSupplierOutputFile : public CBase
63 /** Create a new CSupplierOutputFile used to describe output files produced by the CAF supply operation
65 @note Receipt files should be generated in localised unicode
67 @param aFileName The name of the file produced
68 @param aOutputType The type of output file produced
69 @return a new CSupplierOutputFile object
73 IMPORT_C static CSupplierOutputFile* NewL(const TDesC& aFileName, const TOutputType aOutputType);
76 /** Create a new CSupplierOutputFile used to describe output files produced by the CAF supply operation
78 @note Receipt files should be generated in localised unicode
80 @param aFileName The name of the file produced
81 @param aOutputType The type of output file produced
82 @param aMimeType The mime type of the file produced
83 @return a new CSupplierOutputFile object
85 IMPORT_C static CSupplierOutputFile* NewL(const TDesC& aFileName, const TOutputType aOutputType, const TDesC8& aMimeType);
88 /** Construct an instance of CSupplierOutputFile by reading from the stream
89 @param aStream A stream containing a CSupplierOutputFile
90 @return A new CSupplierOutputFile
92 IMPORT_C static CSupplierOutputFile* NewL(RReadStream& aStream);
94 virtual ~CSupplierOutputFile();
96 /** Finds out the name of the file.
98 @return The name (with full path) of the output file produced.
100 IMPORT_C TPtrC FileName() const;
102 /** The type of the file, e.g., Content or a Receipt.
104 @note Receipt files should be generated in localised unicode
106 @return The type of output file.
108 IMPORT_C TOutputType OutputType() const;
110 /** The mime type of the output file.
112 @return The mime type.
114 IMPORT_C TPtrC8 MimeTypeL();
116 /** Write the CSupplierOutputFile object to a stream
118 @param aStream The stream to write to.
120 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
123 /** Create a CAttributeObject for the output file
124 @param aPreloaded ETrue to query all attribute values before returning the attribute object
127 IMPORT_C CAttribute& AttributesL (TBool aPreloaded);
130 #endif // REMOVE_CAF1
133 CSupplierOutputFile();
134 void ConstructL(const TDesC& aFileName, const TDesC8& aMimeType, const TOutputType aOutputType);
136 void InternalizeL(RReadStream& aStream);
139 TBuf8 <KMaxDataTypeLength> iMimeType;
140 TOutputType iOutputType;