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