CCoeControlArray::TCursor Class Reference

#include <mw/coecontrolarray.h>

Link against: cone.lib

class CCoeControlArray::TCursor
Public Member Functions
TCursor(const CCoeControlArray &, TInt)
T *Control()
const T *Control()
TInt Index()
IMPORT_C TBoolIsValid()
IMPORT_C TBoolNext()
IMPORT_C TBoolPrev()
IMPORT_C TBooloperator!=(const TCursor &)
IMPORT_C TBooloperator==(const TCursor &)

Detailed Description

This class is an iterator for the CCoeControlArray class.

Constructor & Destructor Documentation

TCursor ( const CCoeControlArray &, TInt )

TCursor(const CCoeControlArray &aArray,
TIntaIndex
)

Constructor.

ParameterDescription
aArrayThe array
aIndexThe index into the array

Member Function Documentation

Control ( )

T *Control()

Gets the control.

Returns: The control at the current cursor position.

Control ( )

const T *Control()const

Gets the control.

Returns: The control at the current cursor position.

Index ( )

TInt Index()const

Gets the index of the cursor.

Returns: The index i.e. the position in the array

IsValid ( )

IMPORT_C TBoolIsValid()const

Checks if the cursor is valid. Use this to replace the comparison with NULL that you would do with pointers. This function is typically used on the cursors returned by the find operations.

Returns: ETrue if the cursor points to a control, EFalse otherwise

Next ( )

IMPORT_C TBoolNext()

Updates the cursor so that it points to the next element in the array. If the current element is the last one then this function returns EFalse.

Returns: EFalse if the current element was the last one in the array, ETrue otherwise

Prev ( )

IMPORT_C TBoolPrev()

Updates the cursor so that it points to the previous element in the array. If the current element is the first one then this function does nothing and returns EFalse.

Returns: EFalse if the current element was the first one in the array, ETrue if it wasn't and the function actually did something.

operator!= ( const TCursor & )

IMPORT_C TBooloperator!=(const TCursor &aCursor)const

Checks if the cursors are different. Cursors are equal if they point to the same control in the same array else they are different.

ParameterDescription
aCursorThe other cursor.

Returns: EFalse if the cursors point to the same position in the same array, EFalse otherwise.

operator== ( const TCursor & )

IMPORT_C TBooloperator==(const TCursor &aCursor)const

Checks if the cursors are equal. Cursors are equal if they point to the same control in the same array else they are different.

ParameterDescription
aCursorThe other cursor.

Returns: ETrue if the cursors point to the same position in the same array, EFalse otherwise.