telephonyserver/etelserverandcore/DSTDNC/dstaticcall.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "dstaticcall.h"
       
    17 #include "../DSTD/DDEF.H"
       
    18 
       
    19 // Literals used in the constructor
       
    20 
       
    21 //
       
    22 //	CCallStaticCall
       
    23 //
       
    24 CCallStaticCall* CCallStaticCall::NewL(CPhoneFactoryDummyBase* aFac)
       
    25 //
       
    26 //	Static function to create new call
       
    27 //
       
    28 	{
       
    29 	CCallStaticCall* call=new(ELeave) CCallStaticCall(aFac);
       
    30 	CleanupStack::PushL(call);
       
    31 	call->ConstructL();
       
    32 	CleanupStack::Pop();
       
    33 	return call;
       
    34 	}
       
    35 
       
    36 CCallStaticCall::CCallStaticCall(CPhoneFactoryDummyBase* aFac)
       
    37 	:CCallDummyBase(aFac)
       
    38 	{}
       
    39 
       
    40 void CCallStaticCall::ConstructL()
       
    41 //
       
    42 //	For future use
       
    43 //
       
    44 	{
       
    45 	CCallDummyBase::ConstructL();
       
    46 	}
       
    47 
       
    48 CCallStaticCall::~CCallStaticCall()
       
    49 	{
       
    50 	}
       
    51 
       
    52 TInt CCallStaticCall::ExtFunc(const TTsyReqHandle,const TInt,const TDataPackage&)
       
    53 //
       
    54 //	not supported by the core tsy
       
    55 //
       
    56 	{
       
    57 	return KErrNotSupported;
       
    58 	}
       
    59 
       
    60 CTelObject* CCallStaticCall::OpenNewObjectByNameL(const TDesC&)
       
    61 //
       
    62 //	open aFax within the context of a call
       
    63 //
       
    64 	{
       
    65 	User::Leave(KErrNotSupported);
       
    66 	return NULL;
       
    67 	}
       
    68 
       
    69 CTelObject* CCallStaticCall::OpenNewObjectL(TDes&)
       
    70 	{
       
    71 	User::Leave(KErrNotSupported);
       
    72 	return NULL;
       
    73 	}
       
    74 
       
    75 TInt CLineStaticCall::EnumerateCall(const TTsyReqHandle aUid,TInt* aCount)
       
    76 	{
       
    77 	*aCount=1;
       
    78 	ReqCompleted(aUid,KErrNone);
       
    79 	return KErrNone;
       
    80 	}
       
    81 
       
    82 TInt CLineStaticCall::GetCallInfo(const TTsyReqHandle aUid,TCallInfoIndex*)
       
    83 	{
       
    84 	ReqCompleted(aUid,KErrNone);
       
    85 	return KErrNone;
       
    86 	}
       
    87 
       
    88 //
       
    89 //	CLineStaticCall
       
    90 //
       
    91 CLineStaticCall* CLineStaticCall::NewL(const TDesC&,CPhoneFactoryDummyBase* aFac)
       
    92 //
       
    93 //	Static Function for a New Line
       
    94 //
       
    95 	{
       
    96 	CLineStaticCall* line=new(ELeave) CLineStaticCall(aFac);
       
    97 	CleanupStack::PushL(line);
       
    98 	line->ConstructL();
       
    99 	CleanupStack::Pop();
       
   100 	return line;
       
   101 	}
       
   102 
       
   103 CLineStaticCall::CLineStaticCall(CPhoneFactoryDummyBase* aFac)
       
   104 	:CLineDummyBase(aFac)
       
   105 	{}
       
   106 
       
   107 void CLineStaticCall::ConstructL()
       
   108 	{
       
   109 	iCall=CCallStaticCall::NewL(FacPtr());
       
   110 	}
       
   111 
       
   112 CLineStaticCall::~CLineStaticCall()
       
   113 	{
       
   114 	if (iCall)
       
   115 		iCall->Close();
       
   116 	}
       
   117 
       
   118 CTelObject* CLineStaticCall::OpenNewObjectByNameL(const TDesC&)
       
   119 //
       
   120 //	Open subsession extension within context of a line
       
   121 //
       
   122 	{
       
   123 	return NULL;
       
   124 	}
       
   125 
       
   126 CTelObject* CLineStaticCall::OpenNewObjectL(TDes&)
       
   127 	{
       
   128 	iCall->Open();
       
   129 	return iCall;
       
   130 	}
       
   131 
       
   132 TInt CLineStaticCall::ExtFunc(const TTsyReqHandle,const TInt,const TDataPackage&)
       
   133 //
       
   134 //	not supported by the core tsy
       
   135 //
       
   136 	{
       
   137 	return KErrNotSupported;
       
   138 	}
       
   139 
       
   140 //
       
   141 //	CPhoneStaticCall
       
   142 //
       
   143 CPhoneStaticCall* CPhoneStaticCall::NewL(CPhoneFactoryDummyBase* aFac)
       
   144 //
       
   145 //	Create new phone
       
   146 //
       
   147 	{
       
   148 	CPhoneStaticCall* phone=new(ELeave) CPhoneStaticCall(aFac);
       
   149 	CleanupStack::PushL(phone);
       
   150 	phone->ConstructL();
       
   151 	CleanupStack::Pop();
       
   152 	return phone;
       
   153 	}
       
   154 
       
   155 CPhoneStaticCall::CPhoneStaticCall(CPhoneFactoryDummyBase* aFac)
       
   156 	:CPhoneDummyBase(aFac)
       
   157 	{}
       
   158 
       
   159 void CPhoneStaticCall::ConstructL()
       
   160 	{}
       
   161 
       
   162 CPhoneStaticCall::~CPhoneStaticCall()
       
   163 	{}
       
   164 
       
   165 TInt CPhoneStaticCall::EnumerateLines(const TTsyReqHandle aTsyReqHandle,TInt*)
       
   166 	{
       
   167 	ReqCompleted(aTsyReqHandle,KErrNotSupported);
       
   168 	return KErrNone;
       
   169 	}
       
   170 
       
   171 TInt CPhoneStaticCall::GetLineInfo(const TTsyReqHandle aTsyReqHandle,TLineInfoIndex*)
       
   172 	{
       
   173 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   174 	return KErrNone;
       
   175 	}
       
   176 
       
   177 TInt CPhoneStaticCall::ExtFunc(const TTsyReqHandle,const TInt,const TDataPackage&)
       
   178 //
       
   179 //	Not Supported by the Core
       
   180 //
       
   181 	{
       
   182 	return KErrNotSupported;
       
   183 	}
       
   184 
       
   185 CTelObject* CPhoneStaticCall::OpenNewObjectByNameL(const TDesC& aName)
       
   186 //
       
   187 //	Open New Line within the Context of a Phone
       
   188 //
       
   189 	{
       
   190 	if(aName.Compare(DSTATICCALL_LINE_NAME)==KErrNone)
       
   191 		return REINTERPRET_CAST(CTelObject*,CLineStaticCall::NewL(aName,FacPtr()));
       
   192 	return NULL;
       
   193 	}
       
   194 
       
   195 CTelObject* CPhoneStaticCall::OpenNewObjectL(TDes&)
       
   196 	{
       
   197 	User::Leave(KErrNotSupported);
       
   198 	return NULL;
       
   199 	}
       
   200 
       
   201 void CPhoneStaticCall::Init()
       
   202 	{}
       
   203 
       
   204 //
       
   205 // StaticCall Phone Factory Functions
       
   206 //
       
   207 CPhoneFactoryStaticCall* CPhoneFactoryStaticCall::NewL()
       
   208 	{
       
   209 	CPhoneFactoryStaticCall *This = new (ELeave) CPhoneFactoryStaticCall;
       
   210 	CleanupStack::PushL(This);
       
   211 	This->ConstructL();
       
   212 	CleanupStack::Pop();
       
   213 	return This;
       
   214 	}
       
   215 
       
   216 CPhoneFactoryStaticCall::CPhoneFactoryStaticCall()
       
   217 //
       
   218 //	Constructor for Phone Factory
       
   219 //
       
   220 	{
       
   221 	iVersion=TVersion(	KTsyEtelMajorVersionNumber,
       
   222 						KTsyEtelMinorVersionNumber,
       
   223 						KTsyEtelBuildVersionNumber);
       
   224 	}
       
   225 
       
   226 CPhoneFactoryStaticCall::~CPhoneFactoryStaticCall()
       
   227 //
       
   228 //	D'tor
       
   229 //
       
   230 	{
       
   231 	iSemaphore.Close();
       
   232 	}
       
   233 
       
   234 CPhoneBase* CPhoneFactoryStaticCall::NewPhoneL(const TDesC& aName)
       
   235 //
       
   236 //	Create New Instance of Phone
       
   237 //
       
   238 	{
       
   239 	if (aName.Compare(DSTATICCALL_PHONE_NAME)==KErrNone)
       
   240 		return CPhoneStaticCall::NewL(this);
       
   241 	return NULL;
       
   242 	}
       
   243 
       
   244 TInt CPhoneFactoryStaticCall::GetPhoneInfo(const TInt aIndex, RTelServer::TPhoneInfo& aInfo)
       
   245 //
       
   246 //	Get Phone Info
       
   247 //
       
   248 	{
       
   249 	switch (aIndex)
       
   250 		{
       
   251 	case 0:
       
   252 		aInfo.iNetworkType=RTelServer::ENetworkTypeUnknown;
       
   253 		aInfo.iName=DSTATICCALL_PHONE_NAME;
       
   254 		aInfo.iNumberOfLines=1;
       
   255 		return KErrNone;
       
   256 	default:
       
   257 		return KErrNotFound;
       
   258 		}
       
   259 	}
       
   260 
       
   261 TInt CPhoneFactoryStaticCall::EnumeratePhones()
       
   262 	{
       
   263 	return 1;
       
   264 	}
       
   265 
       
   266 //
       
   267 // First Ordinal Functions
       
   268 //
       
   269 extern "C"
       
   270 	{
       
   271 	IMPORT_C CPhoneFactoryBase* LibEntry();	// Force "Proper Name" export
       
   272 	}
       
   273 
       
   274 EXPORT_C CPhoneFactoryBase* LibEntry()
       
   275 	{
       
   276 	CPhoneFactoryStaticCall* factory = NULL;
       
   277 	TRAP_IGNORE(factory = CPhoneFactoryStaticCall::NewL());
       
   278 	return factory;
       
   279 	}