mmserv/tms/tmsimpl/src/tmsinbandtoneimpl.cpp
branchRCL_3
changeset 19 095bea5f582e
equal deleted inserted replaced
18:a36789189b53 19:095bea5f582e
       
     1 /*
       
     2  * Copyright (c) 2009 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: Telephony Multimedia Service
       
    15  *
       
    16  */
       
    17 
       
    18 #include "tmsutility.h"
       
    19 #include "tmsinbandtonebodyimpl.h"
       
    20 #include "tmsinbandtoneimpl.h"
       
    21 
       
    22 using namespace TMS;
       
    23 
       
    24 TMSInbandToneImpl::TMSInbandToneImpl()
       
    25     {
       
    26     TRACE_PRN_FN_ENT;
       
    27     TRACE_PRN_FN_EXT;
       
    28     }
       
    29 
       
    30 TMSInbandToneImpl::~TMSInbandToneImpl(void)
       
    31     {
       
    32     TRACE_PRN_FN_ENT;
       
    33     TRACE_PRN_FN_EXT;
       
    34     }
       
    35 
       
    36 gint TMSInbandToneImpl::PostConstruct()
       
    37     {
       
    38     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
       
    39     TMSInbandToneBody* bodyimpl(NULL);
       
    40     TRACE_PRN_FN_ENT;
       
    41     ret = TMSInbandToneBodyImpl::Create(bodyimpl);
       
    42 
       
    43     if (ret == TMS_RESULT_SUCCESS)
       
    44         {
       
    45         this->iBody = bodyimpl;
       
    46         }
       
    47     TRACE_PRN_FN_EXT;
       
    48     return ret;
       
    49     }
       
    50 
       
    51 EXPORT_C gint TMSInbandToneImpl::Create(TMSInbandTone*& inbandtone)
       
    52     {
       
    53     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
       
    54     TMSInbandToneImpl *self = new TMSInbandToneImpl();
       
    55 
       
    56     TRACE_PRN_FN_ENT;
       
    57     if (self)
       
    58         {
       
    59         ret = self->PostConstruct();
       
    60         if (ret != TMS_RESULT_SUCCESS)
       
    61             {
       
    62             delete self;
       
    63             self = NULL;
       
    64             }
       
    65         }
       
    66     if (self && ret == TMS_RESULT_SUCCESS)
       
    67         {
       
    68         inbandtone = self;
       
    69         ret = self->SetParent(inbandtone);
       
    70         }
       
    71     TRACE_PRN_FN_EXT;
       
    72     return ret;
       
    73     }
       
    74 
       
    75 EXPORT_C gint TMSInbandToneImpl::Delete(TMSInbandTone*& inbandtone)
       
    76     {
       
    77     gint ret(TMS_RESULT_SUCCESS);
       
    78     TRACE_PRN_FN_ENT;
       
    79     delete (static_cast<TMSInbandToneImpl*>(inbandtone));
       
    80     inbandtone = NULL;
       
    81     TRACE_PRN_FN_EXT;
       
    82     return ret;
       
    83     }
       
    84 
       
    85 gint TMSInbandToneImpl::SetParent(TMSInbandTone*& parent)
       
    86     {
       
    87     gint ret(TMS_RESULT_SUCCESS);
       
    88     if (this->iBody)
       
    89         {
       
    90         static_cast<TMSInbandToneBodyImpl*>(this->iBody)->SetParent(parent);
       
    91         }
       
    92     else
       
    93         {
       
    94         ret = TMS_RESULT_UNINITIALIZED_OBJECT;
       
    95         }
       
    96     return ret;
       
    97     }
       
    98