uiacceltk/hitchcock/goommonitor/src/goomappclosetimer.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:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "goomappclosetimer.h"
       
    20 #include "goomcloseapp.h"
       
    21 #include "goomtraces.h"
       
    22 
       
    23 CGOomAppCloseTimer* CGOomAppCloseTimer::NewL(CGOomCloseApp& aMonitor)
       
    24     {
       
    25     FUNC_LOG;
       
    26 
       
    27     CGOomAppCloseTimer* self = new (ELeave) CGOomAppCloseTimer(aMonitor);
       
    28     CleanupStack::PushL(self);
       
    29     self->ConstructL();
       
    30     CleanupStack::Pop(self);
       
    31     return self;
       
    32     }
       
    33 
       
    34 CGOomAppCloseTimer::CGOomAppCloseTimer(CGOomCloseApp& aMonitor)
       
    35 : CTimer(CActive::EPriorityStandard), iMonitor(aMonitor)
       
    36     {
       
    37     FUNC_LOG;
       
    38 
       
    39     CActiveScheduler::Add(this);
       
    40     }
       
    41 
       
    42 void CGOomAppCloseTimer::RunL()
       
    43     {
       
    44     FUNC_LOG;
       
    45     if(iState == EGOomAppClosing)
       
    46         {
       
    47         iMonitor.KillTask();
       
    48         }
       
    49     else
       
    50         {
       
    51         iMonitor.KillTaskWaitDone();
       
    52         }
       
    53     }
       
    54 
       
    55 void CGOomAppCloseTimer::SetState(TGOomAppCloseState aState)
       
    56     {
       
    57     FUNC_LOG;
       
    58     iState=aState;
       
    59     }