22
|
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 |
|
|
19 |
// INCLUDE FILES
|
|
20 |
#include "perfmon.hrh"
|
|
21 |
#include "perfmon_graphsview.h"
|
|
22 |
#include "perfmon_graphscontainer.h"
|
|
23 |
#include "perfmon_document.h"
|
|
24 |
#include "perfmon_model.h"
|
|
25 |
#include <perfmon.rsg>
|
|
26 |
|
|
27 |
#include <eikenv.h>
|
|
28 |
#include <aknViewAppUi.h>
|
|
29 |
|
|
30 |
|
|
31 |
// ================= MEMBER FUNCTIONS =======================
|
|
32 |
|
|
33 |
// ---------------------------------------------------------
|
|
34 |
// CPerfMonGraphsView::ConstructL(const TRect& aRect)
|
|
35 |
// EPOC two-phased constructor
|
|
36 |
// ---------------------------------------------------------
|
|
37 |
//
|
|
38 |
void CPerfMonGraphsView::ConstructL()
|
|
39 |
{
|
|
40 |
BaseConstructL( R_PERFMON_VIEW_GRAPHS );
|
|
41 |
iModel = static_cast<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
|
|
42 |
}
|
|
43 |
|
|
44 |
// ---------------------------------------------------------
|
|
45 |
// CPerfMonGraphsView::~CPerfMonGraphsView()
|
|
46 |
// ---------------------------------------------------------
|
|
47 |
//
|
|
48 |
CPerfMonGraphsView::~CPerfMonGraphsView()
|
|
49 |
{
|
|
50 |
if (iContainer)
|
|
51 |
{
|
|
52 |
AppUi()->RemoveFromViewStack( *this, iContainer );
|
|
53 |
delete iContainer;
|
|
54 |
iContainer = NULL;
|
|
55 |
}
|
|
56 |
}
|
|
57 |
|
|
58 |
// ---------------------------------------------------------
|
|
59 |
// TUid CPerfMonGraphsView::Id()
|
|
60 |
// ---------------------------------------------------------
|
|
61 |
//
|
|
62 |
TUid CPerfMonGraphsView::Id() const
|
|
63 |
{
|
|
64 |
return KGraphsViewUID;
|
|
65 |
}
|
|
66 |
|
|
67 |
// ---------------------------------------------------------
|
|
68 |
// TUid CPerfMonGraphsView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
|
|
69 |
// ---------------------------------------------------------
|
|
70 |
//
|
|
71 |
void CPerfMonGraphsView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
|
|
72 |
{
|
|
73 |
AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane);
|
|
74 |
}
|
|
75 |
|
|
76 |
|
|
77 |
// ---------------------------------------------------------
|
|
78 |
// CPerfMonGraphsView::HandleCommandL(TInt aCommand)
|
|
79 |
// ---------------------------------------------------------
|
|
80 |
//
|
|
81 |
void CPerfMonGraphsView::HandleCommandL(TInt aCommand)
|
|
82 |
{
|
|
83 |
/*
|
|
84 |
switch ( aCommand )
|
|
85 |
{
|
|
86 |
case EPerfMonCmdFileBack:
|
|
87 |
{
|
|
88 |
iModel->FileUtils()->MoveUpOneLevelL();
|
|
89 |
break;
|
|
90 |
}
|
|
91 |
|
|
92 |
default:
|
|
93 |
{
|
|
94 |
*/
|
|
95 |
AppUi()->HandleCommandL( aCommand );
|
|
96 |
/*
|
|
97 |
break;
|
|
98 |
}
|
|
99 |
}
|
|
100 |
*/
|
|
101 |
}
|
|
102 |
|
|
103 |
// ---------------------------------------------------------
|
|
104 |
// CPerfMonGraphsView::HandleClientRectChange()
|
|
105 |
// ---------------------------------------------------------
|
|
106 |
//
|
|
107 |
void CPerfMonGraphsView::HandleClientRectChange()
|
|
108 |
{
|
|
109 |
if ( iContainer )
|
|
110 |
{
|
|
111 |
iContainer->SetRect( ClientRect() );
|
|
112 |
}
|
|
113 |
}
|
|
114 |
|
|
115 |
// ---------------------------------------------------------
|
|
116 |
// CPerfMonGraphsView::DoActivateL(...)
|
|
117 |
// ---------------------------------------------------------
|
|
118 |
//
|
|
119 |
void CPerfMonGraphsView::DoActivateL(
|
|
120 |
const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
|
|
121 |
const TDesC8& /*aCustomMessage*/)
|
|
122 |
{
|
|
123 |
if (!iContainer)
|
|
124 |
{
|
|
125 |
iContainer = new (ELeave) CPerfMonGraphsContainer;
|
|
126 |
iModel->SetGraphsContainer(iContainer);
|
|
127 |
iContainer->SetMopParent(this);
|
|
128 |
iContainer->ConstructL( ClientRect() );
|
|
129 |
AppUi()->AddToStackL( *this, iContainer );
|
|
130 |
}
|
|
131 |
}
|
|
132 |
|
|
133 |
// ---------------------------------------------------------
|
|
134 |
// CPerfMonGraphsView::DoDeactivate()
|
|
135 |
// ---------------------------------------------------------
|
|
136 |
//
|
|
137 |
void CPerfMonGraphsView::DoDeactivate()
|
|
138 |
{
|
|
139 |
if (iContainer)
|
|
140 |
{
|
|
141 |
AppUi()->RemoveFromViewStack( *this, iContainer );
|
|
142 |
delete iContainer;
|
|
143 |
iContainer = NULL;
|
|
144 |
}
|
|
145 |
}
|
|
146 |
|
|
147 |
// End of File
|