phonebookui/Phonebook2/UIControls/src/CPbk2ContactInfoDataSwapper.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Phonebook 2 contact info data swapper utility class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "CPbk2ContactInfoDataSwapper.h"
       
    20 
       
    21 // Phonebook 2
       
    22 #include "CPbk2ThumbnailLoader.h"
       
    23 
       
    24 // System includes
       
    25 #include <eikfrlb.h>
       
    26 
       
    27 // --------------------------------------------------------------------------
       
    28 // CPbk2ContactInfoDataSwapper::CPbk2ContactInfoDataSwapper
       
    29 // --------------------------------------------------------------------------
       
    30 //
       
    31 CPbk2ContactInfoDataSwapper::CPbk2ContactInfoDataSwapper()
       
    32     {
       
    33     }
       
    34 
       
    35 // --------------------------------------------------------------------------
       
    36 // CPbk2ContactInfoDataSwapper::~CPbk2ContactInfoDataSwapper
       
    37 // --------------------------------------------------------------------------
       
    38 //
       
    39 CPbk2ContactInfoDataSwapper::~CPbk2ContactInfoDataSwapper()
       
    40     {
       
    41     if (iListBox)
       
    42         {
       
    43         iListBox->Model()->SetItemTextArray(iItemTextArray);
       
    44         if (iTopItemIndex >= 0)
       
    45             {
       
    46             iListBox->SetTopItemIndex(iTopItemIndex);
       
    47             }
       
    48         if (iCurrentItemIndex >= 0)
       
    49             {
       
    50             iListBox->SetCurrentItemIndex(iCurrentItemIndex);
       
    51             }
       
    52         }
       
    53     delete iListBoxModel;
       
    54     delete iThumbnailLoader;
       
    55     delete iTitlePaneText;
       
    56     }
       
    57 
       
    58 // --------------------------------------------------------------------------
       
    59 // CPbk2ContactInfoDataSwapper::StoreListBoxState
       
    60 // --------------------------------------------------------------------------
       
    61 //
       
    62 void CPbk2ContactInfoDataSwapper::StoreListBoxState
       
    63         ( CEikTextListBox& aListBox )
       
    64     {
       
    65     iListBox = &aListBox;
       
    66     iItemTextArray = iListBox->Model()->ItemTextArray();
       
    67     iTopItemIndex = iListBox->TopItemIndex();
       
    68     iCurrentItemIndex = iListBox->CurrentItemIndex();
       
    69     }
       
    70 
       
    71 // --------------------------------------------------------------------------
       
    72 // CPbk2ContactInfoDataSwapper::ResetListBoxState
       
    73 // --------------------------------------------------------------------------
       
    74 //
       
    75 void CPbk2ContactInfoDataSwapper::ResetListBoxState()
       
    76     {
       
    77     iListBox = NULL;
       
    78     }
       
    79 
       
    80 // End of File