realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileStateUnregInProg.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2007-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 // Name        : sipprofilestateunreginprog
       
    15 // Part of     : Sip Profile Server
       
    16 // implementation
       
    17 // Version     : 1.0
       
    18 //
       
    19 
       
    20 
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include "SipProfileStateUnregInProg.h"
       
    24 #include "SipProfileCacheItem.h"
       
    25 #include "sipplugindirector.h"
       
    26 #include "SipProfileLog.h"
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS ===============================
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CSIPProfileStateUnregInProg::NewL
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 CSIPProfileStateUnregInProg* CSIPProfileStateUnregInProg::NewL(
       
    35 	CSIPPluginDirector& aDirector)
       
    36     {
       
    37     return new (ELeave) CSIPProfileStateUnregInProg(aDirector);
       
    38     }
       
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 // CSIPProfileStateUnregInProg::CSIPProfileStateUnregInProg
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 CSIPProfileStateUnregInProg::CSIPProfileStateUnregInProg(
       
    45 	CSIPPluginDirector& aDirector):
       
    46 	CSIPProfileState(aDirector)
       
    47     {
       
    48     }
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // CSIPProfileStateUnregInProg::~CSIPProfileStateUnregInProg
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 CSIPProfileStateUnregInProg::~CSIPProfileStateUnregInProg()
       
    55     {
       
    56     }
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CSIPProfileStateUnregInProg::Name
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 CSIPConcreteProfile::TStatus CSIPProfileStateUnregInProg::Name() const
       
    63 	{
       
    64 	return CSIPConcreteProfile::EUnregistrationInProgress;
       
    65 	}
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // CSIPProfileStateUnregInProg::SetNeighbourStates
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 void
       
    72 CSIPProfileStateUnregInProg::SetNeighbourStates(CSIPProfileState& aUnregistered,
       
    73 												CSIPProfileState& aRegistered)
       
    74 	{
       
    75 	iUnregistered = &aUnregistered;
       
    76 	iRegistered = &aRegistered;
       
    77 	}
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // CSIPProfileStateUnregInProg::EnableL
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 void CSIPProfileStateUnregInProg::EnableL(CSIPProfileCacheItem& aItem,
       
    84 	const MSIPExtendedConcreteProfileObserver& aObserver)     
       
    85 	{
       
    86 	PROFILE_DEBUG3("ProfileStateUnregInProg::EnableL id", aItem.ProfileId())
       
    87 	DoCommonEnableL(aItem, aObserver);
       
    88 	}
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // CSIPProfileStateUnregInProg::EnableSnapInUseL
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 void CSIPProfileStateUnregInProg::EnableSnapInUseL(
       
    95 	CSIPProfileCacheItem& aItem,
       
    96 	const MSIPExtendedConcreteProfileObserver& aObserver,
       
    97 	TUint32 /*aSnapId*/)
       
    98 	{
       
    99 	PROFILE_DEBUG3("ProfileStateUnregInProg::EnableSnapInUseL id,snap",
       
   100 				   aItem.ProfileId())
       
   101 	DoCommonEnableL(aItem, aObserver);
       
   102 	}
       
   103 
       
   104 // -----------------------------------------------------------------------------
       
   105 // CSIPProfileStateUnregInProg::DisableL
       
   106 // -----------------------------------------------------------------------------
       
   107 //
       
   108 void CSIPProfileStateUnregInProg::DisableL(
       
   109 	CSIPProfileCacheItem& aItem,
       
   110 	const MSIPExtendedConcreteProfileObserver& aObserver)     
       
   111 	{
       
   112 	PROFILE_DEBUG3("ProfileStateUnregInProg::DisableL id", aItem.ProfileId())
       
   113 
       
   114 	DoCommonDisable(aItem, aObserver);
       
   115 	}
       
   116 
       
   117 // -----------------------------------------------------------------------------
       
   118 // CSIPProfileStateUnregInProg::UpdateRegistrationL
       
   119 // -----------------------------------------------------------------------------
       
   120 //
       
   121 void CSIPProfileStateUnregInProg::UpdateRegistrationL(
       
   122 	CSIPProfileCacheItem& aItem,
       
   123 	const MSIPExtendedConcreteProfileObserver& /*aObserver*/)
       
   124 	{
       
   125 	TUint profileId(aItem.ProfileId());
       
   126 	PROFILE_DEBUG3("ProfileStateUnregInProg::UpdateRegistrationL id", profileId)
       
   127 	}
       
   128 
       
   129 // -----------------------------------------------------------------------------
       
   130 // CSIPProfileStateUnregInProg::RegistrationStatusEventL
       
   131 // -----------------------------------------------------------------------------
       
   132 //
       
   133 void CSIPProfileStateUnregInProg::RegistrationStatusEventL(
       
   134 	CSIPProfileCacheItem& aItem,
       
   135 	CSIPConcreteProfile::TStatus aStatus)
       
   136 	{
       
   137 	PROFILE_DEBUG4("ProfileStateUnregInProg::RegStatusEventL id,status",
       
   138 				   aItem.ProfileId(),
       
   139 				   aStatus)
       
   140 
       
   141 	if (aStatus == CSIPConcreteProfile::ERegistered)
       
   142 		{
       
   143 		aItem.ChangeStateL(iRegistered);
       
   144 		}
       
   145 	else if (aStatus == CSIPConcreteProfile::EUnregistered)
       
   146 		{
       
   147 		aItem.ChangeStateL(iUnregistered);
       
   148 		}
       
   149 	else
       
   150 		{
       
   151 		}
       
   152 	}
       
   153 
       
   154 // -----------------------------------------------------------------------------
       
   155 // CSIPProfileStateUnregInProg::ErrorOccurred
       
   156 // -----------------------------------------------------------------------------
       
   157 //
       
   158 TBool CSIPProfileStateUnregInProg::ErrorOccurred(CSIPProfileCacheItem& aItem, 
       
   159 											     TInt /*aError*/)
       
   160 	{
       
   161 	PROFILE_DEBUG3("ProfileStateUnregInProg::ErrorOccurred(profile id)",
       
   162 				   aItem.ProfileId())
       
   163 	DoCommonErrorOccurred(aItem);
       
   164 	return ETrue;
       
   165 	}