author | William Roberts <williamr@symbian.org> |
Tue, 16 Mar 2010 16:12:26 +0000 | |
branch | Symbian2 |
changeset 2 | 2fe1408b6811 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
/* |
williamr@2 | 2 |
* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 3 |
* All rights reserved. |
williamr@2 | 4 |
* This component and the accompanying materials are made available |
williamr@2 | 5 |
* under the terms of the License "Eclipse Public License v1.0" |
williamr@2 | 6 |
* which accompanies this distribution, and is available |
williamr@2 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@2 | 8 |
* |
williamr@2 | 9 |
* Initial Contributors: |
williamr@2 | 10 |
* Nokia Corporation - initial contribution. |
williamr@2 | 11 |
* |
williamr@2 | 12 |
* Contributors: |
williamr@2 | 13 |
* |
williamr@2 | 14 |
* Description: |
williamr@2 | 15 |
* |
williamr@2 | 16 |
*/ |
williamr@2 | 17 |
|
williamr@2 | 18 |
|
williamr@2 | 19 |
|
williamr@2 | 20 |
|
williamr@2 | 21 |
/** |
williamr@2 | 22 |
@file |
williamr@2 | 23 |
@publishedPartner |
williamr@2 | 24 |
@released |
williamr@2 | 25 |
*/ |
williamr@2 | 26 |
|
williamr@2 | 27 |
|
williamr@2 | 28 |
#ifndef __SUPPLIEROUTPUTFILE_H__ |
williamr@2 | 29 |
#define __SUPPLIEROUTPUTFILE_H__ |
williamr@2 | 30 |
|
williamr@2 | 31 |
#include <e32base.h> |
williamr@2 | 32 |
#include <apmstd.h> |
williamr@2 | 33 |
#include <caf/caftypes.h> |
williamr@2 | 34 |
|
williamr@2 | 35 |
class RReadStream; |
williamr@2 | 36 |
class RWriteStream; |
williamr@2 | 37 |
|
williamr@2 | 38 |
#ifndef REMOVE_CAF1 |
williamr@2 | 39 |
#include <caf/attribute.h> |
williamr@2 | 40 |
#endif |
williamr@2 | 41 |
|
williamr@2 | 42 |
namespace ContentAccess |
williamr@2 | 43 |
{ |
williamr@2 | 44 |
|
williamr@2 | 45 |
/** |
williamr@2 | 46 |
Holds the details of an output file produced by CAF. |
williamr@2 | 47 |
|
williamr@2 | 48 |
It stores: |
williamr@2 | 49 |
|
williamr@2 | 50 |
@li The filename |
williamr@2 | 51 |
@li The type of file (receipt or content) |
williamr@2 | 52 |
@li The mime type of the file |
williamr@2 | 53 |
|
williamr@2 | 54 |
@publishedPartner |
williamr@2 | 55 |
@released |
williamr@2 | 56 |
*/ |
williamr@2 | 57 |
class CSupplierOutputFile : public CBase |
williamr@2 | 58 |
{ |
williamr@2 | 59 |
public: |
williamr@2 | 60 |
|
williamr@2 | 61 |
#ifndef REMOVE_CAF1 |
williamr@2 | 62 |
|
williamr@2 | 63 |
/** Create a new CSupplierOutputFile used to describe output files produced by the CAF supply operation |
williamr@2 | 64 |
|
williamr@2 | 65 |
@note Receipt files should be generated in localised unicode |
williamr@2 | 66 |
|
williamr@2 | 67 |
@param aFileName The name of the file produced |
williamr@2 | 68 |
@param aOutputType The type of output file produced |
williamr@2 | 69 |
@return a new CSupplierOutputFile object |
williamr@2 | 70 |
@deprecated |
williamr@2 | 71 |
*/ |
williamr@2 | 72 |
|
williamr@2 | 73 |
IMPORT_C static CSupplierOutputFile* NewL(const TDesC& aFileName, const TOutputType aOutputType); |
williamr@2 | 74 |
#endif // REMOVE_CAF1 |
williamr@2 | 75 |
|
williamr@2 | 76 |
/** Create a new CSupplierOutputFile used to describe output files produced by the CAF supply operation |
williamr@2 | 77 |
|
williamr@2 | 78 |
@note Receipt files should be generated in localised unicode |
williamr@2 | 79 |
|
williamr@2 | 80 |
@param aFileName The name of the file produced |
williamr@2 | 81 |
@param aOutputType The type of output file produced |
williamr@2 | 82 |
@param aMimeType The mime type of the file produced |
williamr@2 | 83 |
@return a new CSupplierOutputFile object |
williamr@2 | 84 |
*/ |
williamr@2 | 85 |
IMPORT_C static CSupplierOutputFile* NewL(const TDesC& aFileName, const TOutputType aOutputType, const TDesC8& aMimeType); |
williamr@2 | 86 |
|
williamr@2 | 87 |
|
williamr@2 | 88 |
/** Construct an instance of CSupplierOutputFile by reading from the stream |
williamr@2 | 89 |
@param aStream A stream containing a CSupplierOutputFile |
williamr@2 | 90 |
@return A new CSupplierOutputFile |
williamr@2 | 91 |
*/ |
williamr@2 | 92 |
IMPORT_C static CSupplierOutputFile* NewL(RReadStream& aStream); |
williamr@2 | 93 |
|
williamr@2 | 94 |
virtual ~CSupplierOutputFile(); |
williamr@2 | 95 |
|
williamr@2 | 96 |
/** Finds out the name of the file. |
williamr@2 | 97 |
|
williamr@2 | 98 |
@return The name (with full path) of the output file produced. |
williamr@2 | 99 |
*/ |
williamr@2 | 100 |
IMPORT_C TPtrC FileName() const; |
williamr@2 | 101 |
|
williamr@2 | 102 |
/** The type of the file, e.g., Content or a Receipt. |
williamr@2 | 103 |
|
williamr@2 | 104 |
@note Receipt files should be generated in localised unicode |
williamr@2 | 105 |
|
williamr@2 | 106 |
@return The type of output file. |
williamr@2 | 107 |
*/ |
williamr@2 | 108 |
IMPORT_C TOutputType OutputType() const; |
williamr@2 | 109 |
|
williamr@2 | 110 |
/** The mime type of the output file. |
williamr@2 | 111 |
|
williamr@2 | 112 |
@return The mime type. |
williamr@2 | 113 |
*/ |
williamr@2 | 114 |
IMPORT_C TPtrC8 MimeTypeL(); |
williamr@2 | 115 |
|
williamr@2 | 116 |
/** Write the CSupplierOutputFile object to a stream |
williamr@2 | 117 |
|
williamr@2 | 118 |
@param aStream The stream to write to. |
williamr@2 | 119 |
*/ |
williamr@2 | 120 |
IMPORT_C void ExternalizeL(RWriteStream& aStream) const; |
williamr@2 | 121 |
|
williamr@2 | 122 |
#ifndef REMOVE_CAF1 |
williamr@2 | 123 |
/** Create a CAttributeObject for the output file |
williamr@2 | 124 |
@param aPreloaded ETrue to query all attribute values before returning the attribute object |
williamr@2 | 125 |
@deprecated |
williamr@2 | 126 |
*/ |
williamr@2 | 127 |
IMPORT_C CAttribute& AttributesL (TBool aPreloaded); |
williamr@2 | 128 |
private: |
williamr@2 | 129 |
CAttribute *iAttr; |
williamr@2 | 130 |
#endif // REMOVE_CAF1 |
williamr@2 | 131 |
|
williamr@2 | 132 |
private: |
williamr@2 | 133 |
CSupplierOutputFile(); |
williamr@2 | 134 |
void ConstructL(const TDesC& aFileName, const TDesC8& aMimeType, const TOutputType aOutputType); |
williamr@2 | 135 |
|
williamr@2 | 136 |
void InternalizeL(RReadStream& aStream); |
williamr@2 | 137 |
|
williamr@2 | 138 |
HBufC* iFileName; |
williamr@2 | 139 |
TBuf8 <KMaxDataTypeLength> iMimeType; |
williamr@2 | 140 |
TOutputType iOutputType; |
williamr@2 | 141 |
}; |
williamr@2 | 142 |
} |
williamr@2 | 143 |
|
williamr@2 | 144 |
#endif |