examples/SFExamples/Quick_Recipes_on_Symbian_OS_Multimedia_Example_Code/AudioPlaying/src/uiq3/AudioPlayingMainView.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 <AudioPlaying.rsg>
00021 
00022 #include "AudioPlayingExternalInterface.h"
00023 #include "AudioPlayingAppUi.h"
00024 #include "AudioPlayingMainView.h"
00025 #include "AudioPlaying.hrh"
00026 
00027 // MEMBER FUNCTIONS
00028 
00029 CAudioPlayingMainView* CAudioPlayingMainView::NewLC(CQikAppUi& aAppUi)
00030         {
00031         CAudioPlayingMainView* self = new (ELeave) CAudioPlayingMainView(aAppUi);
00032         CleanupStack::PushL(self);
00033         self->ConstructL();
00034         return self;
00035         }
00036 
00037 CAudioPlayingMainView::CAudioPlayingMainView(CQikAppUi& aAppUi) 
00038         : CQikViewBase(aAppUi, KNullViewId)
00039         {
00040         }
00041 
00042 CAudioPlayingMainView::~CAudioPlayingMainView()
00043         {
00044         }
00045 
00046 void CAudioPlayingMainView::ConstructL()
00047         {
00048         BaseConstructL();
00049         
00050         SetExtentToWholeScreen();
00051         }
00052         
00053 void CAudioPlayingMainView::ViewConstructL()
00054         {
00055         ViewConstructFromResourceL(R_AUDIOPLAYING_UI_CONFIGURATIONS);   
00056         iEikLabel = LocateControlByUniqueHandle<CEikLabel> (EAudioPlayingLabelCtrl);
00057         }
00058 
00059 TVwsViewId CAudioPlayingMainView::ViewId()const
00060         {
00061         return TVwsViewId(KUidAudioPlayingApp, KUidAudioPlayingMainView);
00062         }
00063 
00064 void CAudioPlayingMainView::HandleCommandL(CQikCommand& aCommand)
00065         {
00066         // Handle the user command in the AppUi because we want to have
00067         // the same code for S60 and UIQ.
00068         iQikAppUi.HandleCommandL(aCommand.Id());
00069         CQikViewBase::HandleCommandL(aCommand);
00070         }
00071 
00072 void CAudioPlayingMainView::SetTextL(const TDesC& aText)
00073         {
00074         if (iEikLabel)
00075                 {
00076                 iEikLabel->SetTextL(aText);
00077                 DrawDeferred();
00078                 }
00079         }
00080 
00081 void CAudioPlayingMainView::SizeChanged()
00082     {
00083         if (iEikLabel)
00084                 {
00085                 TRect rect(Rect());
00086                 iEikLabel->SetExtent(
00087                         TPoint(0, 0),
00088                         TSize(rect.Width(), rect.Height()));
00089                 }
00090         }
00091         
00092 // End of File

Generated by  doxygen 1.6.2