author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 20:46:07 +0300 | |
branch | RCL_3 |
changeset 57 | 2c87b2808fd7 |
parent 54 | bac7acad7cb3 |
child 67 | 756ad29ed18e |
permissions | -rw-r--r-- |
54 | 1 |
/* |
57
2c87b2808fd7
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
54
diff
changeset
|
2 |
* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
54 | 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: Image settings container |
|
15 |
*/ |
|
16 |
||
17 |
||
18 |
// INCLUDE FILES |
|
19 |
#include <eiktxlbx.h> |
|
20 |
#include <aknlists.h> // CAknSingleGraphicStyleListBox |
|
21 |
#include <barsread.h> // TResourceReader |
|
22 |
#include <eikclbd.h> // CColumnListBoxData |
|
23 |
||
24 |
#include <aknsettingitemlist.h> // CAknSettingItemList |
|
25 |
||
26 |
#include "CamAppUid.h" |
|
27 |
||
28 |
#include <csxhelp/lcam.hlp.hrh> |
|
29 |
#include "GSCamcorderSettingsContainer.h" |
|
30 |
#include "GSCamPhotoSettingsList.h" |
|
31 |
#include "GSCamVideoSettingsList.h" |
|
32 |
#include "CamAppUiBase.h" |
|
33 |
#include "MCamAppController.h" |
|
34 |
#include "CameraUiConfigManager.h" |
|
35 |
||
36 |
// ========================= MEMBER FUNCTIONS ================================ |
|
37 |
||
38 |
// --------------------------------------------------------------------------- |
|
39 |
// CGSCamcorderSettingsContainer::ConstructL |
|
40 |
// Symbian OS 2nd phase constructor |
|
41 |
// --------------------------------------------------------------------------- |
|
42 |
// |
|
43 |
void CGSCamcorderSettingsContainer::ConstructL( CCamStaticSettingsModel& aModel, |
|
44 |
TBool aLauchedFromGS, |
|
45 |
TBool aSecondaryCameraSettings, |
|
46 |
TBool aImageSettings ) |
|
47 |
{ |
|
48 |
iLauchedFromGS = aLauchedFromGS; |
|
49 |
iImageSettings = aImageSettings; |
|
50 |
if ( iImageSettings ) |
|
51 |
{ |
|
52 |
iSettingsList = new ( ELeave ) CGSCamPhotoSettingsList( aModel ); |
|
53 |
} |
|
54 |
else |
|
55 |
{ |
|
56 |
iSettingsList = new ( ELeave ) CGSCamVideoSettingsList( aModel ); |
|
57 |
} |
|
58 |
CreateWindowL(); |
|
59 |
||
60 |
iSettingsList->SetContainerWindowL( *this ); |
|
61 |
if ( iImageSettings ) |
|
62 |
{ |
|
63 |
static_cast<CGSCamPhotoSettingsList*>( iSettingsList )->ConstructL( |
|
64 |
aLauchedFromGS, aSecondaryCameraSettings ); |
|
65 |
} |
|
66 |
else |
|
67 |
{ |
|
68 |
static_cast<CGSCamVideoSettingsList*>( iSettingsList )->ConstructL( |
|
69 |
aLauchedFromGS, aSecondaryCameraSettings ); |
|
70 |
} |
|
71 |
||
72 |
if ( !iLauchedFromGS ) |
|
73 |
{ |
|
74 |
// read the product specific capture key from ui config manager |
|
75 |
RArray<TInt> primaryCaptureKeys; |
|
76 |
CleanupClosePushL( primaryCaptureKeys ); |
|
77 |
if ( aModel.UiConfigManagerPtr() ) |
|
78 |
{ |
|
79 |
aModel.UiConfigManagerPtr()->SupportedPrimaryCameraCaptureKeyL( primaryCaptureKeys ); |
|
80 |
} |
|
81 |
iProductCaptureKey = primaryCaptureKeys[0]; |
|
82 |
CleanupStack::PopAndDestroy( &primaryCaptureKeys ); |
|
83 |
} |
|
84 |
||
85 |
/* |
|
86 |
if ( !aLauchedFromGS ) |
|
87 |
{ |
|
88 |
// create navi pane bitmaps and add to navipane |
|
89 |
// only if launched from camera application. |
|
90 |
CreateNaviBitmapsL(); |
|
91 |
} |
|
92 |
*/ |
|
93 |
} |
|
94 |
||
95 |
||
96 |
// Destructor |
|
97 |
CGSCamcorderSettingsContainer::~CGSCamcorderSettingsContainer() |
|
98 |
{ |
|
99 |
if ( iSettingsList ) |
|
100 |
{ |
|
101 |
delete iSettingsList; |
|
102 |
iSettingsList = NULL; |
|
103 |
} |
|
104 |
} |
|
105 |
||
106 |
||
107 |
// --------------------------------------------------------------------------- |
|
108 |
// CGSCamcorderSettingsContainer::EditCurrentL |
|
109 |
// Open setting page for currently selected setting item. |
|
110 |
// --------------------------------------------------------------------------- |
|
111 |
// |
|
112 |
void CGSCamcorderSettingsContainer::EditCurrentL( TBool aCalledFromMenu /*=ETrue*/ ) |
|
113 |
{ |
|
114 |
TInt index = iSettingsList->SettingItemArray()->ItemIndexFromVisibleIndex( |
|
115 |
iSettingsList->ListBox()->CurrentItemIndex() ); |
|
116 |
iSettingsList->EditItemL( index, aCalledFromMenu ); |
|
117 |
} |
|
118 |
||
119 |
||
120 |
// --------------------------------------------------------- |
|
121 |
// CGSCamcorderSettingsContainer::GetHelpContext |
|
122 |
// Gives the help context to be displayed |
|
123 |
// --------------------------------------------------------- |
|
124 |
// |
|
125 |
void CGSCamcorderSettingsContainer::GetHelpContext( |
|
126 |
TCoeHelpContext& aContext ) const |
|
127 |
{ |
|
128 |
#ifdef __SERIES60_HELP |
|
129 |
aContext.iMajor = TUid::Uid( KCameraappUID ); |
|
130 |
if ( iImageSettings ) |
|
131 |
{ |
|
132 |
aContext.iContext = KLCAM_HLP_SETTINGS_PHOTO; |
|
133 |
} |
|
134 |
else |
|
135 |
{ |
|
136 |
aContext.iContext = KLCAM_HLP_SETTINGS_VIDEO; |
|
137 |
} |
|
138 |
#endif |
|
139 |
} |
|
140 |
||
141 |
||
142 |
// --------------------------------------------------------------------------- |
|
143 |
// CGSCamcorderSettingsContainer::CountComponentControls |
|
144 |
// From CCoeControl return the number of controls owned |
|
145 |
// --------------------------------------------------------------------------- |
|
146 |
// |
|
147 |
TInt CGSCamcorderSettingsContainer::CountComponentControls() const |
|
148 |
{ |
|
149 |
return 1; |
|
150 |
} |
|
151 |
||
152 |
||
153 |
// --------------------------------------------------------------------------- |
|
154 |
// CGSCamcorderSettingsContainer::ComponentControl |
|
155 |
// From CCoeControl returns a control |
|
156 |
// --------------------------------------------------------------------------- |
|
157 |
// |
|
158 |
CCoeControl* CGSCamcorderSettingsContainer::ComponentControl( |
|
159 |
TInt /* aIndex */ ) const |
|
160 |
{ |
|
161 |
return iSettingsList; |
|
162 |
} |
|
163 |
||
164 |
// --------------------------------------------------------------------------- |
|
165 |
// CGSCamcorderSettingsContainer::SettingsList |
|
166 |
// Returns a pointer to settingslist |
|
167 |
// --------------------------------------------------------------------------- |
|
168 |
// |
|
169 |
CAknSettingItemList* CGSCamcorderSettingsContainer::SettingsList() const |
|
170 |
{ |
|
171 |
return iSettingsList; |
|
172 |
} |
|
173 |
||
174 |
||
175 |
// --------------------------------------------------------------------------- |
|
176 |
// CGSCamcorderSettingsContainer::OfferKeyEventL |
|
177 |
// Key event handling |
|
178 |
// --------------------------------------------------------------------------- |
|
179 |
// |
|
180 |
TKeyResponse CGSCamcorderSettingsContainer::OfferKeyEventL( |
|
181 |
const TKeyEvent& aKeyEvent, |
|
182 |
TEventCode aType ) |
|
183 |
{ |
|
184 |
if ( aKeyEvent.iScanCode == iProductCaptureKey && !iLauchedFromGS ) |
|
185 |
{ |
|
186 |
CCamAppUiBase* camAppUi = (CCamAppUiBase*)iAvkonAppUiBase; |
|
187 |
||
188 |
TBool background = camAppUi->AppInBackground( EFalse ); |
|
189 |
||
190 |
if ( background ) |
|
191 |
{ |
|
192 |
// Capture key pressed and camera in background. |
|
193 |
// Jump to foreground. |
|
194 |
CEikonEnv::Static()->RootWin().SetOrdinalPosition( 0, 0 ); |
|
195 |
return EKeyWasConsumed; |
|
196 |
} |
|
197 |
return EKeyWasNotConsumed; |
|
198 |
} |
|
199 |
if ( aKeyEvent.iCode == EKeyLeftArrow || |
|
200 |
aKeyEvent.iCode == EKeyRightArrow ) |
|
201 |
{ |
|
202 |
// Listbox takes all events even if it doesn't use them |
|
203 |
return EKeyWasNotConsumed; |
|
204 |
} |
|
205 |
return iSettingsList->OfferKeyEventL( aKeyEvent, aType ); |
|
206 |
} |
|
207 |
||
208 |
||
209 |
||
210 |
// --------------------------------------------------------------------------- |
|
211 |
// CGSCamcorderSettingsContainer::SizeChanged |
|
212 |
// Set the size and position of component controls. |
|
213 |
// --------------------------------------------------------------------------- |
|
214 |
// |
|
215 |
void CGSCamcorderSettingsContainer::SizeChanged() |
|
216 |
{ |
|
217 |
if ( iSettingsList ) |
|
218 |
{ |
|
219 |
iSettingsList->SetRect( Rect() ); |
|
220 |
} |
|
221 |
} |
|
222 |
||
223 |
// --------------------------------------------------------------------------- |
|
224 |
// CGSCamcorderSettingsContainer::HandleResourceChange |
|
225 |
// Handles resource changes, e.g. layout changes of screen. |
|
226 |
// --------------------------------------------------------------------------- |
|
227 |
void CGSCamcorderSettingsContainer::HandleResourceChange( TInt aType ) |
|
228 |
{ |
|
229 |
if ( aType == KEikDynamicLayoutVariantSwitch ) |
|
230 |
{ |
|
231 |
TRect mainPaneRect; |
|
232 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, |
|
233 |
mainPaneRect); |
|
234 |
SetRect( mainPaneRect ); |
|
235 |
} |
|
236 |
CCoeControl::HandleResourceChange( aType ); |
|
237 |
} |
|
238 |
||
239 |
||
240 |
// --------------------------------------------------------- |
|
241 |
// CGSCamcorderSettingsContainer::FocusChanged |
|
242 |
// Focus changed for listbox item. |
|
243 |
// --------------------------------------------------------- |
|
244 |
// |
|
245 |
void CGSCamcorderSettingsContainer::FocusChanged( TDrawNow aDrawNow ) |
|
246 |
{ |
|
247 |
CCoeControl::FocusChanged( aDrawNow ); |
|
248 |
if ( iSettingsList ) |
|
249 |
{ |
|
250 |
iSettingsList->SetFocus( IsFocused(), aDrawNow ); |
|
251 |
} |
|
252 |
//CreateNaviBitmapsL(); |
|
253 |
} |
|
254 |
||
255 |
// --------------------------------------------------------------------------- |
|
256 |
// CGSCamcorderSettingsContainer::CreateNaviBitmapsL() |
|
257 |
// We ask navi counter model to draw the counter and storage icon for us |
|
258 |
// when we are in image settings. |
|
259 |
// --------------------------------------------------------------------------- |
|
260 |
// |
|
261 |
void CGSCamcorderSettingsContainer::CreateNaviBitmapsL() |
|
262 |
{ |
|
263 |
if ( !iLauchedFromGS ) |
|
264 |
{ |
|
265 |
CCamAppUiBase* camAppUi = (CCamAppUiBase*)iAvkonAppUiBase; |
|
266 |
if ( camAppUi ) |
|
267 |
{ |
|
268 |
camAppUi->CreateNaviBitmapsL( ETrue ); |
|
269 |
} |
|
270 |
} |
|
271 |
} |
|
272 |
||
273 |
// End of File |