mapnavproviderrefapp/src/mnrpappserverback.cpp
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2006 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:  CMnrpAppServerBack class implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <mnappserviceuids.hrh>
       
    20 #include "debug.h"
       
    21 
       
    22 #include <lbsposition.h>
       
    23 #include <EPos_CPosLandmark.h>
       
    24 
       
    25 #include "mnrpgeocodingservice.h"
       
    26 
       
    27 #ifdef RD_MAPNAV_BITMAP_ACCESS
       
    28 #include "mnrpmapimageservice.h"
       
    29 #endif
       
    30 
       
    31 #include "mnrpappuiback.h"
       
    32 #include "mnrpengine.h"
       
    33 #include "mnrpappserverback.h"
       
    34 
       
    35 // ============================ LOCAL FUNCTIONS ===============================
       
    36 
       
    37 // ============================ MEMBER FUNCTIONS ===============================
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 CMnrpAppServerBack::~CMnrpAppServerBack()
       
    43     {
       
    44     delete iEngine;
       
    45     }
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 CMnrpAppServerBack* CMnrpAppServerBack::NewL()
       
    51     {
       
    52     CMnrpAppServerBack* self = new (ELeave) CMnrpAppServerBack();
       
    53     CleanupStack::PushL( self );
       
    54     self->ConstructL();
       
    55     CleanupStack::Pop( self );
       
    56     return self;
       
    57     }
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 void CMnrpAppServerBack::ConstructL()
       
    63     {
       
    64     iEngine = CMnrpEngine::NewL();
       
    65     }
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 EXPORT_C CApaAppServiceBase* CMnrpAppServerBack::CreateServiceL(TUid aServiceType) const
       
    71     {
       
    72     LOG1("MnRefProviderBack::CreateServiceL, svcUid = %X", aServiceType.iUid);
       
    73     switch ( aServiceType.iUid )
       
    74         {
       
    75         case KMnAppGeocodingService:
       
    76             return CreateGeocodingServiceL();
       
    77 
       
    78 #ifdef RD_MAPNAV_BITMAP_ACCESS
       
    79         case KMnAppMapImageService:
       
    80             return CreateMapImageServiceL();
       
    81 #endif
       
    82         default:
       
    83             return CAknAppServer::CreateServiceL( aServiceType );
       
    84         }
       
    85     }
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // -----------------------------------------------------------------------------
       
    89 //
       
    90 CMnrpGeocodingService* CMnrpAppServerBack::CreateGeocodingServiceL() const
       
    91     {
       
    92     LOG( "MnRefProviderBack: CreateGeocodingServiceL" );
       
    93     CMnrpGeocodingService* svc = CMnrpGeocodingService::NewL( *iEngine );
       
    94     return svc;
       
    95     }
       
    96 
       
    97 #ifdef RD_MAPNAV_BITMAP_ACCESS
       
    98 // -----------------------------------------------------------------------------
       
    99 // -----------------------------------------------------------------------------
       
   100 //
       
   101 CMnrpMapImageService* CMnrpAppServerBack::CreateMapImageServiceL() const
       
   102     {
       
   103     LOG( "MnRefProviderBack: CreateGeocodingServiceL" );
       
   104     CMnrpMapImageService* svc = CMnrpMapImageService::NewL( *iEngine );
       
   105     return svc;
       
   106     }
       
   107 #endif