diff -r 000000000000 -r 1bce908db942 multimediacommscontroller/mmcccontroller/inc/mccresourceiterators.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multimediacommscontroller/mmcccontroller/inc/mccresourceiterators.h Tue Feb 02 01:04:58 2010 +0200 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + + +#ifndef MCCRESOURCEITERATORS_H +#define MCCRESOURCEITERATORS_H + +#include + +class CMccResourceContainer; +class CMccResourceItem; +class TMccResourceParams; + +enum TMccIteratorMatchType + { + ExactMatch, + ExactReverseMatch + }; + + +/** + * Resource container iterator. + * + * @lib + */ +class TMccResourceContainerIterator + { + public: // Constructors & Destructor + + TMccResourceContainerIterator( const RPointerArray& aContainers ); + + TMccResourceContainerIterator( const RPointerArray& aContainers, + TMccResourceParams& aResourceParams ); + + TMccResourceContainerIterator( const RPointerArray& aContainers, + TUint32 aEndpointId ); + + public: // new functions + + TBool Next( CMccResourceContainer*& aCandidate, + TMccIteratorMatchType aMatchType = ExactMatch ); + + void Reset(); + + TInt Current(); + + TBool IsEof(); + + TInt Delete( RPointerArray& aContainers ); + + private: // NOT owned data + + const RPointerArray& iContainers; + + TInt iCurrentIndex; + + TMccResourceParams* iResourceParams; + + TUint32 iEndpointId; + + }; + +/** + * Resource item iterator. + * + * @lib + */ +class TMccResourceItemIterator + { + public: // Constructors & Destructor + + TMccResourceItemIterator( + const RPointerArray& aItems, + TBool aOnlyInternals = EFalse, + TBool aOnlySinks = EFalse, + TBool aOnlySources = EFalse ); + + TMccResourceItemIterator( + const RPointerArray& aItems, + TUid aUid ); + + TMccResourceItemIterator( + const RPointerArray& aItems, + TUid aUid, + TMccResourceParams& aResourceParams ); + + TMccResourceItemIterator( + const RPointerArray& aItems, + TMccResourceParams& aResourceParams ); + + TMccResourceItemIterator( + const RPointerArray& aItems, + TUint32 aEndpointId ); + + public: // new functions + + TBool Next( CMccResourceItem*& aCandidate, + TMccIteratorMatchType aMatchType = ExactMatch ); + + void Reset(); + + TInt Current(); + + TBool IsEof(); + + private: // NOT owned data + + const RPointerArray& iItems; + + TInt iCurrentIndex; + + TBool iOnlyInternals; + + TBool iOnlySinks; + + TBool iOnlySources; + + TUid iUid; + + TMccResourceParams* iResourceParams; + + TUint32 iEndpointId; + + }; + +#endif //MCCRESOURCEITERATORS_H +