uiacceltk/hitchcock/goommonitor/src/goomforegroundrule.cpp
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Configuration representation classes for Fraphics Out of Memory Monitor
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "goomforegroundrule.h"
       
    21 #include "goomwindowgrouplist.h"
       
    22 #include "goomtraces.h"
       
    23 
       
    24 // If the specified target app is in the foreground then apply the specified priority
       
    25 CGOomForegroundRule::CGOomForegroundRule(TInt aTargetAppId, TInt aPriority) : iTargetAppId(aTargetAppId), iPriority(aPriority)
       
    26     {
       
    27     FUNC_LOG;
       
    28     }
       
    29 
       
    30 TBool CGOomForegroundRule::RuleIsApplicable(const CGOomWindowGroupList& aWindowGroupList, TInt /*aAppIndexInWindowGroup*/) const
       
    31     {
       
    32     FUNC_LOG;
       
    33 
       
    34     TBool ruleIsApplicable = EFalse;
       
    35     if (aWindowGroupList.Count() > 0)
       
    36         {
       
    37         // If the target app is in the foreground then this rule is applicable
       
    38         TUint foregroundAppId = aWindowGroupList.AppId(0, ETrue);
       
    39         if (foregroundAppId == iTargetAppId)
       
    40             ruleIsApplicable = ETrue;
       
    41         }
       
    42     
       
    43     return ruleIsApplicable;
       
    44     }