examples/SFExamples/games_on_symbian_os_code/vibrapool/src/VibraPoolAppUi.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:  CVibraPoolAppUi implementation
00015 // 
00016 // 
00017 
00018 
00019 // INCLUDE FILES
00020 #include <avkon.hrh>
00021 #include <aknmessagequerydialog.h>
00022 #include <VibraPool_0xE460ABF6.rsg>
00023 
00024 #include "VibraPool.hrh"
00025 #include "VibraPool.pan"
00026 #include "VibraPoolApplication.h"
00027 #include "VibraPoolAppUi.h"
00028 #include "VibraPoolAppView.h"
00029 
00030 
00031 // ============================ MEMBER FUNCTIONS ===============================
00032 
00033 
00034 // -----------------------------------------------------------------------------
00035 // CVibraPoolAppUi::ConstructL()
00036 // Symbian 2nd phase constructor can leave.
00037 // -----------------------------------------------------------------------------
00038 //
00039 void CVibraPoolAppUi::ConstructL()
00040         {
00041         // Initialise app UI with standard value.
00042         BaseConstructL(CAknAppUi::EAknEnableSkin);
00043 
00044         // Create view object
00045         iAppView = CVibraPoolAppView::NewL( ClientRect() );
00046         }
00047 
00048 // -----------------------------------------------------------------------------
00049 // CVibraPoolAppUi::CVibraPoolAppUi()
00050 // C++ default constructor can NOT contain any code, that might leave.
00051 // -----------------------------------------------------------------------------
00052 //
00053 CVibraPoolAppUi::CVibraPoolAppUi()
00054         {
00055         // No implementation required
00056         }
00057 
00058 // -----------------------------------------------------------------------------
00059 // CVibraPoolAppUi::~CVibraPoolAppUi()
00060 // Destructor.
00061 // -----------------------------------------------------------------------------
00062 //
00063 CVibraPoolAppUi::~CVibraPoolAppUi()
00064         {
00065         if ( iAppView )
00066                 {
00067                 delete iAppView;
00068                 iAppView = NULL;
00069                 }
00070         }
00071 
00072 // -----------------------------------------------------------------------------
00073 // CVibraPoolAppUi::HandleCommandL()
00074 // Takes care of command handling.
00075 // -----------------------------------------------------------------------------
00076 //
00077 void CVibraPoolAppUi::HandleCommandL( TInt aCommand )
00078         {
00079         switch( aCommand )
00080                 {
00081                 case EEikCmdExit:
00082                 case EAknSoftkeyExit:
00083                         Exit();
00084                         break;
00085                 case ERestart:
00086                         {
00087                         iAppView->ReStartGame();
00088                         }
00089                         break;
00090                 case EStop:
00091                         {
00092                         iAppView->StopGame();
00093                         }
00094                         break;
00095                 default:
00096                         Panic( EVibraPoolUi );
00097                         break;
00098                 }
00099         }
00100 
00101 // -----------------------------------------------------------------------------
00102 //  Called by the framework when the application status pane
00103 //  size is changed.  Passes the new client rectangle to the
00104 //  AppView
00105 // -----------------------------------------------------------------------------
00106 //
00107 void CVibraPoolAppUi::HandleStatusPaneSizeChange()
00108         {
00109         iAppView->SetRect( ClientRect() );
00110         } 
00111 
00112 // End of File

Generated by  doxygen 1.6.2