|
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_valuesview.h" |
|
22 #include "perfmon_valuescontainer.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 // CPerfMonValuesView::ConstructL(const TRect& aRect) |
|
35 // EPOC two-phased constructor |
|
36 // --------------------------------------------------------- |
|
37 // |
|
38 void CPerfMonValuesView::ConstructL() |
|
39 { |
|
40 BaseConstructL( R_PERFMON_VIEW_VALUES ); |
|
41 iModel = static_cast<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model(); |
|
42 } |
|
43 |
|
44 // --------------------------------------------------------- |
|
45 // CPerfMonValuesView::~CPerfMonValuesView() |
|
46 // --------------------------------------------------------- |
|
47 // |
|
48 CPerfMonValuesView::~CPerfMonValuesView() |
|
49 { |
|
50 if (iContainer) |
|
51 { |
|
52 AppUi()->RemoveFromViewStack( *this, iContainer ); |
|
53 delete iContainer; |
|
54 iContainer = NULL; |
|
55 } |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------- |
|
59 // TUid CPerfMonValuesView::Id() |
|
60 // --------------------------------------------------------- |
|
61 // |
|
62 TUid CPerfMonValuesView::Id() const |
|
63 { |
|
64 return KValuesViewUID; |
|
65 } |
|
66 |
|
67 // --------------------------------------------------------- |
|
68 // TUid CPerfMonValuesView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) |
|
69 // --------------------------------------------------------- |
|
70 // |
|
71 void CPerfMonValuesView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) |
|
72 { |
|
73 AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane); |
|
74 } |
|
75 |
|
76 |
|
77 // --------------------------------------------------------- |
|
78 // CPerfMonValuesView::HandleCommandL(TInt aCommand) |
|
79 // --------------------------------------------------------- |
|
80 // |
|
81 void CPerfMonValuesView::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 // CPerfMonValuesView::HandleClientRectChange() |
|
105 // --------------------------------------------------------- |
|
106 // |
|
107 void CPerfMonValuesView::HandleClientRectChange() |
|
108 { |
|
109 if ( iContainer ) |
|
110 { |
|
111 iContainer->SetRect( ClientRect() ); |
|
112 } |
|
113 } |
|
114 |
|
115 // --------------------------------------------------------- |
|
116 // CPerfMonValuesView::DoActivateL(...) |
|
117 // --------------------------------------------------------- |
|
118 // |
|
119 void CPerfMonValuesView::DoActivateL( |
|
120 const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/, |
|
121 const TDesC8& /*aCustomMessage*/) |
|
122 { |
|
123 if (!iContainer) |
|
124 { |
|
125 iContainer = new (ELeave) CPerfMonValuesContainer; |
|
126 iModel->SetValuesContainer(iContainer); |
|
127 iContainer->SetMopParent(this); |
|
128 iContainer->ConstructL( ClientRect() ); |
|
129 AppUi()->AddToStackL( *this, iContainer ); |
|
130 } |
|
131 } |
|
132 |
|
133 // --------------------------------------------------------- |
|
134 // CPerfMonValuesView::DoDeactivate() |
|
135 // --------------------------------------------------------- |
|
136 // |
|
137 void CPerfMonValuesView::DoDeactivate() |
|
138 { |
|
139 if (iContainer) |
|
140 { |
|
141 AppUi()->RemoveFromViewStack( *this, iContainer ); |
|
142 delete iContainer; |
|
143 iContainer = NULL; |
|
144 } |
|
145 } |
|
146 |
|
147 // End of File |