telephonyserver/etelserverandcore/DSTDNC/didenbad.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 1997-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 <e32base.h>
       
    17 #include "ET_PHONE.H"
       
    18 #include "DDEF.H"
       
    19 #include "didendef.h"
       
    20 #include "dbaddef.h"
       
    21 #include "../DSTDNC/DNCDEF.H"
       
    22 #include "didenbad.h"
       
    23 
       
    24 //
       
    25 //	First Ordinal Functions
       
    26 //
       
    27 extern	"C"
       
    28 	{
       
    29 	IMPORT_C CPhoneFactoryBase* LibEntry();	//	Force "Proper Name" export
       
    30 	}
       
    31 
       
    32 EXPORT_C CPhoneFactoryBase* LibEntry()
       
    33 	{
       
    34 	RFs fs;
       
    35 	TInt ret;
       
    36 	
       
    37 	ret = fs.Connect();
       
    38 	if (ret == KErrNone)
       
    39 		{
       
    40 		fs.Close();
       
    41 		}
       
    42 
       
    43 	return new CPhoneFactoryBad;
       
    44 	}
       
    45 
       
    46 //
       
    47 //	Bad Phone Factory Functions
       
    48 //
       
    49 CPhoneFactoryBad::CPhoneFactoryBad()
       
    50 	{
       
    51 	iVersion=TVersion(KTsyEtelMajorVersionNumber,
       
    52 					  KTsyEtelMinorVersionNumber,
       
    53 					  KTsyEtelBuildVersionNumber);
       
    54 	}
       
    55 
       
    56 CPhoneFactoryBad::~CPhoneFactoryBad()
       
    57 	{}
       
    58 
       
    59 CPhoneBase* CPhoneFactoryBad::NewPhoneL(const TDesC&)
       
    60 //
       
    61 // Only pretended to have two phones!
       
    62 //
       
    63 	{
       
    64 	User::Leave(KErrGeneral);
       
    65 	return NULL;
       
    66 	}
       
    67 
       
    68 TInt CPhoneFactoryBad::GetPhoneInfo(const TInt aIndex,RTelServer::TPhoneInfo& aInfo)
       
    69 //
       
    70 // Pretending There are Two Phones of the same name
       
    71 //
       
    72 	{
       
    73 	switch(aIndex)
       
    74 		{
       
    75 	case 0:
       
    76 		aInfo.iNetworkType=DSTDPM_NETWORK_TYPE;
       
    77 		aInfo.iName=DBAD_PHONE_NAME1;
       
    78 		aInfo.iNumberOfLines=DSTDPM_NUMBER_OF_LINES;
       
    79 		return KErrNone;
       
    80 	case 1:
       
    81 		aInfo.iNetworkType=DSTDNC_NETWORK_TYPE;
       
    82 		aInfo.iName=DBAD_PHONE_NAME2;
       
    83 		aInfo.iNumberOfLines=DSTDNC_NUMBER_OF_LINES;
       
    84 		return KErrNone;
       
    85 	default:
       
    86 		return KErrNotFound;
       
    87 		}
       
    88 	}
       
    89 
       
    90 TInt CPhoneFactoryBad::EnumeratePhones()
       
    91 //
       
    92 // Return as Two Phones
       
    93 //
       
    94 	{
       
    95 	return (DBADIDEN_NUMBER_OF_PHONES);
       
    96 	}
       
    97 
       
    98 TBool CPhoneFactoryBad::IsSupported(const TInt)
       
    99 	{
       
   100 	return EFalse;
       
   101 	}