mmserv/tms/tmscallserver/src/tmscalladpt.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 15 Jul 2010 19:13:36 +0300
branchRCL_3
changeset 17 60e492b28869
parent 11 3570217d8c21
child 19 095bea5f582e
permissions -rw-r--r--
Revision: 201025 Kit: 2010127

/*
 * Copyright (c) 2009 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: Telephony Multimedia Service
 *
 */

#include <tms.h>
#include "tmscallipadpt.h"
#include "tmscallcsadpt.h"
#include "tmscalladpt.h"
#include "tmsutility.h"

using namespace TMS;

// -----------------------------------------------------------------------------
// TMSCallAdpt::TMSCallAdpt
//
// -----------------------------------------------------------------------------
//
TMSCallAdpt::TMSCallAdpt()
    {
    TRACE_PRN_FN_ENT;
    TRACE_PRN_FN_EXT;
    }

// -----------------------------------------------------------------------------
// TMSCallAdpt::~TMSCallAdpt
//
// -----------------------------------------------------------------------------
//
TMSCallAdpt::~TMSCallAdpt()
    {
    TRACE_PRN_FN_ENT;
    TRACE_PRN_FN_EXT;
    }

// -----------------------------------------------------------------------------
// TMSCallAdpt::CreateCallL
//
// -----------------------------------------------------------------------------
//
gint TMSCallAdpt::CreateCallL(gint callType, TMSCallAdpt*& callAdpt)
    {
    TRACE_PRN_FN_ENT;
    TMSCallAdpt* self(NULL);
    gint retVal(TMS_RESULT_SUCCESS);
    switch (callType)
        {
        case TMS_CALL_IP:
            retVal = TMS_RESULT_INSUFFICIENT_MEMORY;
            self = TMSCallIPAdpt::NewL();
            if (self)
                {
                retVal = self->PostConstruct();
                if (retVal != TMS_RESULT_SUCCESS)
                    {
                    delete self;
                    self = NULL;
                    }
                }
            break;

        case TMS_CALL_CS:
            retVal = TMS_RESULT_INSUFFICIENT_MEMORY;
            self = TMSCallCSAdpt::NewL();
            if (self)
                {
                retVal = self->PostConstruct();
                if (retVal != TMS_RESULT_SUCCESS)
                    {
                    delete self;
                    self = NULL;
                    }
                }
            break;
        default:
            retVal = TMS_RESULT_CALL_TYPE_NOT_SUPPORTED;
            break;
        }
    callAdpt = self;
    TRACE_PRN_FN_EXT;
    return retVal;
    }

// End of file