supl/locationomasuplprotocolhandler/asnconverterpluginapi/src/epos_comasupllocationid.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:  Header file for location id information
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include "epos_comasupllocationid.h"
       
    20 
       
    21 
       
    22 // ============================ MEMBER FUNCTIONS OF COMASuplGSMCellInfo ===============================
       
    23 // -----------------------------------------------------------------------------
       
    24 // COMASuplGSMCellInfo::NewL() 
       
    25 // (other items were commented in a header).
       
    26 // -----------------------------------------------------------------------------
       
    27 //
       
    28 EXPORT_C COMASuplGSMCellInfo* COMASuplGSMCellInfo::NewL()
       
    29     {
       
    30     COMASuplGSMCellInfo* self = new( ELeave ) COMASuplGSMCellInfo;
       
    31     CleanupStack::PushL( self );
       
    32     self->ConstructL();
       
    33     CleanupStack::Pop(self);
       
    34     return self;
       
    35     }
       
    36 // -----------------------------------------------------------------------------
       
    37 // COMASuplGSMCellInfo::~COMASuplGSMCellInfo() 
       
    38 // (other items were commented in a header).
       
    39 // -----------------------------------------------------------------------------
       
    40 //    
       
    41 EXPORT_C COMASuplGSMCellInfo::~COMASuplGSMCellInfo()
       
    42     {
       
    43     }
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // COMASuplGSMCellInfo::SuplGSMCellInfo()
       
    47 // (other items were commented in a header).
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 EXPORT_C void COMASuplGSMCellInfo::SuplGSMCellInfo(TInt& aRefMNC,TInt& aRefMcc,TInt& aRefCI,TInt& aRefLAC) const 
       
    51 {
       
    52 	SuplCellInfo(aRefMNC,aRefMcc,aRefCI);
       
    53 	aRefLAC = iRefLAC; 		
       
    54 }
       
    55 // -----------------------------------------------------------------------------
       
    56 // COMASuplGSMCellInfo::SeCSuplGSMCellInfo()
       
    57 // (other items were commented in a header).
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 EXPORT_C void COMASuplGSMCellInfo::SetSuplGSMCellInfo(TInt aRefMNC,TInt aRefMcc,TInt aRefCI,TInt aRefLAC) 
       
    61 {
       
    62 	SetSuplCellInfo(aRefMNC,aRefMcc,aRefCI);
       
    63 	iRefLAC = aRefLAC; 		
       
    64 }
       
    65 // -----------------------------------------------------------------------------
       
    66 // COMASuplGSMCellInfo::deafult constructor() 
       
    67 // (other items were commented in a header).
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 EXPORT_C  COMASuplGSMCellInfo::COMASuplGSMCellInfo()
       
    71 	{		
       
    72 	}
       
    73 // -----------------------------------------------------------------------------
       
    74 // COMASuplGSMCellInfo::ConstructL() 
       
    75 // (other items were commented in a header).
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 void COMASuplGSMCellInfo::ConstructL()
       
    79     {
       
    80   	 iRefLAC = -1;
       
    81     }
       
    82 
       
    83 
       
    84 // ============================ MEMBER FUNCTIONS OF COMASuplCellInfo ===============================
       
    85 
       
    86 // -----------------------------------------------------------------------------
       
    87 // COMASuplCellInfo::NewL() 
       
    88 // (other items were commented in a header).
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 EXPORT_C COMASuplCellInfo* COMASuplCellInfo::NewL()
       
    92     {
       
    93     COMASuplCellInfo* self = new( ELeave ) COMASuplCellInfo;
       
    94     CleanupStack::PushL( self );
       
    95     self->ConstructL();
       
    96     CleanupStack::Pop(self);
       
    97     return self;
       
    98     }
       
    99 
       
   100 // -----------------------------------------------------------------------------
       
   101 // COMASuplCellInfo::~COMASuplCellInfo() 
       
   102 // (other items were commented in a header).
       
   103 // -----------------------------------------------------------------------------
       
   104 //    
       
   105 EXPORT_C COMASuplCellInfo::~COMASuplCellInfo()
       
   106     {
       
   107     }
       
   108 // -----------------------------------------------------------------------------
       
   109 // COMASuplCellInfo::SuplWCDMACellInfo()
       
   110 // (other items were commented in a header).
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 EXPORT_C void COMASuplCellInfo::SuplCellInfo(TInt& aRefMNC,
       
   114 										  TInt& aRefMCC,
       
   115 										  TInt& aRefCI)const
       
   116 {
       
   117 	aRefMNC = iRefMNC;	
       
   118 	aRefMCC = iRefMCC; 		
       
   119 	aRefCI  = iRefCI; 		
       
   120 }
       
   121 // -----------------------------------------------------------------------------
       
   122 // COMASuplCellInfo::SeCSuplCellInfo()
       
   123 // (other items were commented in a header).
       
   124 // -----------------------------------------------------------------------------
       
   125 //
       
   126 EXPORT_C void COMASuplCellInfo::SetSuplCellInfo(TInt aRefMNC,
       
   127 											 TInt aRefMCC,
       
   128 											 TInt aRefCI)												    
       
   129 {
       
   130 	iRefMNC = aRefMNC;	
       
   131 	iRefMCC = aRefMCC; 		
       
   132 	iRefCI  = aRefCI; 		
       
   133 }
       
   134 // -----------------------------------------------------------------------------
       
   135 // COMASuplCellInfo::GetCellId()
       
   136 // (other items were commented in a header).
       
   137 // -----------------------------------------------------------------------------
       
   138 //
       
   139 EXPORT_C TInt COMASuplCellInfo::GetCellId()
       
   140     {
       
   141     return iRefCI;
       
   142     }
       
   143 // -----------------------------------------------------------------------------
       
   144 // COMASuplCellInfo::deafult constructor() 
       
   145 // (other items were commented in a header).
       
   146 // -----------------------------------------------------------------------------
       
   147 //
       
   148 EXPORT_C  COMASuplCellInfo::COMASuplCellInfo()
       
   149 	{		
       
   150 	}
       
   151 // -----------------------------------------------------------------------------
       
   152 // COMASuplCellInfo::ConstructL() 
       
   153 // (other items were commented in a header).
       
   154 // -----------------------------------------------------------------------------
       
   155 //
       
   156 void COMASuplCellInfo::ConstructL()
       
   157     {
       
   158   	 iRefMNC = -1;	
       
   159 	 iRefMCC = -1;
       
   160 	 iRefCI  = -1; 	   
       
   161     }
       
   162     
       
   163 
       
   164 // ============================ MEMBER FUNCTIONS OF COMASuplLocationId ===============================
       
   165    
       
   166 // -----------------------------------------------------------------------------
       
   167 // COMASuplCellInfo::NewL() 
       
   168 // (other items were commented in a header).
       
   169 // -----------------------------------------------------------------------------
       
   170 //
       
   171 EXPORT_C COMASuplLocationId* COMASuplLocationId::NewL()
       
   172     {
       
   173     COMASuplLocationId* self = new( ELeave ) COMASuplLocationId;
       
   174     CleanupStack::PushL( self );
       
   175     self->ConstructL();
       
   176     CleanupStack::Pop(self);
       
   177     return self;
       
   178     }
       
   179 // -----------------------------------------------------------------------------
       
   180 // COMASuplLocationId::~COMASuplLocationId()
       
   181 // (other items were commented in a header).
       
   182 // -----------------------------------------------------------------------------
       
   183 //    
       
   184 EXPORT_C COMASuplLocationId::~COMASuplLocationId()
       
   185     {
       
   186     if(iCellInfo)
       
   187 	    {
       
   188 	    delete 	iCellInfo;
       
   189 	    iCellInfo = NULL;
       
   190 	    }
       
   191     }
       
   192 
       
   193 // -----------------------------------------------------------------------------
       
   194 // COMASuplLocationId::SuplLocationId()
       
   195 // (other items were commented in a header).
       
   196 // -----------------------------------------------------------------------------
       
   197 //
       
   198 EXPORT_C TInt  COMASuplLocationId::SuplLocationId(COMASuplCellInfo*& aCellInfo,
       
   199 											   TOMASuplStatus& aStatus) const
       
   200 {
       
   201  	if(EWCDMA == iChoice)
       
   202 	 	{
       
   203 	 	aCellInfo = iCellInfo;
       
   204 	 	aStatus = iStatus;	
       
   205 	 	return KErrNone;
       
   206 	 	}
       
   207 	else
       
   208 		{
       
   209 		return KErrArgument;
       
   210 		}			
       
   211 }
       
   212 // -----------------------------------------------------------------------------
       
   213 // COMASuplLocationId::SuplLocationId()
       
   214 // (other items were commented in a header).
       
   215 // -----------------------------------------------------------------------------
       
   216 //
       
   217 EXPORT_C TInt COMASuplLocationId::SuplLocationId(COMASuplGSMCellInfo*& aCellInfo,
       
   218 											  TOMASuplStatus& aStatus) const	
       
   219 {
       
   220  	if(EGSM == iChoice)
       
   221 	 	{
       
   222 	 	aCellInfo = (COMASuplGSMCellInfo*)iCellInfo;
       
   223 	 	aStatus = iStatus;	
       
   224 	 	return KErrNone;
       
   225 	 	}
       
   226 	else
       
   227 		{
       
   228 		return KErrArgument;
       
   229 		}		
       
   230 }	
       
   231 
       
   232 // -----------------------------------------------------------------------------
       
   233 // COMASuplCellInfo::SuplCellInfoType()
       
   234 // (other items were commented in a header).
       
   235 // -----------------------------------------------------------------------------
       
   236 // 
       
   237 EXPORT_C COMASuplLocationId::TOMASuplCellInfoType COMASuplLocationId::SuplCellInfoType()const
       
   238 {
       
   239  		return iChoice;
       
   240 }
       
   241 // -----------------------------------------------------------------------------
       
   242 // COMASuplLocationId::SetSuplLocationId()
       
   243 // (other items were commented in a header).
       
   244 // -----------------------------------------------------------------------------
       
   245 //
       
   246 EXPORT_C void  COMASuplLocationId::SetSuplLocationId(COMASuplCellInfo* aCellInfo,
       
   247 											      TOMASuplStatus& aStatus)
       
   248     {
       
   249     iChoice = EWCDMA;
       
   250     iCellInfo = aCellInfo;
       
   251     iStatus = aStatus;	
       
   252 
       
   253     }
       
   254 // -----------------------------------------------------------------------------
       
   255 // COMASuplLocationId::SetSuplLocationId()
       
   256 // (other items were commented in a header).
       
   257 // -----------------------------------------------------------------------------
       
   258 //
       
   259 EXPORT_C void  COMASuplLocationId::SetSuplLocationId(COMASuplGSMCellInfo* aCellInfo,
       
   260 											      TOMASuplStatus& aStatus)
       
   261     {
       
   262     delete iCellInfo;
       
   263     iCellInfo = NULL;
       
   264 
       
   265     iChoice = EGSM;
       
   266     iCellInfo = aCellInfo;
       
   267     iStatus = aStatus;	
       
   268     }
       
   269 // -----------------------------------------------------------------------------
       
   270 // COMASuplLocationId::GetCellId()
       
   271 // (other items were commented in a header).
       
   272 // -----------------------------------------------------------------------------
       
   273 //
       
   274 EXPORT_C TInt COMASuplLocationId::GetCellId()
       
   275     {
       
   276     if(iCellInfo)
       
   277         return iCellInfo->GetCellId();
       
   278     else
       
   279     	return KErrNotFound;
       
   280     }
       
   281 // -----------------------------------------------------------------------------
       
   282 // COMASuplLocationId::CloneL()
       
   283 // (other items were commented in a header).
       
   284 // -----------------------------------------------------------------------------
       
   285 //
       
   286 EXPORT_C COMASuplLocationId* COMASuplLocationId::CloneL()
       
   287     {
       
   288     COMASuplLocationId* retLocationId = COMASuplLocationId::NewL();
       
   289     CleanupStack::PushL(retLocationId);
       
   290     TInt refMNC,refMCC,refCI,refLac;
       
   291 
       
   292     switch(iChoice)
       
   293         {
       
   294         case EGSM:
       
   295             {
       
   296             ((COMASuplGSMCellInfo*)iCellInfo)->SuplGSMCellInfo(refMNC,refMCC,refCI,refLac);
       
   297             COMASuplGSMCellInfo* cellInfo = COMASuplGSMCellInfo::NewL();
       
   298             cellInfo->SetSuplGSMCellInfo(refMNC,refMCC,refCI,refLac);
       
   299             retLocationId->SetSuplLocationId(cellInfo,iStatus);
       
   300             }
       
   301             break;
       
   302         case EWCDMA:
       
   303             {
       
   304             iCellInfo->SuplCellInfo(refMNC,refMCC,refCI);
       
   305             COMASuplCellInfo* cellInfo = COMASuplCellInfo::NewL();
       
   306             cellInfo->SetSuplCellInfo(refMNC,refMCC,refCI);
       
   307             retLocationId->SetSuplLocationId(cellInfo,iStatus);
       
   308             }
       
   309             break;
       
   310 
       
   311         }
       
   312     CleanupStack::Pop(retLocationId);
       
   313     return retLocationId;
       
   314     }
       
   315 // -----------------------------------------------------------------------------
       
   316 // COMASuplLocationId::deafult constructor() 
       
   317 // (other items were commented in a header).
       
   318 // -----------------------------------------------------------------------------
       
   319 //    
       
   320 EXPORT_C  COMASuplLocationId::COMASuplLocationId()
       
   321 	{		
       
   322 	}
       
   323 // -----------------------------------------------------------------------------
       
   324 // COMASuplCellInfo::ConstructL() 
       
   325 // (other items were commented in a header).
       
   326 // -----------------------------------------------------------------------------
       
   327 //
       
   328 void COMASuplLocationId::ConstructL()
       
   329     {
       
   330     iStatus = EUnknown;
       
   331     iChoice = EWCDMA;
       
   332     }
       
   333 
       
   334 //  End of File