mmserv/tms/tmsimpl/src/tmsdtmfimpl.cpp
changeset 12 5a06f39ad45b
child 14 80975da52420
equal deleted inserted replaced
0:71ca22bcf22a 12:5a06f39ad45b
       
     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 "tmsdtmfbodyimpl.h"
       
    20 #include "tmsdtmfimpl.h"
       
    21 
       
    22 using namespace TMS;
       
    23 
       
    24 TMSDTMFImpl::TMSDTMFImpl(TMSStreamType streamtype)
       
    25     {
       
    26     TRACE_PRN_FN_ENT;
       
    27     iStreamType = streamtype;
       
    28     TRACE_PRN_FN_EXT;
       
    29     }
       
    30 
       
    31 TMSDTMFImpl::~TMSDTMFImpl()
       
    32     {
       
    33     TRACE_PRN_FN_ENT;
       
    34     TRACE_PRN_FN_EXT;
       
    35     }
       
    36 
       
    37 gint TMSDTMFImpl::PostConstruct()
       
    38     {
       
    39     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
       
    40     TMSDTMFBody* bodyimpl(NULL);
       
    41     TRACE_PRN_FN_ENT;
       
    42     ret = TMSDTMFBodyImpl::Create(iStreamType, bodyimpl);
       
    43 
       
    44     if (ret == TMS_RESULT_SUCCESS)
       
    45         {
       
    46         this->iBody = bodyimpl;
       
    47         }
       
    48     TRACE_PRN_FN_EXT;
       
    49     return ret;
       
    50     }
       
    51 
       
    52 EXPORT_C gint TMSDTMFImpl::Create(TMSStreamType streamtype, TMSDTMF*& dtmf)
       
    53     {
       
    54     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
       
    55     TMSDTMFImpl *self = new TMSDTMFImpl(streamtype);
       
    56 
       
    57     TRACE_PRN_FN_ENT;
       
    58     if (self)
       
    59         {
       
    60         ret = self->PostConstruct();
       
    61         if (ret != TMS_RESULT_SUCCESS)
       
    62             {
       
    63             delete self;
       
    64             self = NULL;
       
    65             }
       
    66         }
       
    67     if (self && ret == TMS_RESULT_SUCCESS)
       
    68         {
       
    69         dtmf = self;
       
    70         ret = self->SetParent(dtmf);
       
    71         }
       
    72     TRACE_PRN_FN_EXT;
       
    73     return ret;
       
    74     }
       
    75 
       
    76 EXPORT_C gint TMSDTMFImpl::Delete(TMSDTMF*& dtmf)
       
    77     {
       
    78     gint ret(TMS_RESULT_SUCCESS);
       
    79     TRACE_PRN_FN_ENT;
       
    80     delete (TMSDTMFImpl*) (dtmf);
       
    81     dtmf = NULL;
       
    82     TRACE_PRN_FN_EXT;
       
    83     return ret;
       
    84     }
       
    85 
       
    86 gint TMSDTMFImpl::SetParent(TMSDTMF*& parent)
       
    87     {
       
    88     gint ret(TMS_RESULT_SUCCESS);
       
    89     if (this->iBody)
       
    90         {
       
    91         ((TMSDTMFBodyImpl*) this->iBody)->SetParent(parent);
       
    92         }
       
    93     else
       
    94         {
       
    95         ret = TMS_RESULT_UNINITIALIZED_OBJECT;
       
    96         }
       
    97     return ret;
       
    98     }
       
    99