telephonyprotocols/pdplayer/umts/spudtel/src/cspudcontextelem.cpp
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2004-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 // spud context element
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #include "cspudcontextelem.h"
       
    24 
       
    25 /**
       
    26 @param aId - pdp context id
       
    27 @param aFactory - reference to etel driver factory
       
    28 @param aPdpFsmInterface reference to pdp fsm interface
       
    29 @return new spud context element
       
    30 */
       
    31 CSpudContextElem* CSpudContextElem::NewL(TContextId aId, 
       
    32 									CEtelDriverFactory& aFactory, 
       
    33 									CPdpFsmInterface& aPdpFsmInterface)
       
    34 	{
       
    35 	CSpudContextElem *me = new(ELeave) CSpudContextElem();
       
    36 	CleanupStack::PushL(me);
       
    37 	me->ConstructL(aId, aFactory, aPdpFsmInterface);
       
    38 	CleanupStack::Pop(me);
       
    39 	return me;
       
    40 	}
       
    41 
       
    42 /** 
       
    43 @param aId - pdp context id
       
    44 @param aFactory - reference to etel driver factory
       
    45 @param aPdpFsmInterface reference to pdp fsm interface
       
    46 */
       
    47 void CSpudContextElem::ConstructL(TContextId aId, 
       
    48 								CEtelDriverFactory& aFactory, 
       
    49 								CPdpFsmInterface& aPdpFsmInterface)
       
    50 	{
       
    51 	iContext = CEtelDriverContext::NewL(aId, aId == KPrimaryContextId?SpudMan::EPrimary:SpudMan::ESecondary, aFactory);
       
    52 	iPdpStatusChangeNotifier = new(ELeave) CPdpStatusChangeNotifier(aId, 
       
    53 													iContext->PacketContext(), 
       
    54 													aPdpFsmInterface);
       
    55 	iQoSChangeNotifier = new(ELeave) CQoSChangeNotifier(aId, 
       
    56 													iContext->PacketQoS(), 
       
    57 													aPdpFsmInterface);
       
    58 	iPdpConfigChangeNotifier = CPdpConfigChangeNotifier::NewL(aId, 
       
    59 													iContext->PacketContext(), 
       
    60 													aPdpFsmInterface);
       
    61 	}
       
    62 
       
    63 CSpudContextElem::~CSpudContextElem()
       
    64 	{
       
    65 	delete iPdpStatusChangeNotifier;
       
    66 	delete iQoSChangeNotifier;
       
    67 	delete iPdpConfigChangeNotifier;
       
    68 	delete iContext;
       
    69 	}
       
    70 
       
    71 /** starts all notifiers */
       
    72 void CSpudContextElem::Start()
       
    73 	{
       
    74 	iPdpStatusChangeNotifier->Start();
       
    75 	iQoSChangeNotifier->Start();
       
    76 	iPdpConfigChangeNotifier->Start();
       
    77 	}
       
    78 	
       
    79 /** cancels all notifiers */
       
    80 void CSpudContextElem::Cancel()
       
    81 	{
       
    82 	iPdpStatusChangeNotifier->Cancel();
       
    83 	iQoSChangeNotifier->Cancel();
       
    84 	iPdpConfigChangeNotifier->Cancel();
       
    85 	}
       
    86 	
       
    87 	
       
    88 	/**
       
    89 @param aId - pdp context id
       
    90 @param aFactory - reference to etel driver factory
       
    91 @param aPdpFsmInterface reference to pdp fsm interface
       
    92 @return new spud context element
       
    93 */
       
    94 CMbmsContextElem* CMbmsContextElem::NewL(TContextId aId, 
       
    95 									CEtelDriverFactory& aFactory, 
       
    96 									CPdpFsmInterface& aPdpFsmInterface)
       
    97 	{
       
    98 	CMbmsContextElem *me = new(ELeave) CMbmsContextElem();
       
    99 	CleanupStack::PushL(me);
       
   100 	me->ConstructL(aId, aFactory, aPdpFsmInterface);
       
   101 	CleanupStack::Pop(me);
       
   102 	return me;
       
   103 	}
       
   104 
       
   105 /** 
       
   106 @param aId - pdp context id
       
   107 @param aFactory - reference to etel driver factory
       
   108 @param aPdpFsmInterface reference to pdp fsm interface
       
   109 */
       
   110 void CMbmsContextElem::ConstructL(TContextId aId, 
       
   111 								CEtelDriverFactory& aFactory, 
       
   112 								CPdpFsmInterface& aPdpFsmInterface)
       
   113 	{
       
   114 	iContext = CEtelDriverContext::NewL(aId, SpudMan::EMbms, aFactory);
       
   115 	iMbmsPdpStatusChangeNotifier = new(ELeave) CMbmsPdpStatusChangeNotifier(aId, 
       
   116 													iContext->MbmsPacketContext(), 
       
   117 													aPdpFsmInterface);
       
   118 	
       
   119 	iMbmsPdpConfigChangeNotifier = new(ELeave) CMbmsPdpConfigChangeNotifier(aId, 
       
   120 													iContext->MbmsPacketContext(), 
       
   121 													aPdpFsmInterface);
       
   122 	}
       
   123 
       
   124 CMbmsContextElem::~CMbmsContextElem()
       
   125 	{
       
   126 	delete iMbmsPdpStatusChangeNotifier;
       
   127 	delete iMbmsPdpConfigChangeNotifier;
       
   128 	delete iContext;
       
   129 	}
       
   130 
       
   131 /** starts all notifiers */
       
   132 void CMbmsContextElem::Start()
       
   133 	{
       
   134 	iMbmsPdpStatusChangeNotifier->Start();
       
   135 	iMbmsPdpConfigChangeNotifier->Start();
       
   136 	}
       
   137 	
       
   138 /** cancels all notifiers */
       
   139 void CMbmsContextElem::Cancel()
       
   140 	{
       
   141 	iMbmsPdpStatusChangeNotifier->Cancel();
       
   142 	iMbmsPdpConfigChangeNotifier->Cancel();
       
   143 	}
       
   144 	
       
   145 	
       
   146 	
       
   147