sysresmonitoring/oommonitor/inc/oomactionref.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:  Classes for executing OOM actions (e.g. closing applications and running plugins).
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef OOMACTIONREF_H_
       
    20 #define OOMACTIONREF_H_
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "oomactionconfig.h"
       
    24 
       
    25 class COomRunPlugin;
       
    26 
       
    27 /**
       
    28  *  Encapsulates a reference to an action. 
       
    29  *  
       
    30  *  Objects of this T-class are instantiated at memory freeing time in preference to the  
       
    31  *  COomAction derived objects, so that we do not instantiate anything on the heap at a time
       
    32  *  when the device is, by-definition, low on memory.
       
    33  *
       
    34  *  @lib oommonitor.lib
       
    35  *  @since S60 v5.0
       
    36  */
       
    37 class TActionRef
       
    38     {
       
    39 public:
       
    40     
       
    41     enum TActionType
       
    42         {
       
    43         EAppPlugin,
       
    44         ESystemPlugin,
       
    45         EAppClose
       
    46         };
       
    47 
       
    48     //constructor for Plugin actions
       
    49     TActionRef(TActionType aType, TInt aPriority, TOomSyncMode aSyncMode, TInt aRamEstimate, COomRunPlugin& aRunPlugin, TUint aWgIndexOfTargetApp);
       
    50 
       
    51     //constructor for AppClose actions
       
    52     TActionRef(TActionType aType, TInt aPriority, TOomSyncMode aSyncMode, TInt aRamEstimate, TInt aWgId, TUint aWgIndex);
       
    53     
       
    54     TActionType Type() const;
       
    55     TUint Priority() const;
       
    56     TOomSyncMode SyncMode() const;
       
    57     TInt RamEstimate() const;
       
    58     TInt WgId() const;
       
    59     TInt WgIndex() const;
       
    60     COomRunPlugin& RunPlugin();
       
    61 
       
    62 private: //data
       
    63     
       
    64     TActionType iType;
       
    65     TUint iPriority;
       
    66     TOomSyncMode iSyncMode; //needed as we don't have reference to the config 
       
    67     TInt iRamEstimate; //needed as we don't have reference to the config 
       
    68     TInt iWgId; //For AppClose
       
    69     TInt iWgIndex;
       
    70     COomRunPlugin* iRunPlugin; //For Plugins. Not owned
       
    71     };
       
    72 
       
    73 #endif /*OOMACTIONREF_H_*/