2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Used to decorate an MDesCArray with an extra entry.
21 // AknDesCArrayDecorator.h
23 // 2001 Symbian Ltd. All rights reserved.
26 #ifndef __AKNDESCARRAYDECORATOR_H__
27 #define __AKNDESCARRAYDECORATOR_H__
31 class TAknDesCArrayDecorator : public MDesCArray
38 IMPORT_C TAknDesCArrayDecorator();
41 * Set pointer to descriptor array that will be decorated.
43 * @param aArray pointer to descriptor array, ownership is not passed
45 IMPORT_C void SetArray(const MDesCArray* aArray);
48 * Set descriptor containing text that will be used as the extra entry in the descriptor array.
49 * The client retains ownership of the descriptor containing the decoration text, and therefore
50 * can use the same descriptor text for multiple decorator instances. The client must
51 * maintain the descriptor for the lifetime of the decorator.
53 * @param aText descriptor, ownership is not passed
55 IMPORT_C void SetDecorationText(const TDesC& aText);
58 * Set the decorator's activation state. If active, the decorator adds the decoration to
59 * the array, otherwise it does not.
61 * @param aActive ETrue = active; EFalse = inactive
63 IMPORT_C void SetActive(const TBool aActive);
66 * Reports whether the supplied index position corresponds to the decoration entry
68 * <p> Note that the client must call this method on each instance of
69 * TAknDesCArrayDecorator in the recursive containment (if it is not part of the
70 * MDesCArray interface).
72 * @param aIndex output parameter, contains index in array of the decorated
73 * position, only valid if return value is ETrue
74 * @return ETrue if there is a decorated position, EFalse otherwise
76 IMPORT_C TBool DecoratedIndex(TInt& aIndex) const;
77 public: // from MDesCArray
79 * Reports count of decorated array
81 * @return count of decorated array
83 IMPORT_C virtual TInt MdcaCount() const;
86 * Returns array element.
87 * Returns decoration text if the index is one off the end of the decorated array
89 * @param index of element to return
90 * @return descriptor representing array element
92 IMPORT_C virtual TPtrC MdcaPoint(TInt aIndex) const;
94 // the following members are not owned
95 const MDesCArray* iArray;
102 #endif //__AKNDESCARRAYDECORATOR_H__