menufw/menufwui/mmwidgets/src/mmgridmodel.cpp
changeset 0 f72a12da539e
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 
       
    19 #include "mmgridmodel.h"
       
    20 #include "mmlistboxmodel.h"
       
    21 
       
    22 // -----------------------------------------------------------------------------
       
    23 //
       
    24 // -----------------------------------------------------------------------------
       
    25 // 
       
    26 CMmGridModel::CMmGridModel()
       
    27     {
       
    28     // No implementation required
       
    29     }
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 // -----------------------------------------------------------------------------
       
    34 // 
       
    35 CMmGridModel::~CMmGridModel()
       
    36     {
       
    37     delete iMmListBoxModel;
       
    38     }
       
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 // -----------------------------------------------------------------------------
       
    43 // 
       
    44 CMmGridModel* CMmGridModel::NewLC()
       
    45     {
       
    46     CMmGridModel* self = new (ELeave)CMmGridModel();
       
    47     CleanupStack::PushL(self);
       
    48     self->ConstructL();
       
    49     return self;
       
    50     }
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 // -----------------------------------------------------------------------------
       
    55 // 
       
    56 CMmGridModel* CMmGridModel::NewL()
       
    57     {
       
    58     CMmGridModel* self = CMmGridModel::NewLC();
       
    59     CleanupStack::Pop( self );
       
    60     return self;
       
    61     }
       
    62 
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 // -----------------------------------------------------------------------------
       
    66 //      
       
    67 TInt CMmGridModel::NumberOfItems() const
       
    68     {
       
    69     return CAknGridM::NumberOfItems();
       
    70     }
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 // -----------------------------------------------------------------------------
       
    75 // 
       
    76 void CMmGridModel::ConstructL()
       
    77     {
       
    78     iMmListBoxModel = CMmListBoxModel::NewL();
       
    79     delete iItemTextArray;
       
    80     iItemTextArray = iMmListBoxModel->ItemTextArray();
       
    81     SetOwnershipType(ELbmDoesNotOwnItemArray);
       
    82     }
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 // -----------------------------------------------------------------------------
       
    87 // 
       
    88 void CMmGridModel::ConstructL(MDesCArray* /*aItemTextArray*/, 
       
    89 		TListBoxModelItemArrayOwnership /*aOwnershipType*/)
       
    90     {
       
    91     //do not delete this is needed to cheat AVKON
       
    92     }
       
    93 
       
    94 // -----------------------------------------------------------------------------
       
    95 //
       
    96 // -----------------------------------------------------------------------------
       
    97 // 
       
    98 CMmListBoxModel* CMmGridModel::MmListBoxModel()
       
    99     {
       
   100     return iMmListBoxModel;
       
   101     }
       
   102 
       
   103 // End of file