epoc32/include/mw/aknlistboxlayoutdecorator.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     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
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description: 
williamr@2
    15
*     Decorates a descriptor array to include tabs suitable for list box formatting
williamr@2
    16
*     
williamr@2
    17
*
williamr@2
    18
*/
williamr@2
    19
williamr@2
    20
// AknListboxLayoutDecorator.h
williamr@2
    21
//
williamr@2
    22
// 1999-2001 Symbian Ltd.  All rights reserved.
williamr@2
    23
//
williamr@2
    24
williamr@2
    25
#ifndef __AKNLISTBOXLAYOUTDECORATOR_H__
williamr@2
    26
#define __AKNLISTBOXLAYOUTDECORATOR_H__
williamr@2
    27
williamr@2
    28
#include <bamdesca.h>
williamr@2
    29
williamr@2
    30
NONSHARABLE_CLASS(CAknListBoxLayoutDecorator) : public CBase, public MDesCArray
williamr@2
    31
	{
williamr@2
    32
public:
williamr@2
    33
	/**
williamr@2
    34
	 * Factory function
williamr@2
    35
	 */
williamr@2
    36
	IMPORT_C static CAknListBoxLayoutDecorator* NewL();
williamr@2
    37
williamr@2
    38
	/**
williamr@2
    39
	 * Factory function
williamr@2
    40
	 */
williamr@2
    41
	IMPORT_C static CAknListBoxLayoutDecorator* NewLC();
williamr@2
    42
williamr@2
    43
	/**
williamr@2
    44
	 * Destructor
williamr@2
    45
	 */
williamr@2
    46
	IMPORT_C ~CAknListBoxLayoutDecorator();
williamr@2
    47
williamr@2
    48
	/**
williamr@2
    49
	 * get the array
williamr@2
    50
	 *
williamr@2
    51
	 * @return pointer to array - ownership is not passed
williamr@2
    52
	 */
williamr@2
    53
	IMPORT_C const MDesCArray* Array() const;
williamr@2
    54
williamr@2
    55
	/**
williamr@2
    56
	 * set the array
williamr@2
    57
	 *
williamr@2
    58
	 * @param aArray pointer to array - ownership is not passed
williamr@2
    59
	 */
williamr@2
    60
	IMPORT_C void SetArray(const MDesCArray* aArray);
williamr@2
    61
williamr@2
    62
	/**
williamr@2
    63
	 * set the text that will be inserted before the text from the descriptor array entry
williamr@2
    64
	 *
williamr@2
    65
	 * @param aText descriptor to insert before each entry
williamr@2
    66
	 *
williamr@2
    67
	 */
williamr@2
    68
	IMPORT_C void SetLeadingDecorationTextL(const TDesC& aText);
williamr@2
    69
williamr@2
    70
	/**
williamr@2
    71
	 * set the text that will be inserted after the text from the descriptor array entry
williamr@2
    72
	 *
williamr@2
    73
	 * @param aText descriptor to append after each entry
williamr@2
    74
	 *
williamr@2
    75
	 */
williamr@2
    76
	IMPORT_C void SetTrailingDecorationTextL(const TDesC& aText);
williamr@2
    77
williamr@2
    78
	/**
williamr@2
    79
	 * set the decoration to be active or inactive
williamr@2
    80
	 *
williamr@2
    81
	 * @param aActive if ETrue, decoration will be added; if EFalse, layout will be unchanged
williamr@2
    82
	 *
williamr@2
    83
	 */
williamr@2
    84
	IMPORT_C void SetActive(const TBool aActive);
williamr@2
    85
public:
williamr@2
    86
	// from MDesCArray
williamr@2
    87
	/**
williamr@2
    88
	 * Pass count through straight from contained descriptor array
williamr@2
    89
	 * 
williamr@2
    90
	 * @return number of items in array
williamr@2
    91
	 */
williamr@2
    92
	IMPORT_C virtual TInt MdcaCount() const;
williamr@2
    93
williamr@2
    94
	/**
williamr@2
    95
	 * Modify contents of descriptor to contain additional formatting for list box style. 
williamr@2
    96
	 * Original string will be truncated in favour of formatting in low memory conditions.
williamr@2
    97
	 * 
williamr@2
    98
	 * @return descriptor pointer containing modified string - WARNING contents of
williamr@2
    99
	 * this return value will be replaced next time this method is called!
williamr@2
   100
	 */
williamr@2
   101
	IMPORT_C virtual TPtrC MdcaPoint(TInt aIndex) const;		
williamr@2
   102
private: // Reserved for future expansion
williamr@2
   103
	/**
williamr@2
   104
	 * Reserve slot in vtable for future use
williamr@2
   105
	 */
williamr@2
   106
	IMPORT_C virtual void CAknListBoxLayoutDecorator_Reserved1();
williamr@2
   107
williamr@2
   108
	/**
williamr@2
   109
	 * Reserve slot in vtable for future use
williamr@2
   110
	 */
williamr@2
   111
	IMPORT_C virtual void CAknListBoxLayoutDecorator_Reserved1() const;
williamr@2
   112
protected:
williamr@2
   113
	/**
williamr@2
   114
	 * Constructor, 1st phase of construction
williamr@2
   115
	 */
williamr@2
   116
	CAknListBoxLayoutDecorator();
williamr@2
   117
	/**
williamr@2
   118
	 * ConstructL, 2nd phase of construction
williamr@2
   119
	 */
williamr@2
   120
	void ConstructL();
williamr@2
   121
protected:
williamr@2
   122
	enum {KSafeSizeOfDescriptor = 32};
williamr@2
   123
private:
williamr@2
   124
	// owned
williamr@2
   125
	mutable HBufC* iLastGeneratedTextValue;
williamr@2
   126
	// not owned:
williamr@2
   127
	const MDesCArray* iArray;
williamr@2
   128
	TPtrC iLeadingDecorationText;
williamr@2
   129
	TPtrC iTrailingDecorationText;
williamr@2
   130
	TBool iActive;
williamr@2
   131
private:
williamr@2
   132
	__DECLARE_TEST;
williamr@2
   133
	};
williamr@2
   134
williamr@2
   135
#endif //__AKNLISTBOXLAYOUTDECORATOR_H__