⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clocationexampleappui.cpp

📁 Symbian Demo, why do you want to get 20 bytes.
💻 CPP
字号:
/*
* ============================================================================
*  Name     : clocationexampleappui.cpp
*  Part of  : Location Example
*  Created  : 21.05.2007 by Forum Nokia
*  Description:
*  Version  : 1.0
*  Copyright: Nokia Corporation
* ============================================================================
*/

#include <e32std.h>
#include <locationexample.rsg>
#include "locationexample.pan"
#include "clocationexampleappui.h"
#include "clocationexampleview.h"
#include "clocationexampleengine.h"
#include "locationexample.hrh"


// -----------------------------------------------------------------------------
// CLocationExampleAppUi::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CLocationExampleAppUi::ConstructL()
    {
    // Initialise app UI
    BaseConstructL(EAknEnableSkin);

    // Initialise Views
    iAppView1 = CLocationExampleView::NewL(this);

    // Initialise Engine
    iEngine = CLocationExampleEngine::NewL(iAppView1);

    AddViewL( iAppView1 );
    SetDefaultViewL( *iAppView1 );
    }


CLocationExampleAppUi::~CLocationExampleAppUi()
    {
    delete iEngine;
    }

// -----------------------------------------------------------------------------
// CLocationExampleAppUi::HandleCommandL()
// Takes care of command handling.
// -----------------------------------------------------------------------------
//
void CLocationExampleAppUi::HandleCommandL( TInt aCommand )
    {
    switch ( aCommand )
        {
        case EEikCmdExit:
        case EAknSoftkeyExit:
            Exit();
            break;

        case ELocationExampleGpsStart:
            {
            iEngine->ActivateGpsL();
            break;
            }
        case ELocationExampleGpsStop:
            {
            iEngine->DeactivateGpsL();
            break;
            }
        case ELocationExampleSendLocation:
            {
            TInt err = iEngine->NumberQueryL();
            if (!err)
                {
                TRAP_IGNORE(iEngine->DoMessageAndSendL(EPositionResponse));
                }
            break;
            }
        case ELocationExampleGetLocation:
            {
            TInt err = iEngine->NumberQueryL();
            if (!err)
                {
                TRAP_IGNORE(iEngine->DoMessageAndSendL(EPositionRequest));
                }
            break;
            }
        default:
            Panic( ELocationExampleViewsBasicUi );
            break;
        }
    }

// -----------------------------------------------------------------------------
// CLocationExampleAppUi::HandleResourceChangeL()
// Called by framework when layout is changed.
// -----------------------------------------------------------------------------
//
void CLocationExampleAppUi::HandleResourceChangeL( TInt aType )
    {
    CAknAppUi::HandleResourceChangeL( aType );
       
    if ( aType==KEikDynamicLayoutVariantSwitch )
        {
        iAppView1->HandleSizeChange(aType);
        }           
    }
    
// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -