profilesservices/ProfileEngine/WrapperSrc/CProEngToneSettingsImpl.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 19 Feb 2010 23:06:10 +0200
branchRCL_3
changeset 8 f62c3a3d66b8
parent 0 8c5d936e5675
child 55 4c15d9aa2384
permissions -rw-r--r--
Revision: 201003 Kit: 201007

/*
* Copyright (c) 2002-2004 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:  Implementation of the CProEngToneSettingsImpl.
*
*/



// INCLUDE FILES
#include    "CProEngToneSettingsImpl.h"
#include    <MProfileTones.h>
#include    <MProfileExtraTones.h>
#include    <MProfileSetTones.h>
#include    <MProfileSetExtraTones.h>
#include    <MProfileExtended.h>

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

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::CProEngToneSettingsImpl
// -----------------------------------------------------------------------------
//
CProEngToneSettingsImpl::CProEngToneSettingsImpl(
        TProfileToneSettings& aToneSettings,
        TUint32 aModifiableFlags )
    : iToneSettings( aToneSettings ), iModifiableFlags( aModifiableFlags )
    {
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::NewL
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CProEngToneSettingsImpl* CProEngToneSettingsImpl::NewL(
        TProfileToneSettings& aToneSettings,
        TUint32 aModifiableFlags )
    {
    return new ( ELeave ) CProEngToneSettingsImpl(
            aToneSettings, aModifiableFlags );
    }

// Destructor
CProEngToneSettingsImpl::~CProEngToneSettingsImpl()
    {
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::RingingType
// -----------------------------------------------------------------------------
//
TProfileRingingType CProEngToneSettingsImpl::RingingType() const
    {
    return iToneSettings.iRingingType;
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::KeypadVolume
// -----------------------------------------------------------------------------
//
TProfileKeypadVolume CProEngToneSettingsImpl::KeypadVolume() const
    {
    return iToneSettings.iKeypadVolume;
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::
// -----------------------------------------------------------------------------
//
TProfileRingingVolume CProEngToneSettingsImpl::RingingVolume() const
    {
    TProfileRingingVolume volume =
        TProfileRingingVolume( iToneSettings.iRingingVolume );
    return volume;
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::
// -----------------------------------------------------------------------------
//
TBool CProEngToneSettingsImpl::VibratingAlert() const
    {
    return iToneSettings.iVibratingAlert;
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::
// -----------------------------------------------------------------------------
//
TBool CProEngToneSettingsImpl::WarningAndGameTones() const
    {
    return iToneSettings.iWarningAndGameTones;
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::
// -----------------------------------------------------------------------------
//
TBool CProEngToneSettingsImpl::TextToSpeech() const
    {
    return iToneSettings.iTextToSpeech;
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::
// -----------------------------------------------------------------------------
//
TInt CProEngToneSettingsImpl::SetRingingType( TProfileRingingType aRingingType )
    {
    if( iModifiableFlags & EProfileFlagRingingType )
        {
        iToneSettings.iRingingType = aRingingType;
        return KErrNone;
        }
    return KErrAccessDenied;
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::
// -----------------------------------------------------------------------------
//
TInt CProEngToneSettingsImpl::SetKeypadVolume(
        TProfileKeypadVolume aKeypadVolume )
    {
    if( iModifiableFlags & EProfileFlagKeypadVolume )
        {
        iToneSettings.iKeypadVolume = aKeypadVolume;
        return KErrNone;
        }
    return KErrAccessDenied;
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::
// -----------------------------------------------------------------------------
//
TInt CProEngToneSettingsImpl::SetRingingVolume(
        TProfileRingingVolume aRingingVolume )
    {
    if( iModifiableFlags & EProfileFlagRingingVolume )
        {
        iToneSettings.iRingingVolume = aRingingVolume;
        return KErrNone;
        }
    return KErrAccessDenied;
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::
// -----------------------------------------------------------------------------
//
TInt CProEngToneSettingsImpl::SetVibratingAlert( TBool aVibratingAlert )
    {
    if( iModifiableFlags & EProfileFlagVibratingAlert )
        {
        iToneSettings.iVibratingAlert = aVibratingAlert;
        return KErrNone;
        }
    return KErrAccessDenied;
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::
// -----------------------------------------------------------------------------
//
TInt CProEngToneSettingsImpl::SetWarningAndGameTones( TBool aWarningAndGameTones )
    {
    if( iModifiableFlags & EProfileFlagWarningTones )
        {
        iToneSettings.iWarningAndGameTones = aWarningAndGameTones;
        return KErrNone;
        }
    return KErrAccessDenied;
    }

// -----------------------------------------------------------------------------
// CProEngToneSettingsImpl::
// -----------------------------------------------------------------------------
//
TInt CProEngToneSettingsImpl::SetTextToSpeech( TBool aTextToSpeech )
    {
    if( iModifiableFlags & EProfileFlagTextToSpeechTone )
        {
        iToneSettings.iTextToSpeech = aTextToSpeech;
        return KErrNone;
        }
    return KErrAccessDenied;
    }


//  End of File