sysresmonitoring/oommonitor/inc/oomappclosewatcher.h
branchRCL_3
changeset 1 0fdb7f6b0309
child 19 924385140d98
equal deleted inserted replaced
0:2e3d3ce01487 1:0fdb7f6b0309
       
     1 /*
       
     2 * Copyright (c) 2006 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:  An active object which watches for app close actions successfully completing.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef OOMAPPCLOSEWATCHER_H_
       
    20 #define OOMAPPCLOSEWATCHER_H_
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 class COomCloseApp;
       
    25 class TApaTask;
       
    26 
       
    27 /**
       
    28  *  This class implements an active object which watches for app close actions successfully completing.
       
    29  *  
       
    30  *  This watcher object logs-on to the thread of the application being closed and completes 
       
    31  *  the app close action when the thread dies.  
       
    32  *
       
    33  *  @lib oommonitor.lib
       
    34  *  @since S60 v5.0
       
    35  */
       
    36 NONSHARABLE_CLASS(COomAppCloseWatcher) : public CActive
       
    37     {
       
    38 public:
       
    39     COomAppCloseWatcher(COomCloseApp& aMonitor);
       
    40     ~COomAppCloseWatcher();
       
    41     void Start(const TApaTask& aTask);
       
    42 private:
       
    43     void DoCancel();
       
    44     void RunL();
       
    45     
       
    46 private: //data
       
    47 
       
    48     /**
       
    49      * A reference to the owning close app action
       
    50      */
       
    51 	COomCloseApp& iMonitor;
       
    52 
       
    53     /**
       
    54      * A handle to the main thread of the application to be closed.
       
    55      */
       
    56     RThread iThread;
       
    57     
       
    58     /**
       
    59      * A backup of the orginal priority of the application's process
       
    60      */
       
    61     TProcessPriority iOriginalProcessPriority;
       
    62     };
       
    63 
       
    64 #endif /*OOMAPPCLOSEWATCHER_H_*/