mmserv/metadatautility/Src/MetaDataParserRA.h
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     1 /*
       
     2 * Copyright (c) 2004 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 "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:  This class implements an ID3v1 and v1.1 parser as specified in
       
    15 *                www.id3.org.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CMetaDataParserRA_H
       
    22 #define CMetaDataParserRA_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include "MetaDataParser.h"
       
    27 #include "MetaDataSource.h"
       
    28 #include "MetaDataFieldContainer.h"
       
    29 #include "MetaDataField.h"
       
    30 
       
    31 // CONSTANTS
       
    32 
       
    33 // CLASS DECLARATION
       
    34 class CHXMetaDataUtility;
       
    35 
       
    36 /**
       
    37 *  This class implements a RA metadata parser.
       
    38 *
       
    39 *  @lib MetaDataUtility.lib
       
    40 *  @since 3.0
       
    41 */
       
    42 class CMetaDataParserRA : public CMetaDataParser
       
    43 	{
       
    44     public:  // Constructors and destructor
       
    45 
       
    46         /**
       
    47         * Two-phased constructor.
       
    48         * @param aSource Reference to a metadata source
       
    49         * @return A pointer to a new instance of this class
       
    50         */
       
    51         static CMetaDataParserRA* NewL( CMetaDataSource& aSource );
       
    52 
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         virtual ~CMetaDataParserRA();
       
    57 
       
    58     public: // Functions from base classes
       
    59 
       
    60         /**
       
    61         * From CMetaDataParser
       
    62         * Parses the source and if metadata is found, the metadata fields are
       
    63         * inserted into the container.
       
    64         * @since 3.0
       
    65 		* @param aWantedFields An array of TMetaDataFieldId's. Empty array is interpreted as all fields.
       
    66         * @param aContainer On return, metadata found in aSource is stored here
       
    67 		* @return void
       
    68         */
       
    69 		void ParseL( const RArray<TMetaDataFieldId>& aWantedFields, CMetaDataFieldContainer& aContainer );
       
    70 
       
    71 	private:
       
    72 
       
    73         /**
       
    74         * C++ default constructor.
       
    75         */
       
    76 		CMetaDataParserRA( CMetaDataSource& aSource );
       
    77 
       
    78         /**
       
    79         * By default Symbian 2nd phase constructor is private.
       
    80         */
       
    81 		void ConstructL();
       
    82 
       
    83 		/**
       
    84 		* Determines whether or not there is valid source data.
       
    85 		*/
       
    86 		TBool ValidateL();
       
    87 
       
    88         /**
       
    89         * Append title to the container, if found.
       
    90         * @return TInt status
       
    91 		*/
       
    92 		TInt GetTitleL(TInt aCount);
       
    93 
       
    94         /**
       
    95         * Append artist to the container, if found.
       
    96         * @return TInt status
       
    97 		*/
       
    98 		TInt GetArtistL(TInt aCount);
       
    99 
       
   100         /**
       
   101         * Append genre to the container, if found.
       
   102         * @return TInt status
       
   103 		*/
       
   104 		TInt GetGenreL(TInt aCount);
       
   105 
       
   106         /**
       
   107         * Append composer to the container, if found.
       
   108         * @return Tint status
       
   109 		*/
       
   110 		TInt GetComposerL(TInt aCount);
       
   111 
       
   112 		/**
       
   113         * Append Copyright to the container, if found.
       
   114         * @return Tint status
       
   115 		*/
       
   116 		TInt GetCopyrightL(TInt aCount);
       
   117 		
       
   118 		/**
       
   119         * Allows OpenFile on Helix
       
   120         * @return void
       
   121 		*/		
       
   122 		void OpenFileL(RFile& aFile);
       
   123 		
       
   124 		/**
       
   125         * Allows OpenDes on Helix
       
   126         * @return void
       
   127 		*/		
       
   128 		void OpenDesL(const TDesC8& aDes);		
       
   129 
       
   130 	private:	// Data
       
   131 	
       
   132 		// Metadata source
       
   133 		CMetaDataSource& iSource;
       
   134         HBufC* iData;
       
   135         CHXMetaDataUtility* iHxMetaDataUtility;
       
   136 		
       
   137     };
       
   138 
       
   139 #endif      // CMetaDataParserRA_H
       
   140 
       
   141 // End of File