menufw/menufwui/mmwidgets/src/mmpostevaluationprocessor.cpp
changeset 0 f72a12da539e
child 4 4d54b72983ae
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2007 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 #include "mmpostevaluationprocessor.h"
       
    19 #include "mmlistboxitemdrawer.h"
       
    20 #include "mmlistboxmodel.h"
       
    21 #include <layoutmetadata.cdl.h>
       
    22 
       
    23 // -----------------------------------------------------------------------------
       
    24 //
       
    25 // -----------------------------------------------------------------------------
       
    26 // 
       
    27 CMmPostEvaluationProcessor::CMmPostEvaluationProcessor(CMmListBoxItemDrawer& aDrawer) :
       
    28     CActive(EPriorityLess), iDrawer(aDrawer), iIndexToProcess(0)
       
    29     {
       
    30     }
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 // -----------------------------------------------------------------------------
       
    35 // 
       
    36 CMmPostEvaluationProcessor* CMmPostEvaluationProcessor::NewLC(CMmListBoxItemDrawer& aDrawer)
       
    37     {
       
    38     CMmPostEvaluationProcessor* self = new ( ELeave ) CMmPostEvaluationProcessor(aDrawer);
       
    39     CleanupStack::PushL(self);
       
    40     self->ConstructL();
       
    41     return self;
       
    42     }
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 // -----------------------------------------------------------------------------
       
    47 // 
       
    48 CMmPostEvaluationProcessor* CMmPostEvaluationProcessor::NewL(CMmListBoxItemDrawer& aDrawer)
       
    49     {
       
    50     CMmPostEvaluationProcessor* self = CMmPostEvaluationProcessor::NewLC(aDrawer);
       
    51     CleanupStack::Pop( self );
       
    52     return self;
       
    53     }
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 // -----------------------------------------------------------------------------
       
    58 // 
       
    59 void CMmPostEvaluationProcessor::ConstructL()
       
    60     {
       
    61     CActiveScheduler::Add( this); // Add to scheduler
       
    62     }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 // -----------------------------------------------------------------------------
       
    67 // 
       
    68 CMmPostEvaluationProcessor::~CMmPostEvaluationProcessor()
       
    69     {
       
    70     Cancel(); // Cancel any request, if outstanding
       
    71     // Delete instance variables if any
       
    72     }
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 //
       
    76 // -----------------------------------------------------------------------------
       
    77 // 
       
    78 void CMmPostEvaluationProcessor::DoCancel()
       
    79     {
       
    80     }
       
    81 
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 // -----------------------------------------------------------------------------
       
    85 // 
       
    86 void CMmPostEvaluationProcessor::RunL()
       
    87     {      
       
    88     const TDesC8& mm_template = iDrawer.iMmModel->GetAttributeAsText( 
       
    89     		iIndexToProcess, KMmTemplate8 );      
       
    90     
       
    91     if ( mm_template.Compare( KNullDesC8 ) && mm_template.Compare( KEmpty8 ) )
       
    92     	{
       
    93         iDrawer.SetupSubCellsL( EFalse, iIndexToProcess );
       
    94     	delete iDrawer.ColumnData()->IconArray();
       
    95     	iDrawer.ColumnData()->SetIconArray( NULL );
       
    96     	}
       
    97     
       
    98     if ( ++iIndexToProcess < iDrawer.iMmModel->NumberOfItems() )
       
    99     	{
       
   100     	SetActive();
       
   101     	TRequestStatus* status = &iStatus;
       
   102     	User::RequestComplete( status, KErrNone );
       
   103     	}
       
   104     }
       
   105 
       
   106 // -----------------------------------------------------------------------------
       
   107 //
       
   108 // -----------------------------------------------------------------------------
       
   109 // 
       
   110 TInt CMmPostEvaluationProcessor::RunError(TInt aError)
       
   111     {
       
   112     return aError;
       
   113     }
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 //
       
   117 // -----------------------------------------------------------------------------
       
   118 // 
       
   119 void CMmPostEvaluationProcessor::StartAt( TInt aIndex )
       
   120 	{
       
   121 	Cancel();
       
   122 	iIndexToProcess = aIndex;
       
   123 	SetActive();
       
   124 	TRequestStatus* status = &iStatus;
       
   125 	User::RequestComplete( status, KErrNone );
       
   126 	}
       
   127 
       
   128 //End of file