|
1 /* |
|
2 * Copyright (c) 2002 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 the License "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: Container class for Video settings list view.* |
|
15 */ |
|
16 |
|
17 |
|
18 // Version : %version: 8 % |
|
19 |
|
20 |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <aknlists.h> |
|
24 #include <barsread.h> |
|
25 #include <MediaSettings.rsg> |
|
26 #include <csxhelp/iptv.hlp.hrh> |
|
27 |
|
28 #include "MPSettingsApp.h" |
|
29 #include "MPSettingsVideoContainer.h" |
|
30 #include "MPSettingsVideoSettingItemList.h" |
|
31 #include "MPSettingsConstants.h" |
|
32 #include "MPSettingsModelForROP.h" |
|
33 #include "mpxlog.h" |
|
34 |
|
35 // ================= MEMBER FUNCTIONS ======================= |
|
36 |
|
37 // ----------------------------------------------------------------------------- |
|
38 // CMPSettingsVideoContainer::CMPSettingsVideoContainer |
|
39 // C++ default constructor can NOT contain any code, that |
|
40 // might leave. |
|
41 // ----------------------------------------------------------------------------- |
|
42 // |
|
43 CMPSettingsVideoContainer::CMPSettingsVideoContainer(CMPSettingsModelForROP* aModel) |
|
44 : iModel( aModel) |
|
45 { |
|
46 MPX_DEBUG1(_L("#MS# CMPSettingsVideoContainer::CMPSettingsVideoContainer()")); |
|
47 } |
|
48 |
|
49 // --------------------------------------------------------- |
|
50 // CMPSettingsVideoContainer::~CMPSettingsVideoContainer |
|
51 // Destructor |
|
52 // --------------------------------------------------------- |
|
53 // |
|
54 CMPSettingsVideoContainer::~CMPSettingsVideoContainer() |
|
55 { |
|
56 MPX_DEBUG1(_L("#MS# CMPSettingsVideoContainer::~CMPSettingsVideoContainer()")); |
|
57 if (iSettingList) |
|
58 { |
|
59 delete iSettingList; |
|
60 } |
|
61 |
|
62 delete iVideoSettingsEngine; |
|
63 } |
|
64 |
|
65 // --------------------------------------------------------- |
|
66 // CMPSettingsVideoContainer::EditCurrentItemFromMenuL |
|
67 // --------------------------------------------------------- |
|
68 // |
|
69 void CMPSettingsVideoContainer::EditCurrentItemFromMenuL(TBool iMenuOption) |
|
70 { |
|
71 MPX_DEBUG2(_L("#MS# CMPSettingsVideoContainer::EditCurrentItemFromMenuL(%d)"),iMenuOption); |
|
72 static_cast<CMPSettingsVideoSettingItemList*>(iSettingList)->EditCurrentItemL( iMenuOption ); |
|
73 } |
|
74 |
|
75 // --------------------------------------------------------- |
|
76 // CMPSettingsVideoContainer::ConstructComponentControlsL |
|
77 // --------------------------------------------------------- |
|
78 // |
|
79 void CMPSettingsVideoContainer::ConstructComponentControlsL() |
|
80 { |
|
81 MPX_DEBUG1(_L("#MS# CMPSettingsVideoContainer::ConstructComponentControlsL()")); |
|
82 |
|
83 iVideoSettingsEngine = CVcxNsSettingsEngine::NewL( ); |
|
84 |
|
85 iSettingList = new(ELeave) CMPSettingsVideoSettingItemList(iModel, *iVideoSettingsEngine ); |
|
86 |
|
87 iSettingList->SetContainerWindowL(*this); |
|
88 |
|
89 iSettingList->ConstructFromResourceL(R_MPSETT_VIDEO_SETTING_ITEM_LIST); |
|
90 iSettingList->LoadSettingsL(); |
|
91 |
|
92 iComponentControl = iSettingList; |
|
93 iListBox = iSettingList->ListBox(); |
|
94 } |
|
95 |
|
96 // --------------------------------------------------------- |
|
97 // CMPSettingsVideoContainer::TitleResourceId |
|
98 // --------------------------------------------------------- |
|
99 // |
|
100 TInt CMPSettingsVideoContainer::TitleResourceId() |
|
101 { |
|
102 return R_MPSETT_VIDEO_VIEW_TITLE; |
|
103 } |
|
104 |
|
105 // --------------------------------------------------------- |
|
106 // CMPSettingsVideoContainer::GetHelpContext |
|
107 // --------------------------------------------------------- |
|
108 // |
|
109 void CMPSettingsVideoContainer::GetHelpContext(TCoeHelpContext& aContext) const |
|
110 { |
|
111 MPX_DEBUG1(_L("#MS# CMPSettingsVideoContainer::GetHelpContext()")); |
|
112 aContext.iMajor = KIptvHelpContextUid; |
|
113 aContext.iContext = KIPTV_HLP_SETTINGS; |
|
114 } |
|
115 |
|
116 // --------------------------------------------------------- |
|
117 // CMPSettingsVideoContainer::FocusChanged |
|
118 // --------------------------------------------------------- |
|
119 // |
|
120 void CMPSettingsVideoContainer::FocusChanged(TDrawNow /*aDrawNow*/) |
|
121 { |
|
122 if ( iListBox ) |
|
123 { |
|
124 iListBox->SetFocus( IsFocused() ); |
|
125 } |
|
126 |
|
127 if ( iComponentControl ) |
|
128 { |
|
129 iComponentControl->SetFocus( IsFocused() ); |
|
130 } |
|
131 } |
|
132 |
|
133 // --------------------------------------------------------------------------- |
|
134 // CMPSettingsVideoContainer::SizeChanged() |
|
135 // Called by framwork when the view size is changed |
|
136 // --------------------------------------------------------------------------- |
|
137 // |
|
138 void CMPSettingsVideoContainer::SizeChanged() |
|
139 { |
|
140 if ( iListBox ) |
|
141 { |
|
142 iListBox->SetRect(Rect()); |
|
143 } |
|
144 |
|
145 if ( iComponentControl ) |
|
146 { |
|
147 iComponentControl->SetRect(Rect()); |
|
148 } |
|
149 } |
|
150 |
|
151 // --------------------------------------------------------- |
|
152 // CMPSettingsVideoContainer::HandleResourceChange |
|
153 // Handles a resource relative event |
|
154 // --------------------------------------------------------- |
|
155 // |
|
156 void CMPSettingsVideoContainer::HandleResourceChange( TInt aType ) |
|
157 { |
|
158 MPX_DEBUG2(_L("#MS# CMPSettingsVideoContainer::HandleResourceChange(0x%X)"),aType); |
|
159 if ( aType == KEikDynamicLayoutVariantSwitch ) //Handle change in layout orientation |
|
160 { |
|
161 TRect mainPaneRect; |
|
162 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect ); |
|
163 SetRect( mainPaneRect ); |
|
164 DrawNow(); |
|
165 } |
|
166 CCoeControl::HandleResourceChange( aType ); |
|
167 } |
|
168 |
|
169 // --------------------------------------------------------- |
|
170 // CMPSettingsVideoContainer::IsCurrentItem |
|
171 // --------------------------------------------------------- |
|
172 // |
|
173 TBool CMPSettingsVideoContainer::IsCurrentItem( TInt aIndex ) |
|
174 { |
|
175 return static_cast<CMPSettingsVideoSettingItemList*>(iSettingList) |
|
176 ->IsCurrentItem( aIndex ); |
|
177 } |
|
178 |
|
179 |
|
180 // End of File |