applicationinterworkingfw/ServiceHandler/src/AiwServiceHandler.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2003-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:     Implements API for consumer application to access Application
       
    15 *                Interworking Framework. 
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #include <eikenv.h>
       
    23 #include <aiwservicehandler.rsg>
       
    24 #include "AiwMenuBinding.h"
       
    25 #include "AiwServiceHandler.h"
       
    26 #include "AiwServiceHandlerImpl.h"
       
    27 #include "AiwMenu.h"
       
    28 #include "AiwUids.hrh"
       
    29 #include "AiwCommon.hrh"
       
    30 #include "AiwTlsData.h"
       
    31 
       
    32 //
       
    33 // AiwServiceHandler
       
    34 //
       
    35 
       
    36 EXPORT_C CAiwServiceHandler* CAiwServiceHandler::NewL()
       
    37     {
       
    38     CAiwServiceHandler* handler = new (ELeave) CAiwServiceHandler();
       
    39     CleanupStack::PushL( handler );
       
    40     handler->ConstructL();
       
    41     CleanupStack::Pop(); // handler
       
    42     return handler;
       
    43     }
       
    44 
       
    45 
       
    46 EXPORT_C CAiwServiceHandler* CAiwServiceHandler::NewLC()
       
    47     {
       
    48     CAiwServiceHandler* handler = new (ELeave) CAiwServiceHandler();
       
    49     CleanupStack::PushL( handler );
       
    50     handler->ConstructL();
       
    51     return handler;     
       
    52     }
       
    53 
       
    54 
       
    55 CAiwServiceHandler::CAiwServiceHandler()
       
    56     {
       
    57     // Nothing to do here.
       
    58     }
       
    59 
       
    60 
       
    61 void CAiwServiceHandler::ConstructL()
       
    62     {
       
    63     iImpl = CAiwServiceHandlerImpl::NewL();
       
    64     }
       
    65 
       
    66 
       
    67 EXPORT_C CAiwServiceHandler::~CAiwServiceHandler()
       
    68     {
       
    69     delete iImpl;
       
    70     }
       
    71 
       
    72 
       
    73 EXPORT_C void CAiwServiceHandler::Reset()
       
    74     {
       
    75     iImpl->Reset();
       
    76     }
       
    77 
       
    78 
       
    79 EXPORT_C TInt CAiwServiceHandler::NbrOfProviders(const CAiwCriteriaItem* aCriteria)
       
    80     {
       
    81     return iImpl->NbrOfProviders(aCriteria);
       
    82     }
       
    83 
       
    84 
       
    85 EXPORT_C void CAiwServiceHandler::AttachL(TInt aInterestResourceId)
       
    86     {
       
    87     iImpl->AttachL(aInterestResourceId);
       
    88     }
       
    89 
       
    90 
       
    91 EXPORT_C void CAiwServiceHandler::AttachL(const RCriteriaArray& aInterest)
       
    92     {
       
    93     iImpl->AttachL(aInterest);
       
    94     }
       
    95 
       
    96 
       
    97 EXPORT_C void CAiwServiceHandler::GetInterest(RCriteriaArray& aInterest)
       
    98     {
       
    99     iImpl->GetInterest(aInterest);
       
   100     }
       
   101     
       
   102     
       
   103 EXPORT_C void CAiwServiceHandler::DetachL(const RCriteriaArray& aInterest)
       
   104     {
       
   105     iImpl->DetachL(aInterest);
       
   106     }
       
   107 
       
   108 
       
   109 EXPORT_C void CAiwServiceHandler::DetachL(TInt aInterestResourceId)
       
   110     {
       
   111     iImpl->DetachL(aInterestResourceId);
       
   112     }
       
   113 
       
   114 
       
   115 EXPORT_C const CAiwCriteriaItem* CAiwServiceHandler::GetCriteria(TInt aId)
       
   116     {
       
   117     return iImpl->GetCriteria(aId);
       
   118     }
       
   119 
       
   120 
       
   121 EXPORT_C void CAiwServiceHandler::InitializeMenuPaneL(
       
   122     CEikMenuPane& aMenuPane,
       
   123     TInt aMenuResourceId,
       
   124     TInt aBaseMenuCmdId,
       
   125     const CAiwGenericParamList& aInParamList)
       
   126     {
       
   127     iImpl->InitializeMenuPaneL(aMenuPane, 
       
   128         aMenuResourceId, 
       
   129         aBaseMenuCmdId, 
       
   130         aInParamList);   
       
   131     }
       
   132 
       
   133     
       
   134 EXPORT_C void CAiwServiceHandler::InitializeMenuPaneL(
       
   135     CEikMenuPane& aMenuPane,
       
   136     TInt aMenuResourceId,
       
   137     TInt aBaseMenuCmdId,
       
   138     const CAiwGenericParamList& aInParamList,
       
   139     TBool aUseSubmenuTextsIfAvailable)
       
   140     {
       
   141     iImpl->InitializeMenuPaneL(aMenuPane, 
       
   142         aMenuResourceId, 
       
   143         aBaseMenuCmdId, 
       
   144         aInParamList, 
       
   145         aUseSubmenuTextsIfAvailable);
       
   146     }    
       
   147 
       
   148 
       
   149 EXPORT_C void CAiwServiceHandler::InitializeMenuPaneL(
       
   150     CEikMenuPane& aMenuPane,
       
   151     TInt aMenuResourceId,
       
   152     TInt aBaseMenuCmdId,
       
   153     const CAiwGenericParamList& aInParamList,
       
   154     TBool aUseSubmenuTextsIfAvailable,
       
   155     TBool aSetAsItemSpecific )
       
   156     {
       
   157     iImpl->InitializeMenuPaneL(aMenuPane, 
       
   158         aMenuResourceId, 
       
   159         aBaseMenuCmdId, 
       
   160         aInParamList, 
       
   161         aUseSubmenuTextsIfAvailable,
       
   162         aSetAsItemSpecific);
       
   163     }    
       
   164 
       
   165     
       
   166 EXPORT_C TInt CAiwServiceHandler::ServiceCmdByMenuCmd(TInt aMenuCmdId) const
       
   167     {
       
   168     return iImpl->ServiceCmdByMenuCmd(aMenuCmdId);
       
   169     }
       
   170 
       
   171 
       
   172 EXPORT_C void CAiwServiceHandler::ExecuteMenuCmdL(
       
   173     TInt aMenuCmdId,
       
   174     const CAiwGenericParamList& aInParamList,
       
   175     CAiwGenericParamList& aOutParamList,
       
   176     TUint aCmdOptions,
       
   177     MAiwNotifyCallback* aCallback)
       
   178     {
       
   179     iImpl->ExecuteMenuCmdL(aMenuCmdId, aInParamList, aOutParamList, aCmdOptions, aCallback);
       
   180     }
       
   181 
       
   182 
       
   183 EXPORT_C void CAiwServiceHandler::AttachMenuL(TInt aMenuResourceId, TInt aInterestResourceId)
       
   184     {
       
   185     iImpl->AttachMenuL(aMenuResourceId, aInterestResourceId);
       
   186     }
       
   187 
       
   188 
       
   189 EXPORT_C void CAiwServiceHandler::AttachMenuL(TInt aMenuResourceId, TResourceReader& aReader)
       
   190     {
       
   191     iImpl->AttachMenuL(aMenuResourceId, aReader);
       
   192     }
       
   193 
       
   194 
       
   195 EXPORT_C void CAiwServiceHandler::AttachMenuL(TInt aMenuResourceId, const RCriteriaArray& aInterest)
       
   196     {
       
   197     iImpl->AttachMenuL(aMenuResourceId, aInterest);
       
   198     }    
       
   199 
       
   200 
       
   201 EXPORT_C void CAiwServiceHandler::DetachMenu(TInt aMenuResourceId, TInt aInterestResourceId)
       
   202     {
       
   203     iImpl->DetachMenu(aMenuResourceId, aInterestResourceId);
       
   204     }
       
   205 
       
   206 
       
   207 EXPORT_C TBool CAiwServiceHandler::IsSubMenuEmpty(TInt aSubMenuId)
       
   208     {
       
   209     return iImpl->IsSubMenuEmpty(aSubMenuId);
       
   210     }
       
   211 
       
   212 
       
   213 EXPORT_C void CAiwServiceHandler::ExecuteServiceCmdL(
       
   214     const TInt& aCmdId,
       
   215     const CAiwGenericParamList& aInParamList,
       
   216     CAiwGenericParamList& aOutParamList,
       
   217     TUint aCmdOptions,
       
   218     MAiwNotifyCallback* aCallback)
       
   219     {
       
   220     iImpl->ExecuteServiceCmdL(aCmdId, aInParamList, aOutParamList, aCmdOptions, aCallback);
       
   221     }
       
   222 
       
   223 
       
   224 EXPORT_C CAiwGenericParamList& CAiwServiceHandler::InParamListL()
       
   225     {
       
   226     return iImpl->InParamListL();
       
   227     }
       
   228 
       
   229 
       
   230 EXPORT_C CAiwGenericParamList& CAiwServiceHandler::OutParamListL()
       
   231     {
       
   232     return iImpl->OutParamListL();
       
   233     }
       
   234 
       
   235 
       
   236 EXPORT_C TBool CAiwServiceHandler::IsAiwMenu(TInt aMenuResourceId)
       
   237     {
       
   238     return iImpl->IsAiwMenu(aMenuResourceId);
       
   239     }
       
   240 
       
   241 
       
   242 EXPORT_C TBool CAiwServiceHandler::HandleSubmenuL(CEikMenuPane& aPane)
       
   243     {
       
   244     return iImpl->HandleSubmenuL(aPane);
       
   245     }
       
   246 
       
   247 
       
   248 EXPORT_C void CAiwServiceHandler::ReportMenuLaunch()
       
   249     {
       
   250     CAiwTlsData* data = CAiwTlsData::Instance();
       
   251     if(data)
       
   252         {
       
   253         data->ReportMenuLaunch();
       
   254         }
       
   255     }
       
   256 
       
   257 // End of file