os/security/contentmgmt/referencedrmagent/contentiterator/EmbeddedcontentIteratorBase.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/contentmgmt/referencedrmagent/contentiterator/EmbeddedcontentIteratorBase.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,95 @@
1.4 +/*
1.5 +* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +/**
1.23 + @file
1.24 + @internalComponent
1.25 + @released
1.26 +*/
1.27 +
1.28 +
1.29 +#ifndef __CAF_EMBEDDEDCONTENTITERATORBASE_H__
1.30 +#define __CAF_EMBEDDEDCONTENTITERATORBASE_H__
1.31 +
1.32 +#include <e32base.h>
1.33 +
1.34 +#include "StreamablePtrArray.h"
1.35 +#include <caf/virtualpathptr.h>
1.36 +
1.37 +namespace ContentAccess
1.38 + {
1.39 + class CContent;
1.40 + class CEmbeddedObject;
1.41 +
1.42 +
1.43 + /** Internal class for recursively searching through a particular content file
1.44 +
1.45 + Only ever created by CContentIteratorBase, CEmbeddedContetnIterator or itself
1.46 +
1.47 + @internalComponent
1.48 + @released
1.49 + */
1.50 + NONSHARABLE_CLASS(CEmbeddedContentIteratorBase) : public CBase
1.51 + {
1.52 + public:
1.53 + virtual ~CEmbeddedContentIteratorBase();
1.54 +
1.55 + CEmbeddedObject& EmbeddedObject();
1.56 + TInt Next();
1.57 +
1.58 + private:
1.59 + // Only ever created by one of these two or itself
1.60 + friend class CEmbeddedContentIterator;
1.61 + friend class CContentIteratorBase;
1.62 +
1.63 + /** Create a content iterator for a particular path in the file system
1.64 + @param aContent Already set up to look at the container we are interested in
1.65 + @param aRecursive Whether to explore sub-containers under the given path
1.66 + @param aMimeType The mime type to search for. Finds content objects of any mime types if this parameter is omitted
1.67 + @leave KErrNotFound If no suitable content objects were found inside the given path
1.68 + */
1.69 + static CEmbeddedContentIteratorBase* NewL(CContent& aContent, TBool aRecursive, const TDesC8& aMimeType);
1.70 +
1.71 + CEmbeddedContentIteratorBase(CContent& aContent, TBool aRecursive, const TDesC8& aMimeType );
1.72 + void ConstructL();
1.73 +
1.74 + // Construction parameters
1.75 + CContent& iContent;
1.76 + TBool iRecursive;
1.77 + const TDesC8& iMimeType;
1.78 +
1.79 + // Index into the list of embedded content objects
1.80 + TInt iContentIndex;
1.81 +
1.82 + // Index into the list of embedded container objects
1.83 + TInt iContainerIndex;
1.84 +
1.85 + // Objects inside the current container within the specificed file
1.86 + RStreamablePtrArray<CEmbeddedObject> iEmbeddedContentObjects;
1.87 +
1.88 + // Container Objects inside the current container within the specified file
1.89 + RStreamablePtrArray<CEmbeddedObject> iEmbeddedContainerObjects;
1.90 +
1.91 + // Used for looking inside sub-containers
1.92 + CEmbeddedContentIteratorBase* iSubIterator;
1.93 + };
1.94 +
1.95 +
1.96 + }
1.97 +
1.98 +#endif