supl/locationomasuplprotocolhandler/asnconverterpluginapi/src/epos_comasuplendver2.cpp
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  implementation for supl 2.0 end message
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 
       
    20 #include <e32def.h>
       
    21 #include "epos_comasuplendver2.h"
       
    22 #include "lbs/epos_comasuplsetcapabilities.h"
       
    23 #include "lbs/epos_comasuplposition.h"
       
    24 #include "lbs/epos_eomasuplposerrors.h"
       
    25 
       
    26 const TInt KSetCapsShift = 3;
       
    27 
       
    28 
       
    29 // ============================ MEMBER FUNCTIONS of COMASuplEndVer2===============================
       
    30     
       
    31 // -----------------------------------------------------------------------------
       
    32 // COMASuplEndVer2::NewL() 
       
    33 // (other items were commented in a header).
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 EXPORT_C COMASuplEndVer2* COMASuplEndVer2::NewL()
       
    37     {
       
    38     COMASuplEndVer2* self = new( ELeave ) COMASuplEndVer2;
       
    39     CleanupStack::PushL( self );
       
    40     self->ConstructL();
       
    41     CleanupStack::Pop(self);
       
    42     return self;
       
    43     }
       
    44     
       
    45 // -----------------------------------------------------------------------------
       
    46 // COMASuplEndVer2::~COMASuplEndVer2() 
       
    47 // (other items were commented in a header).
       
    48 // -----------------------------------------------------------------------------
       
    49 //    
       
    50 EXPORT_C COMASuplEndVer2::~COMASuplEndVer2()
       
    51     {
       
    52     if(iSETCapabilities)
       
    53         {
       
    54         delete iSETCapabilities;
       
    55         iSETCapabilities = NULL;
       
    56         }
       
    57     }
       
    58 // -----------------------------------------------------------------------------
       
    59 // COMASuplEndVer2::Position()
       
    60 // (other items were commented in a header).
       
    61 // -----------------------------------------------------------------------------
       
    62 //   			
       
    63 EXPORT_C TInt COMASuplEndVer2::SETCapabilities(COMASuplSETCapabilities *& aSETCapabilities)const
       
    64 {
       
    65 	if(iOptionalMask & (1<<(KSetCapsShift)))
       
    66 		{
       
    67  		aSETCapabilities = iSETCapabilities;
       
    68 		return KErrNone;
       
    69 		}
       
    70 	else
       
    71 		{
       
    72 		return KErrOMASuplParamNotSet;
       
    73 		}
       
    74 }						  			   
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // COMASuplEndVer2::SetPosition() 
       
    78 // (other items were commented in a header).
       
    79 // -----------------------------------------------------------------------------
       
    80 //   			
       
    81 EXPORT_C void COMASuplEndVer2::SetSETCapabilities(COMASuplSETCapabilities* aSETCapabilities)
       
    82 {	
       
    83 	delete iSETCapabilities;
       
    84 	iSETCapabilities = NULL;
       
    85 	
       
    86 	iSETCapabilities = aSETCapabilities;
       
    87 	if(iSETCapabilities)
       
    88 		{
       
    89 		iOptionalMask |= LEFTSHIFT(KSetCapsShift);		
       
    90 		}	
       
    91 }	
       
    92 // -----------------------------------------------------------------------------
       
    93 // COMASuplEndVer2::Clone() 
       
    94 // (other items were commented in a header).
       
    95 // -----------------------------------------------------------------------------
       
    96 // 
       
    97 EXPORT_C void COMASuplEndVer2::Clone(const COMASuplAsnMessageBase* aEnd,TInt& aErrorCode)
       
    98     {
       
    99     TRAP(aErrorCode, CloneBaseL(aEnd,aErrorCode));
       
   100     if(aErrorCode)
       
   101         return;
       
   102     COMASuplEndVer2* suplEnd = (COMASuplEndVer2*)aEnd;
       
   103     iOptionalMask = suplEnd->iOptionalMask;
       
   104     if(suplEnd->iOptionalMask & (1<<(1)))
       
   105         {
       
   106         iStatusCode = suplEnd->iStatusCode; 
       
   107         }
       
   108     if(suplEnd->iOptionalMask & (1<<(2)))
       
   109         {
       
   110         iVer.Copy(suplEnd->iVer);
       
   111         }
       
   112     if(suplEnd->iOptionalMask & (1<<(0)))
       
   113         {
       
   114         delete iPosition;
       
   115         iPosition = NULL;
       
   116         TRAP(aErrorCode,iPosition =static_cast <COMASuplPosition *> (suplEnd->iPosition->CloneL()));
       
   117         }
       
   118     if(suplEnd->iOptionalMask & (1<<(KSetCapsShift)))
       
   119         {
       
   120         delete iSETCapabilities;
       
   121         iSETCapabilities = NULL;
       
   122         TRAP(aErrorCode,iSETCapabilities = static_cast <COMASuplSETCapabilities *> (suplEnd->iSETCapabilities->CloneL()));
       
   123         }
       
   124     }						  			   
       
   125 // -----------------------------------------------------------------------------
       
   126 // COMASuplEndVer2::ConstructL() 
       
   127 // (other items were commented in a header).
       
   128 // -----------------------------------------------------------------------------
       
   129 //
       
   130 EXPORT_C void COMASuplEndVer2::ConstructL()
       
   131     {
       
   132     	COMASuplEnd::ConstructL();
       
   133     }
       
   134 // -----------------------------------------------------------------------------
       
   135 // COMASuplEndVer2::COMASuplEndVer2() 
       
   136 // (other items were commented in a header).
       
   137 // -----------------------------------------------------------------------------
       
   138 //
       
   139 EXPORT_C COMASuplEndVer2::COMASuplEndVer2()
       
   140 	{
       
   141 		
       
   142 	}
       
   143 
       
   144