phoneclientserver/phoneclient/Src/ExtCallWrapper/ExtCallWrapper_Aiw/CPhCltDialer.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 15:45:17 +0300
branchRCL_3
changeset 19 7d48bed6ce0c
parent 0 ff3b6d0fd310
child 20 987c9837762f
permissions -rw-r--r--
Revision: 201033 Kit: 201035

/*
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Dialer class.
*
*/



// INCLUDE FILES
#include    "cphcltdialer.h" 
#include    "cphcltdialerdlg.h" 



// ============================ MEMBER FUNCTIONS ===============================


// -----------------------------------------------------------------------------
// CPhCltDialer::NewL
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
EXPORT_C CPhCltDialer* CPhCltDialer::NewL()
    {
    CPhCltDialer* self = 
        new ( ELeave ) CPhCltDialer;
    
    CleanupStack::PushL( self );
    self->ConstructL();
    CleanupStack::Pop();

    return self;
    }


// Destructor
CPhCltDialer::~CPhCltDialer()
    {
    if ( iDestroyed )
        {
        *iDestroyed = ETrue;
        iDestroyed = NULL;
        }

    delete iDialDlg;
    }


// -----------------------------------------------------------------------------
// CPhCltDialer::DialData
//
// -----------------------------------------------------------------------------
//
EXPORT_C CPhCltExtPhoneDialData& 
    CPhCltDialer::DialData()
    {
    return iDialDlg->DialData();
    }


// -----------------------------------------------------------------------------
// CPhCltDialer::ExecuteLD
//
// -----------------------------------------------------------------------------
//
EXPORT_C void CPhCltDialer::ExecuteLD()
    {
    TBool destroyed = EFalse;
    iDestroyed = &destroyed;

    CleanupStack::PushL( this );
    CleanupStack::PushL( TCleanupItem( DoClear, this ) );

    iDialDlg->ExecuteDialLD();

    if ( !destroyed )
        {
        CleanupStack::PopAndDestroy(); // DoClear
        CleanupStack::PopAndDestroy( this );
        }
    else
        {
        // Already deleted
        CleanupStack::Pop();
        CleanupStack::Pop( this );
        }
    }


// -----------------------------------------------------------------------------
// CPhCltDialer::CPhCltDialer
// C++ default constructor can NOT contain any code, that
// might leave.
// -----------------------------------------------------------------------------
//
CPhCltDialer::CPhCltDialer()
    {
    }


// -----------------------------------------------------------------------------
// CPhCltDialer::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CPhCltDialer::ConstructL()
    {
    iDialDlg = new ( ELeave ) CPhCltDialerDlg;
    }


// -----------------------------------------------------------------------------
// CPhCltDialer::DoClear
//
// -----------------------------------------------------------------------------
//
void CPhCltDialer::DoClear( TAny* aAny )
    {
    CPhCltDialer* dialer =
        reinterpret_cast< CPhCltDialer* >( aAny );

    dialer->iDestroyed = NULL;
    dialer->iDialDlg = NULL;
    }


//  End of File