photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandlersortorder.h
changeset 0 4e91876724a2
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2008-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:    SortOrder command handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef C_GLXCOMMANDHANDLERSORTORDER_H
       
    22 #define C_GLXCOMMANDHANDLERSORTORDER_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <glxmedialistcommandhandler.h>
       
    27 #include <glxfilterfactory.h>		// For TGlxFilterFactory
       
    28 
       
    29 
       
    30 //FORWARD DECLARATION
       
    31 class MGlxMediaListProvider;
       
    32 
       
    33 /**
       
    34  * @class CGlxCommandHandlerSortOrder
       
    35  *
       
    36  * Command handler that changes the sorting criteria of the MediaList
       
    37  *
       
    38  */
       
    39 NONSHARABLE_CLASS (CGlxCommandHandlerSortOrder)
       
    40     : public CGlxMediaListCommandHandler
       
    41 	{
       
    42 	    
       
    43 	    friend class ut_cglxcommandhandlersortorder;
       
    44 public:
       
    45 
       
    46     /**
       
    47      * Two-phase constructor
       
    48      * @param aMediaListProvider object that provides the media list
       
    49      * @param aCRKey The settings key which used by the commandhandler 
       
    50      *								set/get the sort order setting
       
    51      */
       
    52 	IMPORT_C static CGlxCommandHandlerSortOrder* NewL(
       
    53 							MGlxMediaListProvider* aMediaListProvider,
       
    54 							const TUint32 aCRKey);
       
    55 
       
    56 
       
    57 	/** Destructor */
       
    58 	IMPORT_C ~CGlxCommandHandlerSortOrder();
       
    59     
       
    60 protected:
       
    61 	
       
    62 	/** see CGlxMediaListCommandHandler::DoExcecuteL */
       
    63     TBool DoExecuteL(TInt aCommandId, MGlxMediaList& aList);
       
    64     
       
    65     /** see CGlxMediaListCommandHandler::DoIsDisabled */
       
    66     TBool DoIsDisabled(TInt aCommandId, MGlxMediaList& aList) const;
       
    67     	     
       
    68 private:
       
    69 
       
    70     /** Second phase constructor */
       
    71 	void ConstructL();
       
    72 
       
    73     /** 
       
    74      * Constructor 
       
    75      * @param aMediaListProvider object that provides the media list
       
    76      * @param aCRKey The settings key which used by the commandhandler 
       
    77      *								set/get the sort order setting
       
    78      */
       
    79 	CGlxCommandHandlerSortOrder(MGlxMediaListProvider* aMediaListProvider,
       
    80 												const TUint32 aCRKey);
       
    81 						
       
    82     /**
       
    83      *  Finds out the current sort order applied to the media list
       
    84      *  @param aList reference to a media list
       
    85      *  @returns The current sort order					
       
    86      */
       
    87     TGlxFilterSortOrder	CurrentSortOrder(MGlxMediaList& aList) const;
       
    88 	
       
    89 private: // Data
       
    90 
       
    91 	/** Holds the id of the cenrep key which needs to be queried/changed */
       
    92 	TUint32	iKey;
       
    93 
       
    94 	};
       
    95 
       
    96 #endif // C_GLXCOMMANDHANDLERSORTORDER_H