examples/SFExamples/PIM/ContactWriteNewField/src/uiq3/ContactWriteNewFieldMainView.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 <ContactWriteNewField.rsg>
00021 
00022 #include "ContactWriteNewFieldExternalInterface.h"
00023 #include "ContactWriteNewFieldAppUi.h"
00024 #include "ContactWriteNewFieldMainView.h"
00025 #include "ContactWriteNewField.hrh"
00026 
00027 // MEMBER FUNCTIONS
00028 
00029 CContactWriteNewFieldMainView* CContactWriteNewFieldMainView::NewLC(CQikAppUi& aAppUi)
00030         {
00031         CContactWriteNewFieldMainView* self = new (ELeave) CContactWriteNewFieldMainView(aAppUi);
00032         CleanupStack::PushL(self);
00033         self->ConstructL();
00034         return self;
00035         }
00036 
00037 CContactWriteNewFieldMainView::CContactWriteNewFieldMainView(CQikAppUi& aAppUi) 
00038         : CQikViewBase(aAppUi, KNullViewId)
00039         {
00040         }
00041 
00042 CContactWriteNewFieldMainView::~CContactWriteNewFieldMainView()
00043         {
00044         }
00045 
00046 void CContactWriteNewFieldMainView::ConstructL()
00047         {
00048         BaseConstructL();
00049         SetExtentToWholeScreen();
00050         }
00051         
00052 void CContactWriteNewFieldMainView::ViewConstructL()
00053         {
00054         ViewConstructFromResourceL(R_CONTACTWRITENEWFIELD_UI_CONFIGURATIONS);   
00055         iEikLabel = LocateControlByUniqueHandle<CEikLabel> (EContactWriteNewFieldLabelCtrl);
00056         }
00057 
00058 TVwsViewId CContactWriteNewFieldMainView::ViewId()const
00059         {
00060         return TVwsViewId(KUidContactWriteNewFieldApp, KUidContactWriteNewFieldMainView);
00061         }
00062 
00063 void CContactWriteNewFieldMainView::HandleCommandL(CQikCommand& aCommand)
00064         {
00065         iQikAppUi.HandleCommandL(aCommand.Id());
00066         CQikViewBase::HandleCommandL(aCommand);
00067         }
00068 
00069 void CContactWriteNewFieldMainView::SetTextL(const TDesC& aText)
00070         {
00071         if (iEikLabel)
00072                 {
00073                 iEikLabel->SetTextL(aText);
00074                 DrawDeferred();
00075                 }
00076         }
00077 
00078 void CContactWriteNewFieldMainView::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