usbmgmt/usbmgr/device/classcontroller/public/CUsbClassControllerIterator.h
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 1997-2009 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 "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 * Defines a helper class used to iterate over a set of USB classes.
       
    16 *
       
    17 */
       
    18 
       
    19 /**
       
    20  @file
       
    21 */
       
    22 
       
    23 #ifndef __CUSBCLASSCONTROLLERITERATOR_H__
       
    24 #define __CUSBCLASSCONTROLLERITERATOR_H__
       
    25 
       
    26 #include <e32base.h>
       
    27 
       
    28 class CUsbClassControllerBase;
       
    29 
       
    30 /** This class is used by CUsbDevice and potentially 
       
    31  * CUsbClassControllerBase-derived classes to iterate over a collection of 
       
    32  * CUsbClassControllerBase objects.
       
    33 
       
    34   @publishedPartner
       
    35   @released
       
    36  */
       
    37 NONSHARABLE_CLASS(CUsbClassControllerIterator) : public CBase
       
    38 	{
       
    39 public:
       
    40 	/** Constructor
       
    41 		@param aClassControllerArray Array of class controllers.
       
    42 		*/
       
    43 	IMPORT_C CUsbClassControllerIterator(RPointerArray<CUsbClassControllerBase>& aClassControllerArray);
       
    44 
       
    45 	/** Destructor.
       
    46 	*/
       
    47 	IMPORT_C ~CUsbClassControllerIterator();
       
    48 
       
    49 	/** First
       
    50 		Sets the iterator to the first class controller.
       
    51 		@return Error.
       
    52 		*/
       
    53 	IMPORT_C TInt First();
       
    54 
       
    55 	/** Next
       
    56 		Sets the iterator to the next class controller.
       
    57 		@return Error.
       
    58 		*/
       
    59 	IMPORT_C TInt Next();
       
    60 
       
    61 	/** Previous
       
    62 		Sets the iterator to the previous class controller.
       
    63 		@return Error.
       
    64 		*/
       
    65 	IMPORT_C TInt Previous();
       
    66 
       
    67 	/** Seek
       
    68 		Sets the current class controller to that given, if it's in the array.
       
    69 		@param aClassController The class controller we want to find.
       
    70 		@return Error.
       
    71 		*/
       
    72 	IMPORT_C TInt Seek(CUsbClassControllerBase* aClassController);
       
    73 
       
    74 	/** Current
       
    75 		@return The current class controller. Does not return ownership.
       
    76 		*/
       
    77 	IMPORT_C CUsbClassControllerBase* Current();
       
    78 
       
    79 private:
       
    80 	/**
       
    81 		The array of class controllers.
       
    82 		*/
       
    83 	RPointerArray<CUsbClassControllerBase>& iClassControllerArray;
       
    84 
       
    85 	/**
       
    86 		Index of current class controller.
       
    87 		*/
       
    88 	TInt iClassControllerIndex;
       
    89 	};
       
    90 
       
    91 
       
    92 #endif //__CUSBCLASSCONTROLLERITERATOR_H__