mmserv/sts/src/systemtoneservice.cpp
changeset 14 80975da52420
child 16 43d09473c595
equal deleted inserted replaced
12:5a06f39ad45b 14:80975da52420
       
     1 /*
       
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:
       
    15  * This file is the direct implementation of the System Tone Service
       
    16  * API.  This acts as a facade to the actual implementation logic
       
    17  * which is in the CStsImplementation class.
       
    18  */
       
    19 
       
    20 //  Include Files  
       
    21 #include <systemtoneservice.h>	// CSystemToneService
       
    22 #include "stsimplementation.h"
       
    23 
       
    24 //  Member Functions
       
    25 EXPORT_C /*static*/CSystemToneService* CSystemToneService::Create()
       
    26     {
       
    27     CSystemToneService* self = 0;
       
    28     CStsImplementation* implementation = CStsImplementation::Create();
       
    29     if (implementation != 0)
       
    30         {
       
    31         self = new CSystemToneService(*implementation);
       
    32         if (self == 0)
       
    33             {
       
    34             delete implementation;
       
    35             }
       
    36         }
       
    37     return self;
       
    38     }
       
    39 
       
    40 EXPORT_C /*static*/void CSystemToneService::Delete(
       
    41         CSystemToneService* aSystemToneService)
       
    42     {
       
    43     delete &(aSystemToneService->iImplementation);
       
    44     delete aSystemToneService;
       
    45     }
       
    46 
       
    47 CSystemToneService::CSystemToneService(CStsImplementation& aImplementation) :
       
    48     iImplementation(aImplementation)
       
    49     {
       
    50     }
       
    51 
       
    52 CSystemToneService::~CSystemToneService()
       
    53     {
       
    54     }
       
    55 
       
    56 EXPORT_C void CSystemToneService::PlayTone(TToneType aTone)
       
    57     {
       
    58     iImplementation.PlayTone(aTone);
       
    59     }
       
    60 
       
    61 EXPORT_C void CSystemToneService::PlayTone(TToneType aTone,
       
    62         unsigned int& aPlayToneContext)
       
    63     {
       
    64     iImplementation.PlayTone(aTone, aPlayToneContext);
       
    65     }
       
    66 
       
    67 EXPORT_C void CSystemToneService::StopTone(unsigned int aPlayToneContext)
       
    68     {
       
    69     iImplementation.StopTone(aPlayToneContext);
       
    70     }