os/security/contentmgmt/referencedrmagent/contentiterator/EmbeddedcontentIteratorBase.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.
     1 /*
     2 * Copyright (c) 2004-2010 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_EMBEDDEDCONTENTITERATORBASE_H__
    27 #define __CAF_EMBEDDEDCONTENTITERATORBASE_H__
    28 
    29 #include <e32base.h>
    30 
    31 #include "StreamablePtrArray.h"
    32 #include <caf/virtualpathptr.h>
    33 
    34 namespace ContentAccess 
    35 	{
    36 	class CContent;
    37 	class CEmbeddedObject;
    38 
    39 
    40 	/** Internal class for recursively searching through a particular content file
    41 
    42 	Only ever created by CContentIteratorBase, CEmbeddedContetnIterator or itself
    43 
    44 	@internalComponent
    45 	@released
    46 	*/
    47 	NONSHARABLE_CLASS(CEmbeddedContentIteratorBase) : public CBase
    48 		{
    49 	public:
    50 		virtual ~CEmbeddedContentIteratorBase();
    51 
    52 		CEmbeddedObject& EmbeddedObject();
    53 		TInt Next();
    54 
    55 	private:
    56 		// Only ever created by one of these two or itself
    57 		friend class CEmbeddedContentIterator;
    58 		friend class CContentIteratorBase;
    59 
    60 		/** Create a content iterator for a particular path in the file system
    61 		@param aContent Already set up to look at the container we are interested in
    62 		@param aRecursive Whether to explore sub-containers under the given path
    63 		@param aMimeType The mime type to search for. Finds content objects of any mime types if this parameter is omitted
    64 		@leave KErrNotFound If no suitable content objects were found inside the given path
    65 		*/
    66 		static CEmbeddedContentIteratorBase* NewL(CContent& aContent, TBool aRecursive, const TDesC8& aMimeType);
    67 
    68 		CEmbeddedContentIteratorBase(CContent& aContent, TBool aRecursive, const TDesC8& aMimeType );
    69 		void ConstructL();
    70 
    71 		// Construction parameters
    72 		CContent& iContent;
    73 		TBool iRecursive;
    74 		const TDesC8& iMimeType;
    75 
    76 		// Index into the list of embedded content objects
    77 		TInt iContentIndex;
    78 		
    79 		// Index into the list of embedded container objects
    80 		TInt iContainerIndex;
    81 		
    82 		// Objects inside the current container within the specificed file
    83 		RStreamablePtrArray<CEmbeddedObject> iEmbeddedContentObjects;
    84 
    85 		// Container Objects inside the current container within the specified file
    86 		RStreamablePtrArray<CEmbeddedObject> iEmbeddedContainerObjects;
    87 
    88 		// Used for looking inside sub-containers
    89 		CEmbeddedContentIteratorBase* iSubIterator;
    90 		};
    91 
    92 
    93 	}
    94 
    95 #endif