examples/SFExamples/PIM/ContactAsynchFind/src/uiq3/ContactAsynchFindMainView.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 // INCLUDES
00018 #include <QikCommand.h>
00019 #include <eiklabel.h>
00020 #include <ContactAsynchFind.rsg>
00021 
00022 #include "ContactAsynchFindExternalInterface.h"
00023 #include "ContactAsynchFindAppUi.h"
00024 #include "ContactAsynchFindMainView.h"
00025 #include "ContactAsynchFind.hrh"
00026 
00027 // MEMBER FUNCTIONS
00028 
00029 CContactAsynchFindMainView* CContactAsynchFindMainView::NewLC(CQikAppUi& aAppUi)
00030         {
00031         CContactAsynchFindMainView* self = new (ELeave) CContactAsynchFindMainView(aAppUi);
00032         CleanupStack::PushL(self);
00033         self->ConstructL();
00034         return self;
00035         }
00036 
00037 CContactAsynchFindMainView::CContactAsynchFindMainView(CQikAppUi& aAppUi) 
00038         : CQikViewBase(aAppUi, KNullViewId)
00039         {
00040         }
00041 
00042 CContactAsynchFindMainView::~CContactAsynchFindMainView()
00043         {
00044         }
00045 
00046 void CContactAsynchFindMainView::ConstructL()
00047         {
00048         BaseConstructL();
00049         SetExtentToWholeScreen();
00050         }
00051         
00052 void CContactAsynchFindMainView::ViewConstructL()
00053         {
00054         ViewConstructFromResourceL(R_CONTACTASYNCHFIND_UI_CONFIGURATIONS);      
00055         iEikLabel = LocateControlByUniqueHandle<CEikLabel> (EContactAsynchFindLabelCtrl);
00056         }
00057 
00058 TVwsViewId CContactAsynchFindMainView::ViewId()const
00059         {
00060         return TVwsViewId(KUidContactAsynchFindApp, KUidContactAsynchFindMainView);
00061         }
00062 
00063 void CContactAsynchFindMainView::HandleCommandL(CQikCommand& aCommand)
00064         {
00065         iQikAppUi.HandleCommandL(aCommand.Id());
00066         CQikViewBase::HandleCommandL(aCommand);
00067         }
00068 
00069 void CContactAsynchFindMainView::SetTextL(const TDesC& aText)
00070         {
00071         if (iEikLabel)
00072                 {
00073                 iEikLabel->SetTextL(aText);
00074                 DrawDeferred();
00075                 }
00076         }
00077 
00078 void CContactAsynchFindMainView::SizeChanged()
00079     {
00080         if (iEikLabel)
00081                 {
00082                 TRect rect(Rect());
00083                 iEikLabel->SetExtent(
00084                         TPoint(0, 0),
00085                         TSize(rect.Width(), rect.Height()));
00086                 }
00087         }
00088         
00089 // End of File

Generated by  doxygen 1.6.2