Nokia N97 SDK
Example Applications Guide

CCECustomSorter.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : CCECustomSorter.h
00004 *  Part of     : Content Listing Framework Sample Application
00005 *  Interface   :
00006 *  Description :
00007 *  Version     :
00008 *
00009 *  Copyright (c) 2006 Nokia Corporation.
00010 *  This material, including documentation and any related
00011 *  computer programs, is protected by copyright controlled by
00012 *  Nokia Corporation.
00013 * ==============================================================================
00014 */
00015 
00016 
00017 #ifndef __CCECUSTOMSORTER_H__
00018 #define __CCECUSTOMSORTER_H__
00019 
00020 //  INCLUDES
00021 #include <e32base.h>
00022 #include <e32std.h>
00023 #include <MCLFCustomSorter.h>
00024 
00025 // FORWARD DECLARATIONS
00026 class MCLFItem;
00027 
00028 // CLASS DECLARATION
00029 
00030 /**
00031 *  CLF Custom Sorter.
00032 *  Example of Custom Sorter that can be used to sort files in the list model. 
00033 *  With Custom Sorters you can create sorting functionality that is not 
00034 *  supported in Content Listing Framework by default. This Custom Sorter 
00035 *  will randomize the list model.
00036 */
00037 class CCECustomSorter
00038     : public CBase,
00039       public MCLFCustomSorter
00040     {
00041     public:  // Constructors and destructor
00042 
00043                 /**
00044                  * Creates and returns a new instance of this class.
00045                  * @return Pointer to the CCECustomSorter object
00046                  */
00047             static CCECustomSorter* NewL();
00048 
00049         /**
00050         * Destructor.
00051         */
00052         virtual ~CCECustomSorter();
00053 
00054     private:    // Constructors
00055         /**
00056         * C++ default constructor.
00057         */
00058         CCECustomSorter();
00059 
00060     protected:  // Functions from base classes
00061 
00062         /**
00063         * From MCLFCustomSorter. Method for sorting Content Listing
00064         * Framework items. Will get called when sorting operation is executed
00065         * by calling refresh for the list model.
00066         * @since Series 60 3.0
00067         * @param aItemArray item array
00068         */
00069 
00070         void SortItemsL( RPointerArray<MCLFItem>& aItemArray );
00071 
00072     public:    // New functions
00073 
00074         /**
00075         * Compare two items for ordering the list model. In this case the 
00076         * list model will be randomized.
00077         * @param aFirst First item to compare
00078         * @param aSecond Second item to compare
00079         * @return Random number
00080         */
00081         static TInt Compare( const MCLFItem& aFirst,
00082                              const MCLFItem& aSecond );
00083 
00084     private:    // Data
00085 
00086     };
00087 
00088 #endif // __CCECUSTOMSORTER_H__
00089 
00090 // End of File

© Nokia 2009

Back to top