00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
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