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 |
#include "goomactionref.h"
|
|
20 |
#include "goomrunplugin.h"
|
|
21 |
|
|
22 |
TActionRef::TActionRef(TActionType aType, TInt aPriority, TGOomSyncMode aSyncMode, TInt aRamEstimate, CGOomRunPlugin& aRunPlugin, TUint aWgIndexOfTargetApp)
|
|
23 |
: iType(aType), iPriority(aPriority), iSyncMode(aSyncMode), iRamEstimate(aRamEstimate), iWgIndex(aWgIndexOfTargetApp), iRunPlugin(&aRunPlugin), iAppPlugin(0)
|
|
24 |
{
|
|
25 |
}
|
|
26 |
|
|
27 |
TActionRef::TActionRef(TActionType aType, TInt aPriority, TGOomSyncMode aSyncMode, TInt aRamEstimate, TInt aWgId, TUint aWgIndex, TInt aCloseTimeout, TInt aWaitAfterClose)
|
|
28 |
: iType(aType), iPriority(aPriority), iSyncMode(aSyncMode), iRamEstimate(aRamEstimate), iWgId(aWgId), iWgIndex(aWgIndex), iRunPlugin(NULL), iCloseTimeout(aCloseTimeout), iWaitAfterClose(aWaitAfterClose), iAppPlugin(0)
|
|
29 |
{
|
|
30 |
}
|
|
31 |
|
|
32 |
|
|
33 |
TActionRef::TActionType TActionRef::Type() const
|
|
34 |
{
|
|
35 |
return iType;
|
|
36 |
}
|
|
37 |
|
|
38 |
TUint TActionRef::Priority() const
|
|
39 |
{
|
|
40 |
return iPriority;
|
|
41 |
}
|
|
42 |
|
|
43 |
void TActionRef::SetPriority(TUint aPriority)
|
|
44 |
{
|
|
45 |
iPriority = aPriority;
|
|
46 |
}
|
|
47 |
|
|
48 |
TGOomSyncMode TActionRef::SyncMode() const
|
|
49 |
{
|
|
50 |
return iSyncMode;
|
|
51 |
}
|
|
52 |
|
|
53 |
TInt TActionRef::RamEstimate() const
|
|
54 |
{
|
|
55 |
return iRamEstimate;
|
|
56 |
}
|
|
57 |
|
|
58 |
TInt TActionRef::WgId() const
|
|
59 |
{
|
|
60 |
return iWgId;
|
|
61 |
}
|
|
62 |
|
|
63 |
TInt TActionRef::CloseTimeout() const
|
|
64 |
{
|
|
65 |
return iCloseTimeout;
|
|
66 |
}
|
|
67 |
|
|
68 |
TInt TActionRef::WaitAfterClose() const
|
|
69 |
{
|
|
70 |
return iWaitAfterClose;
|
|
71 |
}
|
|
72 |
|
|
73 |
TInt TActionRef::WgIndex() const
|
|
74 |
{
|
|
75 |
return iWgIndex;
|
|
76 |
}
|
|
77 |
|
|
78 |
CGOomRunPlugin& TActionRef::RunPlugin()
|
|
79 |
{
|
|
80 |
return *iRunPlugin;
|
|
81 |
}
|
|
82 |
|
|
83 |
TBool TActionRef::IsRunning()
|
|
84 |
{
|
|
85 |
if (iRunPlugin)
|
|
86 |
{
|
|
87 |
return iRunPlugin->IsRunning();
|
|
88 |
}
|
|
89 |
else if (iAppPlugin)
|
|
90 |
{
|
|
91 |
return iAppPlugin->IsRunning();
|
|
92 |
}
|
|
93 |
return EFalse;
|
|
94 |
}
|