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