uiacceltk/hitchcock/goommonitor/inc/goomactionref.h
changeset 0 15bf7259bb7c
child 3 d8a3531bc6b8
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 Graphics OOM actions (e.g. closing applications and running plugins).
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef GOOMACTIONREF_H_
       
    20 #define GOOMACTIONREF_H_
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "goomactionconfig.h"
       
    24 
       
    25 class CGOomRunPlugin;
       
    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  *  CGOomAction 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, TGOomSyncMode aSyncMode, TInt aRamEstimate, CGOomRunPlugin& aRunPlugin, TUint aWgIndexOfTargetApp);
       
    50 
       
    51     //constructor for AppClose actions
       
    52     TActionRef(TActionType aType, TInt aPriority, TGOomSyncMode aSyncMode, TInt aRamEstimate, TInt aWgId, TUint aWgIndex);
       
    53     
       
    54     TActionType Type() const;
       
    55     TUint Priority() const;
       
    56     void SetPriority(TUint);
       
    57     TGOomSyncMode SyncMode() const;
       
    58     TInt RamEstimate() const;
       
    59     TInt WgId() const;
       
    60     TInt WgIndex() const;
       
    61     CGOomRunPlugin& RunPlugin();
       
    62 
       
    63 private: //data
       
    64     
       
    65     TActionType iType;
       
    66     TUint iPriority;
       
    67     TGOomSyncMode iSyncMode; //needed as we don't have reference to the config 
       
    68     TInt iRamEstimate; //needed as we don't have reference to the config 
       
    69     TInt iWgId; //For AppClose
       
    70     TInt iWgIndex;
       
    71     CGOomRunPlugin* iRunPlugin; //For Plugins. Not owned
       
    72     };
       
    73 
       
    74 #endif /*GOOMACTIONREF_H_*/