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