williamr@2: /* williamr@2: * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * Used to decorate an MDesCArray with an extra entry. williamr@2: * williamr@2: * williamr@2: * williamr@2: */ williamr@2: williamr@2: // AknDesCArrayDecorator.h williamr@2: // williamr@2: // 2001 Symbian Ltd. All rights reserved. williamr@2: // williamr@2: williamr@2: #ifndef __AKNDESCARRAYDECORATOR_H__ williamr@2: #define __AKNDESCARRAYDECORATOR_H__ williamr@2: williamr@2: #include williamr@2: williamr@2: class TAknDesCArrayDecorator : public MDesCArray williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Constructor williamr@2: * williamr@2: */ williamr@2: IMPORT_C TAknDesCArrayDecorator(); williamr@2: public: williamr@2: /** williamr@2: * Set pointer to descriptor array that will be decorated. williamr@2: * williamr@2: * @param aArray pointer to descriptor array, ownership is not passed williamr@2: */ williamr@2: IMPORT_C void SetArray(const MDesCArray* aArray); williamr@2: williamr@2: /** williamr@2: * Set descriptor containing text that will be used as the extra entry in the descriptor array. williamr@2: * The client retains ownership of the descriptor containing the decoration text, and therefore williamr@2: * can use the same descriptor text for multiple decorator instances. The client must williamr@2: * maintain the descriptor for the lifetime of the decorator. williamr@2: * williamr@2: * @param aText descriptor, ownership is not passed williamr@2: */ williamr@2: IMPORT_C void SetDecorationText(const TDesC& aText); williamr@2: williamr@2: /** williamr@2: * Set the decorator's activation state. If active, the decorator adds the decoration to williamr@2: * the array, otherwise it does not. williamr@2: * williamr@2: * @param aActive ETrue = active; EFalse = inactive williamr@2: */ williamr@2: IMPORT_C void SetActive(const TBool aActive); williamr@2: williamr@2: /** williamr@2: * Reports whether the supplied index position corresponds to the decoration entry williamr@2: * in the array. williamr@2: *

Note that the client must call this method on each instance of williamr@2: * TAknDesCArrayDecorator in the recursive containment (if it is not part of the williamr@2: * MDesCArray interface). williamr@2: * williamr@2: * @param aIndex output parameter, contains index in array of the decorated williamr@2: * position, only valid if return value is ETrue williamr@2: * @return ETrue if there is a decorated position, EFalse otherwise williamr@2: */ williamr@2: IMPORT_C TBool DecoratedIndex(TInt& aIndex) const; williamr@2: public: // from MDesCArray williamr@2: /** williamr@2: * Reports count of decorated array williamr@2: * williamr@2: * @return count of decorated array williamr@2: */ williamr@2: IMPORT_C virtual TInt MdcaCount() const; williamr@2: williamr@2: /** williamr@2: * Returns array element. williamr@2: * Returns decoration text if the index is one off the end of the decorated array williamr@2: * williamr@2: * @param index of element to return williamr@2: * @return descriptor representing array element williamr@2: */ williamr@2: IMPORT_C virtual TPtrC MdcaPoint(TInt aIndex) const; williamr@2: private: williamr@2: // the following members are not owned williamr@2: const MDesCArray* iArray; williamr@2: TPtrC iText; williamr@2: TBool iActive; williamr@2: williamr@2: __DECLARE_TEST; williamr@2: }; williamr@2: williamr@2: #endif //__AKNDESCARRAYDECORATOR_H__