phonebookengines/cntsortplugin/src/csortkeyarray.h
changeset 49 74b30151afd6
parent 25 76a2435edfd4
equal deleted inserted replaced
47:7cbcb2896f0e 49:74b30151afd6
       
     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 *     Sort key array for Contact model ECOM sort plugin.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __CSortKeyArray_H__
       
    21 #define __CSortKeyArray_H__
       
    22 
       
    23 // INCLUDES
       
    24 #include <SortUtil.h>
       
    25 
       
    26 // CLASS DESCRIPTION
       
    27 /**
       
    28  * Sort key array for Contact model ECOM sort plugin.
       
    29  */
       
    30 class CSortKeyArray : public CBase, 
       
    31                       public MSortKeyArray
       
    32     {
       
    33     public:
       
    34         /**
       
    35          * Static constructor.
       
    36          * @return Newly created instance of this class.
       
    37          */
       
    38         static CSortKeyArray* NewL();
       
    39 
       
    40         /**
       
    41          * Standard c++ destructor.
       
    42          */
       
    43         ~CSortKeyArray();
       
    44 
       
    45     public: // Interface
       
    46         /**
       
    47          * Appends new sortkey to the array.
       
    48          * @param aKey New sortkey to append.
       
    49          */
       
    50         void AppendL(const TSortKey& aKey);
       
    51 
       
    52         /**
       
    53          * Resets the sortkey array.
       
    54          */
       
    55         void Reset();
       
    56 
       
    57         /**
       
    58          * Sets the text of the key in specified index.
       
    59          * @param aText The text to set to key in index.
       
    60          * @param aIndex The index where the key to be modified is.
       
    61          */
       
    62         void SetText(const TDesC& aText, TInt aIndex);
       
    63 
       
    64     public:  // from MSortKeyArray
       
    65         TInt SortKeyCount() const;
       
    66         TSortKey SortKeyAt(TInt aIndex) const;
       
    67         
       
    68     private:
       
    69         /**
       
    70          * C++ constructor.
       
    71          */
       
    72         CSortKeyArray();
       
    73 
       
    74     private:  // Data
       
    75         /// Own: Array of key types.
       
    76         RArray<TSortKeyType> iKeyTypes;
       
    77         /// Own: Array of texts that correspond to types in array iKeyTypes.
       
    78         RArray<TPtrC> iTexts;
       
    79     };
       
    80 
       
    81 #endif // __CSortKeyArray_H__
       
    82 
       
    83 // End of File