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: * Decorates a descriptor array to include tabs suitable for list box formatting williamr@2: * williamr@2: * williamr@2: */ williamr@2: williamr@2: // AknListboxLayoutDecorator.h williamr@2: // williamr@2: // 1999-2001 Symbian Ltd. All rights reserved. williamr@2: // williamr@2: williamr@2: #ifndef __AKNLISTBOXLAYOUTDECORATOR_H__ williamr@2: #define __AKNLISTBOXLAYOUTDECORATOR_H__ williamr@2: williamr@2: #include williamr@2: williamr@2: NONSHARABLE_CLASS(CAknListBoxLayoutDecorator) : public CBase, public MDesCArray williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Factory function williamr@2: */ williamr@2: IMPORT_C static CAknListBoxLayoutDecorator* NewL(); williamr@2: williamr@2: /** williamr@2: * Factory function williamr@2: */ williamr@2: IMPORT_C static CAknListBoxLayoutDecorator* NewLC(); williamr@2: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C ~CAknListBoxLayoutDecorator(); williamr@2: williamr@2: /** williamr@2: * get the array williamr@2: * williamr@2: * @return pointer to array - ownership is not passed williamr@2: */ williamr@2: IMPORT_C const MDesCArray* Array() const; williamr@2: williamr@2: /** williamr@2: * set the array williamr@2: * williamr@2: * @param aArray pointer to array - ownership is not passed williamr@2: */ williamr@2: IMPORT_C void SetArray(const MDesCArray* aArray); williamr@2: williamr@2: /** williamr@2: * set the text that will be inserted before the text from the descriptor array entry williamr@2: * williamr@2: * @param aText descriptor to insert before each entry williamr@2: * williamr@2: */ williamr@2: IMPORT_C void SetLeadingDecorationTextL(const TDesC& aText); williamr@2: williamr@2: /** williamr@2: * set the text that will be inserted after the text from the descriptor array entry williamr@2: * williamr@2: * @param aText descriptor to append after each entry williamr@2: * williamr@2: */ williamr@2: IMPORT_C void SetTrailingDecorationTextL(const TDesC& aText); williamr@2: williamr@2: /** williamr@2: * set the decoration to be active or inactive williamr@2: * williamr@2: * @param aActive if ETrue, decoration will be added; if EFalse, layout will be unchanged williamr@2: * williamr@2: */ williamr@2: IMPORT_C void SetActive(const TBool aActive); williamr@2: public: williamr@2: // from MDesCArray williamr@2: /** williamr@2: * Pass count through straight from contained descriptor array williamr@2: * williamr@2: * @return number of items in array williamr@2: */ williamr@2: IMPORT_C virtual TInt MdcaCount() const; williamr@2: williamr@2: /** williamr@2: * Modify contents of descriptor to contain additional formatting for list box style. williamr@2: * Original string will be truncated in favour of formatting in low memory conditions. williamr@2: * williamr@2: * @return descriptor pointer containing modified string - WARNING contents of williamr@2: * this return value will be replaced next time this method is called! williamr@2: */ williamr@2: IMPORT_C virtual TPtrC MdcaPoint(TInt aIndex) const; williamr@2: private: // Reserved for future expansion williamr@2: /** williamr@2: * Reserve slot in vtable for future use williamr@2: */ williamr@2: IMPORT_C virtual void CAknListBoxLayoutDecorator_Reserved1(); williamr@2: williamr@2: /** williamr@2: * Reserve slot in vtable for future use williamr@2: */ williamr@2: IMPORT_C virtual void CAknListBoxLayoutDecorator_Reserved1() const; williamr@2: protected: williamr@2: /** williamr@2: * Constructor, 1st phase of construction williamr@2: */ williamr@2: CAknListBoxLayoutDecorator(); williamr@2: /** williamr@2: * ConstructL, 2nd phase of construction williamr@2: */ williamr@2: void ConstructL(); williamr@2: protected: williamr@2: enum {KSafeSizeOfDescriptor = 32}; williamr@2: private: williamr@2: // owned williamr@2: mutable HBufC* iLastGeneratedTextValue; williamr@2: // not owned: williamr@2: const MDesCArray* iArray; williamr@2: TPtrC iLeadingDecorationText; williamr@2: TPtrC iTrailingDecorationText; williamr@2: TBool iActive; williamr@2: private: williamr@2: __DECLARE_TEST; williamr@2: }; williamr@2: williamr@2: #endif //__AKNLISTBOXLAYOUTDECORATOR_H__