|
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 Out of Memory Monitor |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef GOOMAPPLICATIONCONFIG_ |
|
20 #define GOOMAPPLICATIONCONFIG_ |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class CGOomCloseAppConfig; |
|
25 class MGOomRuleConfig; |
|
26 |
|
27 /* |
|
28 * A list of action configurations for a particular target application. |
|
29 * |
|
30 * All configured actions in this list must be for the same target application. |
|
31 * Actions may be configured to close the application or to run an OOM plugin. |
|
32 * |
|
33 * @lib oommonitor.lib |
|
34 * @since S60 v5.0 |
|
35 */ |
|
36 NONSHARABLE_CLASS(CGOomApplicationConfig) : public CBase |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Two-phased constructor |
|
42 * @param aApplicationId the UID of the application |
|
43 */ |
|
44 static CGOomApplicationConfig* NewL(TUint aApplicationId); |
|
45 |
|
46 // Functions for getting configuration |
|
47 |
|
48 /** |
|
49 * Return a pointer to the close app config, this may be NULL if no app close config has been configured |
|
50 * Ownership is NOT passed to the caller |
|
51 */ |
|
52 inline CGOomCloseAppConfig* GetAppCloseConfig(); |
|
53 |
|
54 inline TUint Id(); |
|
55 |
|
56 // Functions for setting configuration |
|
57 |
|
58 inline void SetAppCloseConfig(CGOomCloseAppConfig* aActionConfig); |
|
59 |
|
60 /** |
|
61 * Add a rule |
|
62 * |
|
63 * This class takes ownership of the given rule |
|
64 * The rule would will apply to the "application close" event |
|
65 */ |
|
66 void AddRuleL(MGOomRuleConfig* aRule); |
|
67 |
|
68 ~CGOomApplicationConfig(); |
|
69 |
|
70 public: |
|
71 |
|
72 TUint iGoodRamThreshold; |
|
73 TUint iLowRamThreshold; |
|
74 TUint iTargetFree; |
|
75 |
|
76 private: |
|
77 |
|
78 void ConstructL(); |
|
79 |
|
80 CGOomApplicationConfig(TUint aApplicationId); |
|
81 |
|
82 CGOomCloseAppConfig* iCloseAppConfig; |
|
83 |
|
84 TInt iIndex; |
|
85 |
|
86 TUint iApplicationId; |
|
87 }; |
|
88 |
|
89 #include "goomapplicationconfig.inl" |
|
90 |
|
91 #endif /*GOOMAPPLICATIONCONFIG_*/ |