contentmgmt/referencedrmagent/contentiterator/EmbeddedcontentIterator.h
changeset 15 da2ae96f639b
equal deleted inserted replaced
10:afc583cfa176 15:da2ae96f639b
       
     1 /*
       
     2 * Copyright (c) 2004-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  @internalComponent
       
    22  @released
       
    23 */
       
    24 
       
    25 
       
    26 #ifndef __CAF_EMBEDDEDCONTENTITERATOR_H__
       
    27 #define __CAF_EMBEDDEDCONTENTITERATOR_H__
       
    28 
       
    29 #include <e32base.h>
       
    30 
       
    31 #include "streamableptrarray.h"
       
    32 #include <caf/virtualpathptr.h>
       
    33 #include "ContentIteratorInterface.h"
       
    34 
       
    35 namespace ContentAccess 
       
    36 	{
       
    37 	class CContent;
       
    38 	class CEmbeddedObject;
       
    39 	class CEmbeddedContentIteratorBase;
       
    40 
       
    41 	/** Recursively iterate over all content objects within a file
       
    42 
       
    43 	Can be used to find the all content objects inside a given file. A mimetype
       
    44 	can be specified to return only those objects with the correct mime type
       
    45 
       
    46 	@internalComponent
       
    47 	@released
       
    48 	*/
       
    49 	NONSHARABLE_CLASS(CEmbeddedContentIterator): public MContentIterator
       
    50 		{	
       
    51 	public:
       
    52 		/** Create a content iterator for a particular path in the file system
       
    53 		@param aVirtualPath The file to search inside
       
    54 		@param aRecursive Whether to explore sub-containers under the given path
       
    55 		@param aMimeType The mime type to search for. Finds content objects of any mime types if this parameter is omitted
       
    56 		@leave KErrNotFound If no suitable content objects were found inside the given path
       
    57 		*/
       
    58 		static CEmbeddedContentIterator* NewL(const TVirtualPathPtr& aVirtualPath, TBool aRecursive, const TDesC8& aMimeType = KNullDesC8);
       
    59 
       
    60 		
       
    61 		virtual ~CEmbeddedContentIterator();
       
    62 
       
    63 		// MContentIterator
       
    64 		virtual const TDesC& FileName() const;
       
    65 		virtual const TDesC& UniqueId() const;
       
    66 		virtual const TDesC& Name() const;
       
    67 		virtual const TDesC8& MimeType() const;
       
    68 		virtual TInt Next();
       
    69 		
       
    70 		
       
    71 	private:
       
    72 		CEmbeddedContentIterator();
       
    73 		void ConstructL(const TVirtualPathPtr& aVirtualPath, TBool aRecursive, const TDesC8& aMimeType);
       
    74 
       
    75 		// Construction parameters (copies)
       
    76 		CContent* iContent;  // created from virtual path
       
    77 		TBool iRecursive;
       
    78 		HBufC8* iMimeType;
       
    79 		HBufC* iUri;
       
    80 			
       
    81 		// Iterator that actually does the work
       
    82 		CEmbeddedContentIteratorBase* iSubIterator;
       
    83 		};
       
    84 
       
    85 	}
       
    86 
       
    87 #endif