clfwrapper/ClientSrc/CCLFDefaultOperation.h
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2002-2009 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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CCLFDEFAULTOPERATION_H
       
    21 #define CCLFDEFAULTOPERATION_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <MCLFCustomSorter.h>
       
    25 #include <MCLFPostFilter.h>
       
    26 #include <MCLFCustomGrouper.h>
       
    27 #include <CLFContentListing.hrh>
       
    28 #include <CLFContentListing.h>
       
    29 #include <e32base.h>
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class MCLFSortingStyle;
       
    33 class MCLFModifiableItem;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 *  This class implements operations from
       
    39 *  MCLFCustomSorter, MCLFPostFilter and MCLFCustomGrouper.
       
    40 *
       
    41 *  @lib ContentListingFramework.lib
       
    42 *  @since Series 60 3.0
       
    43 */
       
    44 NONSHARABLE_CLASS( CCLFDefaultOperation ) : public CBase,
       
    45                                             public MCLFCustomSorter,
       
    46                                             public MCLFPostFilter,
       
    47                                             public MCLFCustomGrouper
       
    48     {
       
    49 
       
    50     public:  // Constructors and destructor
       
    51 
       
    52         /**
       
    53         * Two-phased constructor.
       
    54         */
       
    55         static CCLFDefaultOperation* NewL();
       
    56 
       
    57         /**
       
    58         * Destructor.
       
    59         */
       
    60         virtual ~CCLFDefaultOperation();
       
    61 
       
    62     public: // New functions
       
    63 
       
    64         /**
       
    65         * Set sorting style.
       
    66         * @since Series 60 3.0
       
    67         * @param aSortingStyle Ownership is not transfered
       
    68         */
       
    69         void SetSortingStyle( MCLFSortingStyle* aSortingStyle );
       
    70 
       
    71         /**
       
    72         * Append sorting style.
       
    73         * @since Series 60 3.0
       
    74         * @param aSortingStyle Ownership is not transfered
       
    75         */
       
    76         void AppendSortingStyleL( MCLFSortingStyle& aSortingStyle );
       
    77 
       
    78         /**
       
    79         * Set item grouping.
       
    80         * @since Series 60 3.0
       
    81         * @param aGrouping Grouping style
       
    82         */
       
    83         void SetGrouping( TCLFGrouping aGrouping );
       
    84 
       
    85     protected:  // New functions
       
    86 
       
    87         void DoMusicAlbumGroupingL( const TArray<MCLFItem*>& aSourceList,
       
    88                                     RPointerArray<MCLFItem>& aGroupedList );
       
    89 
       
    90     protected:  // Functions from base classes
       
    91 
       
    92         /**
       
    93         * From MCLFCustomSorter
       
    94         */
       
    95         virtual void SortItemsL( RPointerArray<MCLFItem>& aItemArray );
       
    96 
       
    97         /**
       
    98         * From MCLFCustomGrouper
       
    99         */
       
   100         virtual void GroupItemsL( const TArray<MCLFItem*>& aSourceList,
       
   101                                   RPointerArray<MCLFItem>& aGroupedList );
       
   102 
       
   103         /**
       
   104         * From MCLFPostFilter
       
   105         */
       
   106         virtual void FilterItemsL( const TArray<MCLFItem*>& aItemList,
       
   107                                    RPointerArray<MCLFItem>& aFilteredItemList );
       
   108 
       
   109     private:
       
   110 
       
   111         /**
       
   112         * C++ default constructor.
       
   113         */
       
   114         CCLFDefaultOperation();
       
   115 
       
   116     private:    // Data
       
   117         // Ref.
       
   118         MCLFSortingStyle* iSortingStyle;
       
   119         // Ref.
       
   120         RPointerArray<MCLFSortingStyle> iSortingStyleArray;
       
   121         // Grouping style
       
   122         TCLFGrouping iGrouping;
       
   123         // Own. this class owns grouped items
       
   124         RPointerArray<MCLFModifiableItem> iGroupedItemList;
       
   125 
       
   126     };
       
   127 
       
   128 #endif      // CCLFDEFAULTOPERATION_H
       
   129 
       
   130 // End of File