telephonyprotocols/csdagt/src/ND_DLIN.CPP
changeset 0 3553901f7fa8
child 19 630d2f34d719
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2003-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 // Dial In State Machine
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file Nd_dlin.cpp 
       
    20 */
       
    21 
       
    22 #include "ND_DLIN.H"
       
    23 #include "ND_ETEL.H"
       
    24 #include "ND_STD.H"
       
    25 #include "SLOGGER.H"
       
    26 #include "Nd_dlinStates.h"
       
    27 #include <comms-infras/eventlogger.h>
       
    28 #include "ND_DBACC.H"
       
    29 
       
    30 // Dial In state machine
       
    31 
       
    32 CDlInAgXSM* CDlInAgXSM::NewL(MAgentNotify& aObserver, CDialogProcessor* aDlgPrc, CCommsDbAccess& aDbAccess)
       
    33 /**
       
    34 2 phased constructor, first phase.
       
    35 
       
    36 @param aObserver a reference to state machine observer.
       
    37 @param aDlgPrc a pointer to dialog processor.
       
    38 @param aDbAccess a referecen to CommDB accessor
       
    39 @exception Leaves if ConstructL() leaves, or not enough memory is available.
       
    40 @return a new CDlInAgXSM object.
       
    41 */
       
    42 	{
       
    43 	CDlInAgXSM* r=new(ELeave) CDlInAgXSM(aObserver,aDlgPrc,aDbAccess);
       
    44 	CleanupStack::PushL(r);
       
    45 	r->ConstructL();
       
    46 	CleanupStack::Pop();
       
    47 	return r;
       
    48 	}
       
    49 
       
    50 CDlInAgXSM::CDlInAgXSM(MAgentNotify& aObserver, CDialogProcessor* aDlgPrc, CCommsDbAccess& aDbAccess)
       
    51 	: CNetdialSM(aObserver,aDlgPrc,aDbAccess)
       
    52 /**
       
    53 Private constructor used in the first phase of construction.
       
    54 
       
    55 @param aObserver a reference to state machine observer.
       
    56 @param aDlgPrc a pointer to the dialog processor.
       
    57 @param aDbAccess a reference to the database accessor.
       
    58 */
       
    59 	{}
       
    60 
       
    61 CDlInAgXSM::~CDlInAgXSM()
       
    62 /**
       
    63 Destructor. Cancels active requests.
       
    64 */
       
    65 	{
       
    66 	Cancel();
       
    67 	}
       
    68 
       
    69 void CDlInAgXSM::ConstructL()
       
    70 /**
       
    71 Private constructor used in the first phase of construction.
       
    72 Calls base call constructor CNetdialSM::ConstructL() and calls CDlInInit::NewL().
       
    73 
       
    74 @exception Leaves if CNetdialSM::ConstructL() or dial in init state creation leaves.
       
    75 */
       
    76 	{
       
    77 	CNetdialSM::ConstructL();
       
    78 	//Start off the state machine with an Initial state which contains no functionality
       
    79 	iState=CDlInInit::NewL(*this,*this);
       
    80 	}
       
    81 
       
    82 TBool CDlInAgXSM::UseScript() const
       
    83 /**
       
    84 Returns EFalse.
       
    85 
       
    86 @return EFalse.
       
    87 */
       
    88 	{
       
    89 	return EFalse;
       
    90 	}
       
    91 
       
    92 void CDlInAgXSM::SetUpScriptL()
       
    93 /**
       
    94 Panics if called.
       
    95 
       
    96 @exception Panics with EScriptingUnsupportedInDialIn.
       
    97 */
       
    98 	{
       
    99 	NetDialPanic(EScriptingUnsupportedInDialIn);
       
   100 	}
       
   101 
       
   102 TBool CDlInAgXSM::IsReconnect() const
       
   103 /**
       
   104 Returns EFalse.
       
   105 
       
   106 @return EFalse.
       
   107 */
       
   108 	{
       
   109 	return EFalse;
       
   110 	}
       
   111 
       
   112 TInt CDlInAgXSM::Notification(TNifToAgentEventType aEvent, TAny* /*aInfo*/)
       
   113 /**
       
   114 Act on / reply to NifMan's notification requests
       
   115 */
       
   116 	{
       
   117 	switch (aEvent)
       
   118 		{
       
   119 	case ENifToAgentEventTypePPPCallbackGranted:
       
   120 		return KErrNotSupported;
       
   121 	case ENifToAgentEventTypeQueryIsDialIn:
       
   122 		return ENDDialTypeDialIn;
       
   123 	default:
       
   124 		return KErrNone;
       
   125 		}
       
   126 	}
       
   127 
       
   128 TInt CDlInAgXSM::IncomingConnectionReceived()
       
   129 /**
       
   130 Informs observer about incoming connection with IncomingConnectionReceived().
       
   131 */
       
   132 	{
       
   133 	return iControllerObserver->IncomingConnectionReceived();
       
   134 	}