examples/SFExamples/PIM/ContactAsynchSort/src/ContactAsynchSortAppUi.cpp

00001 // 
00002 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
00003 // All rights reserved.
00004 // This component and the accompanying materials are made available
00005 // under the terms of the License "Eclipse Public License v1.0"
00006 // which accompanies this distribution, and is available
00007 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00008 // 
00009 // Initial Contributors:
00010 // Nokia Corporation - initial contribution.
00011 // 
00012 // Contributors:
00013 // 
00014 // Description:
00015 // 
00016 
00017 #include <eikapp.h>
00018 #include <ContactAsynchSort.rsg>
00019 
00020 #include "ContactAsynchSortAppUi.h"
00021 #include "ContactAsynchSortMainView.h"
00022 #include "ContactRead.h"
00023 #include "SortWrapper.h"
00024 #include "ContactAsynchSort.hrh"
00025 
00026 void CContactAsynchSortAppUi::ConstructL()
00027         {
00028         BaseConstructL(EAknEnableSkin);
00029         iMainView = CContactAsynchSortMainView::NewL(ClientRect());
00030 
00031         iContactReader = CContactRead::NewL();
00032         iSortWrapper = new (ELeave) CSortWrapper(*iMainView, iContactReader->CntDatabase());
00033         }
00034         
00035 CContactAsynchSortAppUi::~CContactAsynchSortAppUi()
00036     {
00037         delete iSortWrapper;
00038     delete iContactReader;
00039 #ifdef __SERIES60_3X__
00040         delete iMainView;
00041 #endif
00042     }
00043 
00044 void CContactAsynchSortAppUi::HandleCommandL(TInt aCommand)
00045         {
00046         switch ( aCommand )
00047                 {
00048 #ifdef __SERIES60_3X__
00049                 case EAknSoftkeyExit:
00050 #endif
00051                 case EEikCmdExit:
00052                         {
00053                         User::Exit(0);
00054                         break;
00055                         }
00056                 case EContactAsynchSort:
00057                         {
00058                         iSortWrapper->StartL(*iContactReader);
00059                         break;
00060                         }
00061                 default:
00062                         break;
00063                 }
00064         }
00065 
00066         
00067 #ifdef __SERIES60_3X__
00068 
00069 void CContactAsynchSortAppUi::HandleResourceChangeL(TInt aType)
00070         {
00071         CAknAppUi::HandleResourceChangeL(aType);
00072         iMainView->SetRect(ClientRect());
00073         }
00074 
00075 #endif
00076         
00077 // End of File

Generated by  doxygen 1.6.2