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