applicationinterworkingfw/ServiceHandler/src/AiwServiceIfBase.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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #include <ecom/ecom.h>
       
    22 #include "AiwServiceIfBase.h"
       
    23 #include "AiwCommon.h"
       
    24 
       
    25 
       
    26 EXPORT_C CAiwServiceIfBase::~CAiwServiceIfBase()
       
    27     {
       
    28     if (iDtorKeyId.iUid)
       
    29         {
       
    30         REComSession::DestroyedImplementation(iDtorKeyId);
       
    31         }
       
    32     iCriterias.Close();
       
    33     }
       
    34 
       
    35 
       
    36 void CAiwServiceIfBase::SetDtorKeyId(TUid aDtorKeyId)
       
    37     {
       
    38     iDtorKeyId = aDtorKeyId;
       
    39     }
       
    40 
       
    41 
       
    42 TBool CAiwServiceIfBase::Match(CAiwCriteriaItem* aItem)
       
    43     {
       
    44     for (TInt i = 0; i < iCriterias.Count(); i++)
       
    45         {   
       
    46         if ((iCriterias[i]->ServiceClass() == aItem->ServiceClass()) &&
       
    47             (iCriterias[i]->ServiceCmd() == aItem->ServiceCmd()) &&
       
    48             (iCriterias[i]->ContentType() == aItem->ContentType()) &&
       
    49             (iCriterias[i]->Options() == aItem->Options()) &&
       
    50             (iCriterias[i]->DefaultProvider() == aItem->DefaultProvider()))
       
    51             {
       
    52             return ETrue;
       
    53             }
       
    54         }
       
    55 
       
    56     return EFalse;
       
    57     }
       
    58 
       
    59 
       
    60 void CAiwServiceIfBase::AddCriteria(CAiwCriteriaItem* aItem)
       
    61     {
       
    62     iCriterias.Append(aItem);
       
    63     }
       
    64 
       
    65 
       
    66 
       
    67 TUid CAiwServiceIfBase::ImplementationUid() const
       
    68     {
       
    69     return iImplUid;
       
    70     }
       
    71 
       
    72 
       
    73 
       
    74 void CAiwServiceIfBase::SetImplementationUid(TUid aUid)
       
    75     {
       
    76     iImplUid = aUid;
       
    77     }
       
    78 
       
    79 
       
    80 
       
    81 TBool CAiwServiceIfBase::HasCriteria(CAiwCriteriaItem& aItem) const
       
    82     {
       
    83     TInt i;
       
    84 
       
    85     for (i = 0; i < iCriterias.Count(); i++)
       
    86         {
       
    87         if (aItem == *(iCriterias[i]))
       
    88             {
       
    89             return ETrue;
       
    90             }
       
    91         }
       
    92 
       
    93     return EFalse;
       
    94     }
       
    95 
       
    96 
       
    97 EXPORT_C void* CAiwServiceIfBase::ExtensionInterface(TUid /*aInterface*/)
       
    98     {
       
    99     return NULL;
       
   100     }
       
   101 
       
   102 // Enf of file