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: Classes for executing GOOM actions (e.g. closing applications and running plugins).
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef GOOMRUNPLUGIN_H_
|
|
20 |
#define GOOMRUNPLUGIN_H_
|
|
21 |
|
|
22 |
#include "goomaction.h"
|
|
23 |
|
|
24 |
class CGOomRunPlugin;
|
|
25 |
class CGOomRunPluginConfig;
|
|
26 |
class MGOomActionObserver;
|
|
27 |
class CGOomPluginWaiter;
|
|
28 |
class CGOomMonitorPlugin;
|
|
29 |
class CGOomMonitorPluginV2;
|
|
30 |
class CGOomActionConfig;
|
|
31 |
|
|
32 |
/*
|
|
33 |
* The GOOM action of running an GOOM plug-in to free up memory.
|
|
34 |
*
|
|
35 |
* @lib oommonitor.lib
|
|
36 |
* @since S60 v5.0
|
|
37 |
*/
|
|
38 |
NONSHARABLE_CLASS(CGOomRunPlugin) : public CGOomAction
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
static CGOomRunPlugin* NewL(TUint aPluginId, CGOomRunPluginConfig& aConfig, MGOomActionObserver& aStateChangeObserver, CGOomMonitorPlugin& aPlugin);
|
|
42 |
|
|
43 |
~CGOomRunPlugin();
|
|
44 |
|
|
45 |
// Run the GOOM plugin in order to free memory
|
|
46 |
// Call the CGOomAction::MemoryFreed when it is done
|
|
47 |
virtual void FreeMemory(TInt aBytesRequested, TBool aUseSwRendering);
|
|
48 |
|
|
49 |
// Call the memory good function on the plugin but...
|
|
50 |
// only if there is an outstanding FreeMemory request
|
|
51 |
void MemoryGood();
|
|
52 |
|
|
53 |
inline TBool IsRunning();
|
|
54 |
|
|
55 |
// To be called by the CGOomPluginWaiter
|
|
56 |
inline void WaitCompleted();
|
|
57 |
|
|
58 |
TUint Id();
|
|
59 |
|
|
60 |
protected:
|
|
61 |
|
|
62 |
void ConstructL(CGOomRunPluginConfig& aPluginConfig);
|
|
63 |
|
|
64 |
inline CGOomActionConfig& GetConfig();
|
|
65 |
|
|
66 |
private:
|
|
67 |
|
|
68 |
CGOomRunPlugin(TUint aPluginId, CGOomRunPluginConfig& aConfig, MGOomActionObserver& aStateChangeObserver, CGOomMonitorPlugin& aPlugin);
|
|
69 |
|
|
70 |
TUint iPluginId;
|
|
71 |
|
|
72 |
CGOomMonitorPlugin& iPlugin;
|
|
73 |
|
|
74 |
CGOomRunPluginConfig& iConfig;
|
|
75 |
|
|
76 |
CGOomPluginWaiter* iPluginWaiter;
|
|
77 |
|
|
78 |
TBool iFreeMemoryCalled; // True if FreeMemory has been called since the last call to MemoryGood
|
|
79 |
|
|
80 |
TBool iFreeMemoryWithSwRenderingCalled;
|
|
81 |
};
|
|
82 |
|
|
83 |
#include "goomrunplugin.inl"
|
|
84 |
|
|
85 |
#endif /*GOOMRUNPLUGIN_H_*/
|