sysresmonitoring/oommonitor/inc/oomactionconfig.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:  Configuration representation classes for Out of Memory Monitor.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef OOMACTIONCONFIG_
       
    20 #define OOMACTIONCONFIG_
       
    21 
       
    22 #include <e32cmn.h>
       
    23 #include <e32std.h>
       
    24 #include <w32std.h>
       
    25 
       
    26 class MOomRuleConfig;
       
    27 class COomWindowGroupList;
       
    28 
       
    29 enum TOomSyncMode
       
    30     {
       
    31     EContinue,					// Continue with the next action regardless of anything else (exluding max_batch_size)
       
    32     EEstimate,					// Continue with the next action if we estimate that we need to free more memory
       
    33     ECheckRam,					// Wait for this action to complete, then check the free RAM before continuing
       
    34     EContinueIgnoreMaxBatchSize // Continue with the next action regardless of anything else (including max_batch_size)
       
    35     };
       
    36 
       
    37 /*
       
    38  * The base class for the configuration of all OOM actions
       
    39  * 
       
    40  * @lib oommonitor.lib
       
    41  * @since S60 v5.0
       
    42  */
       
    43 NONSHARABLE_CLASS(COomActionConfig) : public CBase
       
    44     {
       
    45 public:
       
    46     // Add a rule
       
    47     // This class takes ownership of the given rule
       
    48     void AddRuleL(MOomRuleConfig* aRule);    // Add the configuration for a rule (e.g. an idle time rule)
       
    49             
       
    50     virtual ~COomActionConfig();
       
    51     
       
    52     // Set the priority of this action
       
    53     // This priority will be applied if none of the attached rules can be applied
       
    54     inline void SetDefaultPriority(TUint aPriority);
       
    55     
       
    56 protected:
       
    57     
       
    58     // Return the priority for this action for the idle time of the target app
       
    59     TUint Priority(const COomWindowGroupList& aWindowGroupList, TInt aAppIndexInWindowGroup) const;
       
    60     
       
    61     void ConstructL();
       
    62 
       
    63     COomActionConfig(TInt32 aId);
       
    64     
       
    65 public:
       
    66     
       
    67     TOomSyncMode iSyncMode;
       
    68     
       
    69     TInt iRamEstimate;    // The estimated RAM saving after performing this action
       
    70     
       
    71     TInt32 iId;        // The ID of the affected component (e.g. an application ID for app closure, or a plugin ID for a plugin event)
       
    72     
       
    73     TUint iDefaultPriority;
       
    74     
       
    75 protected:    
       
    76     
       
    77     RPointerArray<MOomRuleConfig> iRules;
       
    78     };
       
    79 
       
    80 #include "oomactionconfig.inl"
       
    81 
       
    82 #endif /*OOMACTIONCONFIG_*/