gba/gbaapi/src/GbaUtility.cpp
changeset 0 164170e6151a
child 1 d5423fbb4f29
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2007 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 of CGbaUtility
       
    15 *
       
    16 */
       
    17 
       
    18 #include <gbautility.h>
       
    19 #include "GbaClientrequesthandler.h"
       
    20 #include "GBALogger.h"
       
    21 
       
    22 // -----------------------------------------------------------------------------
       
    23 // CGbaUtility::NewL()
       
    24 // -----------------------------------------------------------------------------
       
    25 //
       
    26 EXPORT_C CGbaUtility* CGbaUtility::NewL(MGbaObserver& aObserver)
       
    27     {
       
    28     CGbaUtility* self = CGbaUtility::NewLC(aObserver);
       
    29     CleanupStack::Pop( self );
       
    30     return(self) ;
       
    31     }
       
    32 
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // CGbaUtility::NewLC()
       
    36 // -----------------------------------------------------------------------------
       
    37 //
       
    38 EXPORT_C CGbaUtility* CGbaUtility::NewLC(MGbaObserver& aObserver)
       
    39     {
       
    40     CGbaUtility* self = new (ELeave) CGbaUtility();
       
    41     CleanupStack::PushL(self);
       
    42     self->ConstructL( aObserver );
       
    43     return self; 
       
    44     }
       
    45 
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // CGbaUtility::NewL()
       
    49 // factory function without observer
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 EXPORT_C CGbaUtility* CGbaUtility::NewL()
       
    53     {
       
    54     CGbaUtility* self = CGbaUtility::NewLC();
       
    55     CleanupStack::Pop( self );
       
    56     return(self) ;
       
    57     }
       
    58 
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // CGbaUtility::NewLC()
       
    62 // factory function without observer
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 EXPORT_C CGbaUtility* CGbaUtility::NewLC()
       
    66     {
       
    67     CGbaUtility* self = new (ELeave) CGbaUtility();
       
    68     CleanupStack::PushL(self);
       
    69     self->ConstructL();
       
    70     return self; 
       
    71     }
       
    72 
       
    73 // -----------------------------------------------------------------------------
       
    74 // CGbaUtility::ConstructL()
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 void CGbaUtility::ConstructL( MGbaObserver& aObserver )
       
    78     {
       
    79     iGbaRequestHandler = CGbaClientRequestHandler::NewL( aObserver );
       
    80     }
       
    81 
       
    82 
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 // CGbaUtility::ConstructL()
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 void CGbaUtility::ConstructL()
       
    89     {
       
    90     iGbaRequestHandler = CGbaClientRequestHandler::NewL();
       
    91     }
       
    92 
       
    93 
       
    94 // -----------------------------------------------------------------------------
       
    95 // CGbaUtility::CGbaUtility()
       
    96 // -----------------------------------------------------------------------------
       
    97 //
       
    98 CGbaUtility::CGbaUtility()
       
    99     {
       
   100     
       
   101     }
       
   102 
       
   103 
       
   104 // -----------------------------------------------------------------------------
       
   105 // CGbaUtility::~CGbaUtility()
       
   106 // -----------------------------------------------------------------------------
       
   107 //
       
   108 CGbaUtility::~CGbaUtility()
       
   109     {
       
   110     delete iGbaRequestHandler;
       
   111     }
       
   112 
       
   113 
       
   114 // -----------------------------------------------------------------------------
       
   115 // CGbaUtility::Bootstrap()
       
   116 // -----------------------------------------------------------------------------
       
   117 //
       
   118 EXPORT_C TInt CGbaUtility::Bootstrap( const TGBABootstrapInputParams aInput, TGBABootstrapOutputParams& aOutput )
       
   119     {
       
   120     return iGbaRequestHandler->Bootstrap( aInput, aOutput );
       
   121     }
       
   122 
       
   123 
       
   124 // -----------------------------------------------------------------------------
       
   125 // CGbaUtility::Bootstrap()
       
   126 // -----------------------------------------------------------------------------
       
   127 //
       
   128 EXPORT_C void CGbaUtility::Bootstrap( const TGBABootstrapInputParams aInput, TGBABootstrapOutputParams& aOutput, TRequestStatus& aStatus )
       
   129     {
       
   130     iGbaRequestHandler->Bootstrap( aInput, aOutput, aStatus );    
       
   131     }    
       
   132 
       
   133 
       
   134 // -----------------------------------------------------------------------------
       
   135 // CGbaUtility::CancelBootstrap()
       
   136 // -----------------------------------------------------------------------------
       
   137 //
       
   138 EXPORT_C TInt CGbaUtility::CancelBootstrap()
       
   139     {
       
   140     return iGbaRequestHandler->CancelBootstrap();
       
   141     }
       
   142 
       
   143 
       
   144 
       
   145 // -----------------------------------------------------------------------------
       
   146 // CGbaUtility::SetBSFAddress()
       
   147 // -----------------------------------------------------------------------------
       
   148 //
       
   149 EXPORT_C TInt CGbaUtility::SetBSFAddress( const TDesC8& aAddress )
       
   150     {
       
   151     return iGbaRequestHandler->SetBSFAddress(aAddress);
       
   152     }
       
   153 
       
   154 
       
   155 //EOF