sl@0: /* sl@0: * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: @released sl@0: */ sl@0: sl@0: sl@0: #ifndef __CAF_FILECONTENTITERATOR_H__ sl@0: #define __CAF_FILECONTENTITERATOR_H__ sl@0: sl@0: #include sl@0: sl@0: #include "StreamablePtrArray.h" sl@0: #include sl@0: #include "ContentIteratorInterface.h" sl@0: sl@0: namespace ContentAccess sl@0: { sl@0: class CManager; sl@0: class CFileContentIteratorBase; sl@0: sl@0: /** Recursively iterates over all files and then into each file to determine the content sl@0: objects inside sl@0: sl@0: @internalComponent sl@0: @released sl@0: */ sl@0: NONSHARABLE_CLASS(CFileContentIterator): public MContentIterator sl@0: { sl@0: public: sl@0: /** Create a content iterator for a particular path in the file system sl@0: @param aPath The path to search under sl@0: @param aRecursive Whether to explore sub-directories under the given path sl@0: @param aMimeType The mime type to search for. Finds content objects of any mime types if this parameter is omitted sl@0: @leave KErrNotFound If no suitable content objects were found inside the given path sl@0: */ sl@0: static CFileContentIterator* NewL(const TDesC& aPath, TBool aRecursive, const TDesC8& aMimeType); sl@0: sl@0: virtual ~CFileContentIterator(); sl@0: sl@0: // MContentIterator sl@0: virtual const TDesC& FileName() const; sl@0: virtual const TDesC& UniqueId() const; sl@0: virtual const TDesC& Name() const; sl@0: virtual const TDesC8& MimeType() const; sl@0: virtual TInt Next(); sl@0: sl@0: sl@0: private: sl@0: CFileContentIterator(); sl@0: void ConstructL(const TDesC& aPath, TBool aRecursive, const TDesC8& aMimeType); sl@0: sl@0: // Manager for doing GetDir() sl@0: CManager* iManager; sl@0: sl@0: // Construction Parameters sl@0: HBufC* iPath; sl@0: TBool iRecursive; sl@0: HBufC8* iMimeType; sl@0: sl@0: CFileContentIteratorBase* iSubIterator; sl@0: }; sl@0: sl@0: } sl@0: sl@0: #endif