phonebookengines/cntsortplugin/src/ccntsortplugin.h
changeset 81 640d30f4fb64
parent 77 c18f9fa7f42e
child 84 63017c97b1d6
equal deleted inserted replaced
77:c18f9fa7f42e 81:640d30f4fb64
     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 *     Contact model ECOM sort plugin
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __CCntSortPlugin_H__
       
    21 #define __CCntSortPlugin_H__
       
    22 
       
    23 // INCLUDES
       
    24 #include <cntviewsortplugin.h>
       
    25 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    26 #include <cntviewsortpluginbase.h>
       
    27 #endif 
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CSortUtil;
       
    31 class CSortKeyArray;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * This class implements the functionality promised by 
       
    37  * the CViewContactSortInterfaceDefinition definition class.
       
    38  */
       
    39 class CCntSortPlugin : public CViewContactSortPlugin
       
    40     {
       
    41     public: // Construction / Destruction
       
    42         /**
       
    43          * Two phase static constructor.
       
    44          * @param aParams Parameters for construction.
       
    45          * @return Newly created instance of CCntSortPlugin.
       
    46          */
       
    47         static CCntSortPlugin* NewL(TAny* aParams);
       
    48         ~CCntSortPlugin();
       
    49 
       
    50     private:	// From CContactViewSortConfigInterface
       
    51         void SetSortOrderL(const RContactViewSortOrder& aViewSortOrder);
       
    52         TInt SortStart(TSortStartTypes aSortStartType, TInt aCount);
       
    53         void SortCompleted();
       
    54         TInt SortCompareViewContactsL
       
    55             (const CViewContact& aLhs, const CViewContact& aRhs);
       
    56         TInt ApiCompareViewContactsL
       
    57             (const CViewContact& aLhs, const CViewContact& aRhs);
       
    58         TInt CompareViewContactsL(const CViewContact& aLhs, const CViewContact& aRhs);
       
    59         TBool ViewContactIsSortable(const CViewContact& aViewContact);
       
    60 
       
    61     private: // Implementation
       
    62         /**
       
    63          * Standard C++ constructor.
       
    64          */
       
    65         CCntSortPlugin();
       
    66 
       
    67         /**
       
    68          * 2nd phase constructor.
       
    69          */
       
    70         void ConstructL(TSortPluginParams* aParams);
       
    71 
       
    72         /**
       
    73          * Do the actual sort starting.
       
    74          * @param aSortStartType Type of the sort to start.
       
    75          * @param aCount Approximate number of contacts to process.
       
    76          */
       
    77         void DoSortStartL(TSortStartTypes aSortStartType, TInt aCount);
       
    78     private: // Data
       
    79         /// Own: The sort util
       
    80         CSortUtil* iSortUtil;
       
    81         /// Currently active sort order
       
    82         RContactViewSortOrder iSortOrder;
       
    83         /// Ref: Is sortable function 
       
    84 	    TBool(*iIsSortable)(const CViewContact& aViewContact);
       
    85         /// Own: sort key array for left hand side
       
    86         CSortKeyArray* iLeftSortKeyArray;
       
    87         /// Own: sort key array for right hand side
       
    88         CSortKeyArray* iRightSortKeyArray;
       
    89     };
       
    90 
       
    91 #endif // __CCntSortPlugin_H__
       
    92 
       
    93 // End of File