epoc32/include/mw/akndescarraydecorator.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/akndescarraydecorator.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/akndescarraydecorator.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,102 @@
     1.4 -akndescarraydecorator.h
     1.5 +/*
     1.6 +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description: 
    1.19 +*     Used to decorate an MDesCArray with an extra entry.
    1.20 +*     
    1.21 +*     
    1.22 +*
    1.23 +*/
    1.24 +
    1.25 +// AknDesCArrayDecorator.h
    1.26 +//
    1.27 +// 2001 Symbian Ltd.  All rights reserved.
    1.28 +//
    1.29 +
    1.30 +#ifndef __AKNDESCARRAYDECORATOR_H__
    1.31 +#define __AKNDESCARRAYDECORATOR_H__
    1.32 +
    1.33 +#include <bamdesca.h>
    1.34 +
    1.35 +class TAknDesCArrayDecorator : public MDesCArray
    1.36 +	{
    1.37 +public:
    1.38 +	/**
    1.39 +	 * Constructor
    1.40 +	 * 
    1.41 +	 */
    1.42 +	IMPORT_C TAknDesCArrayDecorator();
    1.43 +public:
    1.44 +	/**
    1.45 +	 * Set pointer to descriptor array that will be decorated. 
    1.46 +	 * 
    1.47 +	 * @param aArray	pointer to descriptor array, ownership is not passed
    1.48 +	 */
    1.49 +	IMPORT_C void SetArray(const MDesCArray* aArray);
    1.50 +
    1.51 +	/**
    1.52 +	 * Set descriptor containing text that will be used as the extra entry in the descriptor array.
    1.53 +	 * The client retains ownership of the descriptor containing the decoration text, and therefore
    1.54 +	 * can use the same descriptor text for multiple decorator instances. The client must 
    1.55 +	 * maintain the descriptor for the lifetime of the decorator.
    1.56 +	 * 
    1.57 +	 * @param aText	descriptor, ownership is not passed
    1.58 +	 */
    1.59 +	IMPORT_C void SetDecorationText(const TDesC& aText);
    1.60 +
    1.61 +	/**
    1.62 +	 * Set the decorator's activation state. If active, the decorator adds the decoration to 
    1.63 +	 * the array, otherwise it does not.
    1.64 +	 * 
    1.65 +	 * @param aActive	ETrue = active; EFalse = inactive
    1.66 +	 */
    1.67 +	IMPORT_C void SetActive(const TBool aActive);
    1.68 +
    1.69 +	/**
    1.70 +	 * Reports whether the supplied index position corresponds to the decoration entry 
    1.71 +	 * in the array. 
    1.72 +	 * <p> Note that the client must call this method on each instance of 
    1.73 +	 * TAknDesCArrayDecorator in the recursive containment (if it is not part of the 
    1.74 +	 * MDesCArray interface). 
    1.75 +	 *
    1.76 +	 * @param aIndex		output parameter, contains index in array of the decorated 
    1.77 +	 *									position, only valid if return value is ETrue
    1.78 +	 * @return				ETrue if there is a decorated position, EFalse otherwise
    1.79 +	 */
    1.80 +	IMPORT_C TBool DecoratedIndex(TInt& aIndex) const;
    1.81 +public: // from MDesCArray
    1.82 +	/**
    1.83 +	 * Reports count of decorated array
    1.84 +	 *
    1.85 +	 * @return count of decorated array
    1.86 +	 */
    1.87 +    IMPORT_C virtual TInt MdcaCount() const;
    1.88 +
    1.89 +	/**
    1.90 +	 * Returns array element. 
    1.91 +	 * Returns decoration text if the index is one off the end of the decorated array
    1.92 +	 *
    1.93 +	 * @param index of element to return
    1.94 +	 * @return descriptor representing array element
    1.95 +	 */
    1.96 +    IMPORT_C virtual TPtrC MdcaPoint(TInt aIndex) const;
    1.97 +private:
    1.98 +	// the following members are not owned
    1.99 +	const MDesCArray* iArray;
   1.100 +	TPtrC iText;
   1.101 +	TBool iActive;
   1.102 +	
   1.103 +	__DECLARE_TEST;
   1.104 +	};
   1.105 +
   1.106 +#endif //__AKNDESCARRAYDECORATOR_H__