telephonyserverplugins/multimodetsy/hayes/PHONEFAC.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 // Phone Factory Class and DLL entry point
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "PHONEFAC.H"
       
    19 #include "mSLOGGER.H"
       
    20 #include "mPHONE.H"
       
    21 
       
    22 _LIT(KPhoneName,"GsmPhone1");
       
    23 
       
    24 const TInt KNumberOfPhones=1;
       
    25 
       
    26 
       
    27 //
       
    28 // First Ordinal Functions
       
    29 //
       
    30 extern "C"
       
    31 	{
       
    32 	IMPORT_C CPhoneFactoryBase* LibEntry(void);	// Force "Proper Name" export
       
    33 	}
       
    34 
       
    35 EXPORT_C CPhoneFactoryBase* LibEntry()
       
    36 	{
       
    37 	return new CPhoneFactoryHayes;
       
    38 	}
       
    39 
       
    40 //
       
    41 // Hayes Phone Factory Functions
       
    42 //
       
    43 CPhoneFactoryHayes::CPhoneFactoryHayes()
       
    44 	{
       
    45 	iVersion=TVersion(KEtelMajorVersionNumber,KEtelMinorVersionNumber,KEtelBuildVersionNumber);
       
    46 	}
       
    47 
       
    48 CPhoneFactoryHayes::~CPhoneFactoryHayes()
       
    49 	{}
       
    50 
       
    51 CPhoneBase* CPhoneFactoryHayes::NewPhoneL(const TDesC& aName)
       
    52 //
       
    53 //	Return a new phone object
       
    54 //
       
    55 	{
       
    56 	if (aName.CompareF(KPhoneName)!=0)
       
    57 		{
       
    58 		User::Leave(KErrNotFound);
       
    59 		}
       
    60 	return CPhoneMobile::NewL();
       
    61 	}
       
    62 
       
    63 TInt CPhoneFactoryHayes::EnumeratePhones()
       
    64 //
       
    65 //	Core TSY only handles one phone
       
    66 //
       
    67 	{
       
    68 	return KNumberOfPhones;
       
    69 	}
       
    70 
       
    71 TInt CPhoneFactoryHayes::GetPhoneInfo(const TInt aIndex, RTelServer::TPhoneInfo& aInfo)
       
    72 //
       
    73 //	Return name of phone, number of lines and type of network
       
    74 //
       
    75 	{
       
    76 	if(aIndex!=0)
       
    77 		return KErrNotFound;
       
    78 	aInfo.iName.Copy(KPhoneName);
       
    79 	aInfo.iNumberOfLines=KNumberOfLines;
       
    80 	aInfo.iNetworkType=RTelServer::ENetworkTypeMobileDigital;
       
    81 	aInfo.iExtensions=(TUint)KETelExtMultimodeV1;
       
    82 	return KErrNone;
       
    83 	}
       
    84 
       
    85 TBool CPhoneFactoryHayes::IsSupported(const TInt aMixin)
       
    86 /** *  *
       
    87  * This method returnes true or false on the question if a specifik kind of functionality excists.  
       
    88  * @param aMixin contains information of manufacturer, model, revision and serialnumber. If the phone doesen't support some some of these, an empty string is returned. 
       
    89  * @return error code. KErrNone */
       
    90 
       
    91 
       
    92 	{
       
    93 
       
    94 	switch (aMixin)
       
    95 		{
       
    96 	case KETelFuncMobileNetwork:
       
    97 	case KETelFuncMobileIdentity:
       
    98 	case KETelFuncMobilePower:
       
    99 	case KETelFuncMobileSignal:
       
   100 	case KETelFuncMobileDataCall:
       
   101 	case KETelFuncMobileSmsMessaging:
       
   102 	case KETelFuncMobilePhonebook:
       
   103 	case KETelFuncMobileSmsStore:
       
   104 	case KETelFuncMobileOwnNumberStore:
       
   105 		return ETrue;
       
   106 	default:
       
   107 		return EFalse;
       
   108 		}
       
   109 	}
       
   110