menucontentsrv/srvinc/mcsgetlisttreecreator.h
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2008 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:  This class implements MMcsGetListCreatorInterface. It builds tree 
       
    15 *   output list for getlist operation 
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef __MCSGETLISTTREECREATOR_H__
       
    22 #define __MCSGETLISTTREECREATOR_H__
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "mcsgetlistcreatorinterface.h"
       
    26 
       
    27 //forward declarations
       
    28 class CMenuSrvEng;
       
    29 class CLiwDefaultList;
       
    30 
       
    31 /*
       
    32  *  GetList tree list creator
       
    33  *  @lib mcsmenu.lib
       
    34  *  @since S60 v5.0
       
    35  */
       
    36 NONSHARABLE_CLASS( CMcsGetlistTreeCreator ): public	CMcsGetListCreatorInterface
       
    37     {
       
    38 public:
       
    39 	/**
       
    40 	*   Factory method.
       
    41 	*/
       
    42     static CMcsGetlistTreeCreator* NewL( CMenuSrvEng& aEng );
       
    43 
       
    44     /**
       
    45     *   Destructor.
       
    46     */
       
    47     ~CMcsGetlistTreeCreator();
       
    48 
       
    49 //from MMcsGetListCreatorInterface
       
    50 	CLiwDefaultList* CreateLC( RArray<TMenuItem>& aIdsArray,
       
    51 			CDesC16Array* aRequiredAttributes,
       
    52 			CDesC16Array* aIgnoredAttributes );
       
    53 
       
    54 private:
       
    55 	/**
       
    56 	*   Constructor.
       
    57 	*/
       
    58 	CMcsGetlistTreeCreator( CMenuSrvEng& aEng );
       
    59 
       
    60 	/**
       
    61 	 * 2nd phase constructor
       
    62 	 */
       
    63 	void ConstructL();
       
    64 
       
    65 	/**
       
    66 	 * Builds output as a tree for GetList operation
       
    67 	 * @param aIdsArray array containing items to build tree with
       
    68 	 * @param aList list to store result
       
    69 	 * @param aIndex index to start with 
       
    70 	 * @param aParentInt parent id
       
    71 	 */	
       
    72 	void BuildTreeListL( RArray<TMenuItem>& aIdsArray, CLiwDefaultList& aList,
       
    73 			TInt& aIndex, TInt aParentId );
       
    74 	
       
    75 
       
    76 	/**
       
    77 	 * Inserts list with children to aList
       
    78 	 * @param aList list to store result
       
    79 	 * @param aChildList list containing children
       
    80 	 */	
       
    81 	void InsertChildListL(CLiwDefaultList& aList, 
       
    82 			CLiwDefaultList* aChildList);
       
    83 private:
       
    84 	/*
       
    85 	 * not own
       
    86 	 */
       
    87 	CDesC16Array* iRequiredAttributes;
       
    88 
       
    89 	/*
       
    90 	 * not own
       
    91 	 */
       
    92 	CDesC16Array* iIgnoredAttributes;
       
    93     };
       
    94 	
       
    95 #endif // __MCSGETLISTTREECREATOR_H__