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 "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Decorates a descriptor array to include tabs suitable for list box formatting
20 // AknListboxLayoutDecorator.h
22 // 1999-2001 Symbian Ltd. All rights reserved.
25 #ifndef __AKNLISTBOXLAYOUTDECORATOR_H__
26 #define __AKNLISTBOXLAYOUTDECORATOR_H__
30 NONSHARABLE_CLASS(CAknListBoxLayoutDecorator) : public CBase, public MDesCArray
36 IMPORT_C static CAknListBoxLayoutDecorator* NewL();
41 IMPORT_C static CAknListBoxLayoutDecorator* NewLC();
46 IMPORT_C ~CAknListBoxLayoutDecorator();
51 * @return pointer to array - ownership is not passed
53 IMPORT_C const MDesCArray* Array() const;
58 * @param aArray pointer to array - ownership is not passed
60 IMPORT_C void SetArray(const MDesCArray* aArray);
63 * set the text that will be inserted before the text from the descriptor array entry
65 * @param aText descriptor to insert before each entry
68 IMPORT_C void SetLeadingDecorationTextL(const TDesC& aText);
71 * set the text that will be inserted after the text from the descriptor array entry
73 * @param aText descriptor to append after each entry
76 IMPORT_C void SetTrailingDecorationTextL(const TDesC& aText);
79 * set the decoration to be active or inactive
81 * @param aActive if ETrue, decoration will be added; if EFalse, layout will be unchanged
84 IMPORT_C void SetActive(const TBool aActive);
88 * Pass count through straight from contained descriptor array
90 * @return number of items in array
92 IMPORT_C virtual TInt MdcaCount() const;
95 * Modify contents of descriptor to contain additional formatting for list box style.
96 * Original string will be truncated in favour of formatting in low memory conditions.
98 * @return descriptor pointer containing modified string - WARNING contents of
99 * this return value will be replaced next time this method is called!
101 IMPORT_C virtual TPtrC MdcaPoint(TInt aIndex) const;
102 private: // Reserved for future expansion
104 * Reserve slot in vtable for future use
106 IMPORT_C virtual void CAknListBoxLayoutDecorator_Reserved1();
109 * Reserve slot in vtable for future use
111 IMPORT_C virtual void CAknListBoxLayoutDecorator_Reserved1() const;
114 * Constructor, 1st phase of construction
116 CAknListBoxLayoutDecorator();
118 * ConstructL, 2nd phase of construction
122 enum {KSafeSizeOfDescriptor = 32};
125 mutable HBufC* iLastGeneratedTextValue;
127 const MDesCArray* iArray;
128 TPtrC iLeadingDecorationText;
129 TPtrC iTrailingDecorationText;
135 #endif //__AKNLISTBOXLAYOUTDECORATOR_H__