meetingrequest/mrpolicy/src/cesmrpolicychecker.cpp
branchRCL_3
changeset 16 4ce476e64c59
parent 13 0396474f30f5
child 17 8592a65ad3fb
equal deleted inserted replaced
13:0396474f30f5 16:4ce476e64c59
     1 /*
       
     2 * Copyright (c) 2007-2009 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:  ESMR service policy checker implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "emailtrace.h"
       
    20 #include "cesmrpolicychecker.h"
       
    21 //<cmail>
       
    22 #include "cesmrpolicy.h"
       
    23 #include "tesmrscenariodata.h"
       
    24 //</cmail>
       
    25 
       
    26 // ======== MEMBER FUNCTIONS ========
       
    27 
       
    28 // ---------------------------------------------------------------------------
       
    29 // CESMRPolicyChecker::CESMRPolicyChecker
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 inline CESMRPolicyChecker::CESMRPolicyChecker()
       
    33     {
       
    34     FUNC_LOG;
       
    35     // Do nothing
       
    36     }
       
    37 
       
    38 // ---------------------------------------------------------------------------
       
    39 // CESMRPolicyChecker::~CESMRPolicyChecker
       
    40 // ---------------------------------------------------------------------------
       
    41 //
       
    42 CESMRPolicyChecker::~CESMRPolicyChecker()
       
    43     {
       
    44     FUNC_LOG;
       
    45     // Do nothing
       
    46     }
       
    47 
       
    48 // ---------------------------------------------------------------------------
       
    49 // CESMRPolicyChecker::NewL
       
    50 // ---------------------------------------------------------------------------
       
    51 //
       
    52 CESMRPolicyChecker* CESMRPolicyChecker::NewL()
       
    53     {
       
    54     FUNC_LOG;
       
    55     CESMRPolicyChecker* self = new (ELeave) CESMRPolicyChecker;
       
    56     CleanupStack::PushL( self );
       
    57     self->ConstructL();
       
    58     CleanupStack::Pop( self );
       
    59     return self;
       
    60     }
       
    61 
       
    62 // ---------------------------------------------------------------------------
       
    63 // CESMRPolicyChecker::MatchesL
       
    64 // ---------------------------------------------------------------------------
       
    65 //
       
    66 TBool CESMRPolicyChecker::MatchesL(
       
    67     const CESMRPolicy& aPolicy,
       
    68     const TESMRScenarioData& aScenData )
       
    69     {
       
    70     FUNC_LOG;
       
    71     TBool matches( ETrue );
       
    72 
       
    73     if (  aPolicy.ViewMode() != aScenData.iViewMode ||
       
    74          !aPolicy.IsRoleIncluded( aScenData.iRole ) ||
       
    75           aPolicy.AllowedApp() != aScenData.iCallingApp )
       
    76         {
       
    77         matches = EFalse;
       
    78         }
       
    79 
       
    80     return matches;
       
    81     }
       
    82 
       
    83 // ---------------------------------------------------------------------------
       
    84 // CESMRPolicyChecker::ConstructL
       
    85 // ---------------------------------------------------------------------------
       
    86 //
       
    87 void CESMRPolicyChecker::ConstructL()
       
    88     {
       
    89     FUNC_LOG;
       
    90     // Do nothing
       
    91     }
       
    92 
       
    93 // EOF
       
    94