os/security/contentmgmt/referencedrmagent/contentiterator/EmbeddedcontentIterator.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of the License "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description: 
sl@0
    15
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
/**
sl@0
    20
 @file
sl@0
    21
 @internalComponent
sl@0
    22
 @released
sl@0
    23
*/
sl@0
    24
sl@0
    25
sl@0
    26
#ifndef __CAF_EMBEDDEDCONTENTITERATOR_H__
sl@0
    27
#define __CAF_EMBEDDEDCONTENTITERATOR_H__
sl@0
    28
sl@0
    29
#include <e32base.h>
sl@0
    30
sl@0
    31
#include "StreamablePtrArray.h"
sl@0
    32
#include <caf/virtualpathptr.h>
sl@0
    33
#include "ContentIteratorInterface.h"
sl@0
    34
sl@0
    35
namespace ContentAccess 
sl@0
    36
	{
sl@0
    37
	class CContent;
sl@0
    38
	class CEmbeddedObject;
sl@0
    39
	class CEmbeddedContentIteratorBase;
sl@0
    40
sl@0
    41
	/** Recursively iterate over all content objects within a file
sl@0
    42
sl@0
    43
	Can be used to find the all content objects inside a given file. A mimetype
sl@0
    44
	can be specified to return only those objects with the correct mime type
sl@0
    45
sl@0
    46
	@internalComponent
sl@0
    47
	@released
sl@0
    48
	*/
sl@0
    49
	NONSHARABLE_CLASS(CEmbeddedContentIterator): public MContentIterator
sl@0
    50
		{	
sl@0
    51
	public:
sl@0
    52
		/** Create a content iterator for a particular path in the file system
sl@0
    53
		@param aVirtualPath The file to search inside
sl@0
    54
		@param aRecursive Whether to explore sub-containers under the given path
sl@0
    55
		@param aMimeType The mime type to search for. Finds content objects of any mime types if this parameter is omitted
sl@0
    56
		@leave KErrNotFound If no suitable content objects were found inside the given path
sl@0
    57
		*/
sl@0
    58
		static CEmbeddedContentIterator* NewL(const TVirtualPathPtr& aVirtualPath, TBool aRecursive, const TDesC8& aMimeType = KNullDesC8);
sl@0
    59
sl@0
    60
		
sl@0
    61
		virtual ~CEmbeddedContentIterator();
sl@0
    62
sl@0
    63
		// MContentIterator
sl@0
    64
		virtual const TDesC& FileName() const;
sl@0
    65
		virtual const TDesC& UniqueId() const;
sl@0
    66
		virtual const TDesC& Name() const;
sl@0
    67
		virtual const TDesC8& MimeType() const;
sl@0
    68
		virtual TInt Next();
sl@0
    69
		
sl@0
    70
		
sl@0
    71
	private:
sl@0
    72
		CEmbeddedContentIterator();
sl@0
    73
		void ConstructL(const TVirtualPathPtr& aVirtualPath, TBool aRecursive, const TDesC8& aMimeType);
sl@0
    74
sl@0
    75
		// Construction parameters (copies)
sl@0
    76
		CContent* iContent;  // created from virtual path
sl@0
    77
		TBool iRecursive;
sl@0
    78
		HBufC8* iMimeType;
sl@0
    79
		HBufC* iUri;
sl@0
    80
			
sl@0
    81
		// Iterator that actually does the work
sl@0
    82
		CEmbeddedContentIteratorBase* iSubIterator;
sl@0
    83
		};
sl@0
    84
sl@0
    85
	}
sl@0
    86
sl@0
    87
#endif