125
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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 :
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <apgwgnam.h>
|
127
|
19 |
#include "tsentrykey.h"
|
125
|
20 |
#include "tsrunningappimp.h"
|
|
21 |
#include "tsresourcemanager.h"
|
|
22 |
|
|
23 |
//------------------------------------------------------------------------------
|
|
24 |
CTsRunningApp* CTsRunningApp::NewLC(
|
|
25 |
MTsResourceManager& aResources,
|
|
26 |
const RWsSession::TWindowGroupChainInfo& aInfo )
|
|
27 |
{
|
|
28 |
CTsRunningApp* self = new(ELeave) CTsRunningApp(aResources, aInfo);
|
|
29 |
CleanupStack::PushL( self );
|
127
|
30 |
self->ConstructL();
|
125
|
31 |
return self;
|
|
32 |
}
|
|
33 |
|
|
34 |
//------------------------------------------------------------------------------
|
|
35 |
CTsRunningApp::~CTsRunningApp()
|
|
36 |
{
|
|
37 |
delete iWindowGroupName;
|
|
38 |
}
|
|
39 |
|
|
40 |
//------------------------------------------------------------------------------
|
|
41 |
CTsRunningApp::CTsRunningApp( MTsResourceManager& aResources,
|
|
42 |
const RWsSession::TWindowGroupChainInfo& aInfo )
|
|
43 |
:
|
|
44 |
iResources(aResources),
|
|
45 |
iWindowGroupInfo(aInfo)
|
|
46 |
{
|
|
47 |
//No implementation required
|
|
48 |
}
|
|
49 |
|
127
|
50 |
void CTsRunningApp::ConstructL()
|
125
|
51 |
{
|
127
|
52 |
iWindowGroupName = CApaWindowGroupName::NewL( iResources.WsSession(),
|
|
53 |
WindowGroupId() );
|
|
54 |
iCaption.Set(iWindowGroupName->Caption());
|
|
55 |
|
125
|
56 |
}
|
|
57 |
|
|
58 |
//------------------------------------------------------------------------------
|
127
|
59 |
void CTsRunningApp::RefreshDataL()
|
125
|
60 |
{
|
127
|
61 |
delete iWindowGroupName;
|
|
62 |
iWindowGroupName =0;
|
|
63 |
ConstructL();
|
125
|
64 |
}
|
|
65 |
|
|
66 |
//------------------------------------------------------------------------------
|
127
|
67 |
TUid CTsRunningApp::Uid()const
|
125
|
68 |
{
|
127
|
69 |
return iWindowGroupName->AppUid();
|
|
70 |
}
|
|
71 |
|
|
72 |
//------------------------------------------------------------------------------
|
|
73 |
const TDesC& CTsRunningApp::DisplayName() const
|
|
74 |
{
|
125
|
75 |
return iCaption;
|
|
76 |
|
|
77 |
}
|
|
78 |
|
|
79 |
//------------------------------------------------------------------------------
|
|
80 |
TInt CTsRunningApp::WindowGroupId() const
|
|
81 |
{
|
|
82 |
return iWindowGroupInfo.iId;
|
|
83 |
}
|
|
84 |
|
|
85 |
//------------------------------------------------------------------------------
|
|
86 |
TInt CTsRunningApp::ParentWindowGroupId() const
|
|
87 |
{
|
|
88 |
return iWindowGroupInfo.iParentId;
|
|
89 |
}
|
|
90 |
|
|
91 |
//------------------------------------------------------------------------------
|
|
92 |
TBool CTsRunningApp::IsEmbeded() const
|
|
93 |
{
|
|
94 |
return 0 < iWindowGroupInfo.iParentId;
|
|
95 |
}
|
|
96 |
|
|
97 |
//------------------------------------------------------------------------------
|
127
|
98 |
MTsRunningApplication::ApplicationHideMode CTsRunningApp::HideMode() const
|
|
99 |
{
|
|
100 |
return iWindowGroupName->Hidden() ?
|
|
101 |
MTsRunningApplication::System :
|
|
102 |
iHideMode;
|
|
103 |
}
|
|
104 |
|
|
105 |
//------------------------------------------------------------------------------
|
|
106 |
TBool CTsRunningApp::IsSystem() const
|
125
|
107 |
{
|
127
|
108 |
return iWindowGroupName->IsSystem();
|
|
109 |
}
|
|
110 |
|
|
111 |
//------------------------------------------------------------------------------
|
|
112 |
void CTsRunningApp::SetHidden( TBool aHidden )
|
|
113 |
{
|
|
114 |
iHideMode = aHidden ? MTsRunningApplication::Software :
|
|
115 |
MTsRunningApplication::None;
|
|
116 |
}
|
|
117 |
|
|
118 |
//------------------------------------------------------------------------------
|
|
119 |
TInt CTsRunningApp::IconHandle() const
|
|
120 |
{
|
|
121 |
return KErrNotFound;
|
|
122 |
}
|
|
123 |
|
|
124 |
//------------------------------------------------------------------------------
|
|
125 |
TTime CTsRunningApp::Timestamp() const
|
|
126 |
{
|
|
127 |
return iTimestap;
|
125
|
128 |
}
|
|
129 |
|
|
130 |
//------------------------------------------------------------------------------
|
127
|
131 |
TTime CTsRunningApp::TimestampUpdate() const
|
|
132 |
{
|
|
133 |
return iUpdateTimestap;
|
|
134 |
}
|
|
135 |
|
|
136 |
//------------------------------------------------------------------------------
|
|
137 |
TTsEntryKey CTsRunningApp::Key() const
|
|
138 |
{
|
|
139 |
return TTsEntryKey(WindowGroupId(), ParentWindowGroupId());
|
|
140 |
}
|
|
141 |
|
|
142 |
//------------------------------------------------------------------------------
|
|
143 |
TBool CTsRunningApp::IsActive() const
|
|
144 |
{
|
|
145 |
return ETrue;
|
|
146 |
}
|
|
147 |
|
|
148 |
//------------------------------------------------------------------------------
|
|
149 |
TBool CTsRunningApp::IsClosable() const
|
125
|
150 |
{
|
127
|
151 |
return !iWindowGroupName->IsSystem();
|
|
152 |
}
|
|
153 |
|
|
154 |
//------------------------------------------------------------------------------
|
|
155 |
TBool CTsRunningApp::Close() const
|
|
156 |
{
|
|
157 |
return EFalse;
|
125
|
158 |
}
|
127
|
159 |
|
|
160 |
//------------------------------------------------------------------------------
|
|
161 |
TBool CTsRunningApp::Launch() const
|
|
162 |
{
|
|
163 |
return EFalse;
|
|
164 |
}
|
|
165 |
|
|
166 |
//------------------------------------------------------------------------------
|
|
167 |
TBool CTsRunningApp::IsMandatory() const
|
|
168 |
{
|
|
169 |
return ETrue;
|
|
170 |
}
|