|
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); |
|
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 protected: |
|
59 |
|
60 void ConstructL(CGOomRunPluginConfig& aPluginConfig); |
|
61 |
|
62 inline CGOomActionConfig& GetConfig(); |
|
63 |
|
64 private: |
|
65 |
|
66 CGOomRunPlugin(TUint aPluginId, CGOomRunPluginConfig& aConfig, MGOomActionObserver& aStateChangeObserver, CGOomMonitorPlugin& aPlugin); |
|
67 |
|
68 TUint iPluginId; |
|
69 |
|
70 CGOomMonitorPlugin& iPlugin; |
|
71 |
|
72 CGOomRunPluginConfig& iConfig; |
|
73 |
|
74 CGOomPluginWaiter* iPluginWaiter; |
|
75 |
|
76 TBool iFreeMemoryCalled; // True if FreeMemory has been called since the last call to MemoryGood |
|
77 }; |
|
78 |
|
79 #include "goomrunplugin.inl" |
|
80 |
|
81 #endif /*GOOMRUNPLUGIN_H_*/ |