64
|
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: Configuration representation classes for Graphics Out of Memory Monitor
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef GOOMACTIONCONFIG_
|
|
20 |
#define GOOMACTIONCONFIG_
|
|
21 |
|
|
22 |
#include <e32cmn.h>
|
|
23 |
#include <e32std.h>
|
|
24 |
#include <w32std.h>
|
|
25 |
|
|
26 |
class MGOomRuleConfig;
|
|
27 |
class CGOomWindowGroupList;
|
|
28 |
|
|
29 |
enum TGOomSyncMode
|
|
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 |
NONSHARABLE_CLASS(CGOomActionConfig) : public CBase
|
|
38 |
{
|
|
39 |
public:
|
|
40 |
// Add a rule
|
|
41 |
// This class takes ownership of the given rule
|
|
42 |
void AddRuleL(MGOomRuleConfig* aRule); // Add the configuration for a rule (e.g. an idle time rule)
|
|
43 |
|
|
44 |
virtual ~CGOomActionConfig();
|
|
45 |
|
|
46 |
// Set the priority of this action
|
|
47 |
// This priority will be applied if none of the attached rules can be applied
|
|
48 |
inline void SetDefaultPriority(TUint aPriority);
|
|
49 |
|
|
50 |
protected:
|
|
51 |
|
|
52 |
// Return the priority for this action for the idle time of the target app
|
|
53 |
TUint Priority(const CGOomWindowGroupList& aWindowGroupList, TInt aAppIndexInWindowGroup) const;
|
|
54 |
|
|
55 |
void ConstructL();
|
|
56 |
|
|
57 |
CGOomActionConfig(TInt32 aId);
|
|
58 |
|
|
59 |
public:
|
|
60 |
|
|
61 |
TGOomSyncMode iSyncMode;
|
|
62 |
|
|
63 |
TInt iRamEstimate; // The estimated RAM saving after performing this action
|
|
64 |
|
|
65 |
TInt32 iId; // The ID of the affected component (e.g. an application ID for app closure, or a plugin ID for a plugin event)
|
|
66 |
|
|
67 |
TUint iDefaultPriority;
|
|
68 |
|
|
69 |
protected:
|
|
70 |
|
|
71 |
RPointerArray<MGOomRuleConfig> iRules;
|
|
72 |
};
|
|
73 |
|
|
74 |
#include "goomactionconfig.inl"
|
|
75 |
|
|
76 |
#endif /*GOOMACTIONCONFIG_*/
|