os/security/contentmgmt/referencedrmagent/contentiterator/FileContentIterator.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
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_FILECONTENTITERATOR_H__
sl@0
    27
#define __CAF_FILECONTENTITERATOR_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 CManager;
sl@0
    38
	class CFileContentIteratorBase;
sl@0
    39
sl@0
    40
	/** Recursively iterates over all files and then into each file to determine the content
sl@0
    41
	objects inside 
sl@0
    42
sl@0
    43
	@internalComponent
sl@0
    44
	@released
sl@0
    45
	*/
sl@0
    46
	NONSHARABLE_CLASS(CFileContentIterator): public MContentIterator
sl@0
    47
		{
sl@0
    48
	public:
sl@0
    49
		/** Create a content iterator for a particular path in the file system
sl@0
    50
		@param aPath The path to search under
sl@0
    51
		@param aRecursive Whether to explore sub-directories under the given path
sl@0
    52
		@param aMimeType The mime type to search for. Finds content objects of any mime types if this parameter is omitted
sl@0
    53
		@leave KErrNotFound If no suitable content objects were found inside the given path
sl@0
    54
		*/
sl@0
    55
		static CFileContentIterator* NewL(const TDesC& aPath, TBool aRecursive, const TDesC8& aMimeType);
sl@0
    56
sl@0
    57
		virtual ~CFileContentIterator();
sl@0
    58
sl@0
    59
		// MContentIterator
sl@0
    60
		virtual const TDesC& FileName() const;
sl@0
    61
		virtual const TDesC& UniqueId() const;
sl@0
    62
		virtual const TDesC& Name() const;
sl@0
    63
		virtual const TDesC8& MimeType() const; 
sl@0
    64
		virtual TInt Next();
sl@0
    65
		
sl@0
    66
sl@0
    67
	private:
sl@0
    68
		CFileContentIterator();
sl@0
    69
		void ConstructL(const TDesC& aPath, TBool aRecursive, const TDesC8& aMimeType);
sl@0
    70
sl@0
    71
		// Manager for doing GetDir()
sl@0
    72
		CManager* iManager;
sl@0
    73
sl@0
    74
		// Construction Parameters
sl@0
    75
		HBufC* iPath;
sl@0
    76
		TBool iRecursive;
sl@0
    77
		HBufC8* iMimeType;
sl@0
    78
sl@0
    79
		CFileContentIteratorBase* iSubIterator;
sl@0
    80
		};
sl@0
    81
sl@0
    82
	}
sl@0
    83
sl@0
    84
#endif