mmserv/tms/tmsimpl/src/tmscallimpl.cpp
changeset 0 71ca22bcf22a
child 10 3d8c721bf319
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     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 <tms.h>
       
    19 #include "tmsutility.h"
       
    20 #include "tmsipcallbodyimpl.h"
       
    21 #include "tmscscallbodyimpl.h"
       
    22 #include "tmscallimpl.h"
       
    23 
       
    24 using namespace TMS;
       
    25 
       
    26 TMSCallImpl::TMSCallImpl()
       
    27     {
       
    28     TRACE_PRN_FN_ENT;
       
    29     TRACE_PRN_FN_EXT;
       
    30     }
       
    31 
       
    32 TMSCallImpl::~TMSCallImpl()
       
    33     {
       
    34     TRACE_PRN_FN_ENT;
       
    35     TRACE_PRN_FN_EXT;
       
    36     }
       
    37 
       
    38 gint TMSCallImpl::PostConstruct(TMSCallType ctype, guint /*ctxid*/)
       
    39     {
       
    40     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
       
    41     TMSCallBody* tmscallimplbody(NULL);
       
    42 
       
    43     TRACE_PRN_FN_ENT;
       
    44 
       
    45     switch (ctype)
       
    46         {
       
    47         case TMS_CALL_IP:
       
    48             ret = TMSIPCallBodyImpl::Create(tmscallimplbody);
       
    49             break;
       
    50         case TMS_CALL_CS:
       
    51             ret = TMSCSCallBodyImpl::Create(tmscallimplbody);
       
    52             break;
       
    53         default:
       
    54             ret = TMS_RESULT_CALL_TYPE_NOT_SUPPORTED;
       
    55             break;
       
    56         };
       
    57 
       
    58     if (ret == TMS_RESULT_SUCCESS)
       
    59         {
       
    60         this->iBody = tmscallimplbody;
       
    61         }
       
    62     TRACE_PRN_FN_EXT;
       
    63     return ret;
       
    64     }
       
    65 
       
    66 // TO DO stop exporting this function
       
    67 EXPORT_C gint TMSCallImpl::Create(TMSCallType ctype, TMSCall*& tmscall,
       
    68         guint ctxid)
       
    69     {
       
    70     gint ret(TMS_RESULT_INSUFFICIENT_MEMORY);
       
    71     TMSCallImpl *self = new TMSCallImpl;
       
    72 
       
    73     TRACE_PRN_FN_ENT;
       
    74     if (self)
       
    75         {
       
    76         ret = self->PostConstruct(ctype, ctxid);
       
    77         if (ret != TMS_RESULT_SUCCESS)
       
    78             {
       
    79             delete self;
       
    80             self = NULL;
       
    81             }
       
    82         }
       
    83     tmscall = self;
       
    84     TRACE_PRN_FN_EXT;
       
    85     return ret;
       
    86     }
       
    87 
       
    88 // End of file