phoneuis/TelephonyDeviceMode/src/CTelDMHandlerImpl.cpp
changeset 0 5f000ab63145
child 21 92ab7f8d0eab
child 61 41a7f70b3818
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneuis/TelephonyDeviceMode/src/CTelDMHandlerImpl.cpp	Mon Jan 18 20:18:27 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2005-2006 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:  Implementation of the CTelDMFactoryImpl class.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <featmgr.h>
+#include    <mphonedevicemodeobserver.h>
+#include    <telinternalpskeys.h>
+#include    "CTelDMHandlerImpl.h"
+#include    "CTelDMGripHandler.h"
+#include 	"CTelDMCommandHandler.h"
+#include 	"CTelDMCallStateListener.h"
+#include	"CTelDMAudioAccessoryListener.h"
+#include	"CTelDMDebug.h"
+ 
+// MODULE DATA STRUCTURES
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTelDMHandlerImpl
+// 
+// Creates instance of telephony device mode factory.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTelDMHandler* CTelDMHandlerCreateL()
+    {
+    return CTelDMHandlerImpl::NewL();
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMHandlerImpl::CTelDMHandlerImpl
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CTelDMHandlerImpl::CTelDMHandlerImpl()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMHandlerImpl::~CTelDMHandlerImpl
+// -----------------------------------------------------------------------------
+//    
+CTelDMHandlerImpl::~CTelDMHandlerImpl()
+    {
+    delete iCallStateListener;
+    delete iAccessory;
+    delete iCommandHandler;
+    delete iGrip;
+    FLOG( _L( "CTelDMHandlerImpl::~CTelDMHandlerImpl()" ) )
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMHandlerImpl::NewL
+// 
+// -----------------------------------------------------------------------------
+//
+CTelDMHandlerImpl* CTelDMHandlerImpl::NewL()
+    {
+    CTelDMHandlerImpl* self = new( ELeave ) CTelDMHandlerImpl;
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// CTelDMHandlerImpl::SetObserverL
+// 
+// -----------------------------------------------------------------------------
+//
+void CTelDMHandlerImpl::SetObserverL( MPhoneDeviceModeObserver* aCallHandler )
+    {
+    // Default
+   	RProperty::Set( 
+   		KPSUidTelAudioPreference,
+        KTelAudioOutput,
+        EPSAudioPrivate );                
+                        
+    if ( !FeatureManager::FeatureSupported( KFeatureIdKeypadNoSlider ) )
+        {
+      	iCallStateListener = CTelDMCallStateListener::NewL();
+ 		iAccessory = CTelDMAudioAccessoryListener::NewL();
+ 		// Disconnects and answers to calls 
+        iCommandHandler = CTelDMCommandHandler::NewL( 
+        									*aCallHandler, 
+        									*iAccessory );
+
+        iCallStateListener->AddObserverL( *iCommandHandler );
+        
+        iGrip = CTelDMGripHandler::NewL( *iCommandHandler );
+
+        }
+    }
+
+//  End of File
+
+