epoc32/include/mw/akndescarraydecorator.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
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *     Used to decorate an MDesCArray with an extra entry.
    16 *     
    17 *     
    18 *
    19 */
    20 
    21 // AknDesCArrayDecorator.h
    22 //
    23 // 2001 Symbian Ltd.  All rights reserved.
    24 //
    25 
    26 #ifndef __AKNDESCARRAYDECORATOR_H__
    27 #define __AKNDESCARRAYDECORATOR_H__
    28 
    29 #include <bamdesca.h>
    30 
    31 class TAknDesCArrayDecorator : public MDesCArray
    32 	{
    33 public:
    34 	/**
    35 	 * Constructor
    36 	 * 
    37 	 */
    38 	IMPORT_C TAknDesCArrayDecorator();
    39 public:
    40 	/**
    41 	 * Set pointer to descriptor array that will be decorated. 
    42 	 * 
    43 	 * @param aArray	pointer to descriptor array, ownership is not passed
    44 	 */
    45 	IMPORT_C void SetArray(const MDesCArray* aArray);
    46 
    47 	/**
    48 	 * Set descriptor containing text that will be used as the extra entry in the descriptor array.
    49 	 * The client retains ownership of the descriptor containing the decoration text, and therefore
    50 	 * can use the same descriptor text for multiple decorator instances. The client must 
    51 	 * maintain the descriptor for the lifetime of the decorator.
    52 	 * 
    53 	 * @param aText	descriptor, ownership is not passed
    54 	 */
    55 	IMPORT_C void SetDecorationText(const TDesC& aText);
    56 
    57 	/**
    58 	 * Set the decorator's activation state. If active, the decorator adds the decoration to 
    59 	 * the array, otherwise it does not.
    60 	 * 
    61 	 * @param aActive	ETrue = active; EFalse = inactive
    62 	 */
    63 	IMPORT_C void SetActive(const TBool aActive);
    64 
    65 	/**
    66 	 * Reports whether the supplied index position corresponds to the decoration entry 
    67 	 * in the array. 
    68 	 * <p> Note that the client must call this method on each instance of 
    69 	 * TAknDesCArrayDecorator in the recursive containment (if it is not part of the 
    70 	 * MDesCArray interface). 
    71 	 *
    72 	 * @param aIndex		output parameter, contains index in array of the decorated 
    73 	 *									position, only valid if return value is ETrue
    74 	 * @return				ETrue if there is a decorated position, EFalse otherwise
    75 	 */
    76 	IMPORT_C TBool DecoratedIndex(TInt& aIndex) const;
    77 public: // from MDesCArray
    78 	/**
    79 	 * Reports count of decorated array
    80 	 *
    81 	 * @return count of decorated array
    82 	 */
    83     IMPORT_C virtual TInt MdcaCount() const;
    84 
    85 	/**
    86 	 * Returns array element. 
    87 	 * Returns decoration text if the index is one off the end of the decorated array
    88 	 *
    89 	 * @param index of element to return
    90 	 * @return descriptor representing array element
    91 	 */
    92     IMPORT_C virtual TPtrC MdcaPoint(TInt aIndex) const;
    93 private:
    94 	// the following members are not owned
    95 	const MDesCArray* iArray;
    96 	TPtrC iText;
    97 	TBool iActive;
    98 	
    99 	__DECLARE_TEST;
   100 	};
   101 
   102 #endif //__AKNDESCARRAYDECORATOR_H__