epoc32/include/mw/eiklbm.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/eiklbm.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/eiklbm.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,123 @@
     1.4 -eiklbm.h
     1.5 +/*
     1.6 +* Copyright (c) 1997-1999 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 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +
    1.24 +#if !defined(__EIKLBM_H__)
    1.25 +#define __EIKLBM_H__  
    1.26 +
    1.27 +
    1.28 +#if !defined(__E32BASE_H__)
    1.29 +#include <e32base.h>
    1.30 +#endif
    1.31 +
    1.32 +#if !defined(__BAMDESCA_H__)
    1.33 +#include <bamdesca.h>
    1.34 +#endif
    1.35 +
    1.36 +
    1.37 +// for some reason, doxygen seems to refuse documenting this...
    1.38 +
    1.39 +/** @enum TListBoxModelItemArrayOwnership
    1.40 +* List box item array ownership flags. These values are used to
    1.41 +* describe whether or not a list box model owns an item array.
    1.42 +*/
    1.43 +enum TListBoxModelItemArrayOwnership
    1.44 +    {
    1.45 +    /** The list box model owns the item array, and will delete it in
    1.46 +    * its destructor.*/
    1.47 +    ELbmOwnsItemArray,
    1.48 +    /** The model does not own the item array. You must maintain a
    1.49 +    * pointer to it and free it explicitly before your program exits. */
    1.50 +    ELbmDoesNotOwnItemArray
    1.51 +    };
    1.52 +
    1.53 +/**
    1.54 +* Description
    1.55 +* List box data model interface.
    1.56 +* 
    1.57 +* This mixin protocol is implemented by all list box models. List box
    1.58 +* models provide information needed to display the required data in a
    1.59 +* list box.
    1.60 +*
    1.61 +* Writing derived classes:
    1.62 +* 
    1.63 +* This class should be implemented by anything providing data for
    1.64 +* display in a CEikListBox-derived class. The very basic interface
    1.65 +* offered by MListBoxModel is usually expanded upon to provide more
    1.66 +* information for the specialised subclasses of CEikListBox. It is
    1.67 +* usual when deriving specialised list boxes to subclass the list box
    1.68 +* class, its view classes and its model together. See also:
    1.69 +*
    1.70 +*/
    1.71 +class MListBoxModel 
    1.72 +    {
    1.73 +    public:
    1.74 +        /**
    1.75 +        * Destructor.
    1.76 +        */
    1.77 +        IMPORT_C virtual ~MListBoxModel();
    1.78 +
    1.79 +        /**
    1.80 +        * Gets the number of items in the list box
    1.81 +        * @return Number of items.
    1.82 +        */
    1.83 +        virtual TInt NumberOfItems() const = 0;
    1.84 +
    1.85 +        /**
    1.86 +        * Gets an array of strings used by the list box for matching
    1.87 +        * user keypresses incrementally.
    1.88 +        *
    1.89 +        * @return A pointer to the array.
    1.90 +        */
    1.91 +        virtual const MDesCArray* MatchableTextArray() const = 0;
    1.92 +
    1.93 +    private:
    1.94 +        IMPORT_C virtual TAny* MListBoxModel_Reserved();
    1.95 +    };
    1.96 +
    1.97 +/**
    1.98 +* Text list box model interface.
    1.99 +*
   1.100 +* Text list box models provide the text of the items which are drawn
   1.101 +* by an associated CTextListItemDrawer. This interface is implemented
   1.102 +* by CTextListBoxModel.
   1.103 +*/
   1.104 +
   1.105 +class MTextListBoxModel : public MListBoxModel
   1.106 +    {
   1.107 +    public:
   1.108 +        /**
   1.109 +        * Destructor
   1.110 +        */
   1.111 +        IMPORT_C ~MTextListBoxModel();
   1.112 +
   1.113 +        /**
   1.114 +        * Gets the item text for an item by its index. This text,
   1.115 +        * rather than the matcher string, is drawn by
   1.116 +        * CTextListItemDrawers.
   1.117 +        * 
   1.118 +        * @param aItemIndex Index specifying an item.
   1.119 +        * @return The text for that item.
   1.120 +        */
   1.121 +        virtual TPtrC ItemText(TInt aItemIndex) const = 0;
   1.122 +
   1.123 +    private: // from MListBoxModel
   1.124 +        IMPORT_C virtual TAny* MListBoxModel_Reserved();
   1.125 +    };
   1.126 +
   1.127 +#endif