24
|
1 |
/*
|
|
2 |
* Copyright (c) 2007 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: Main settings view class
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDE FILES
|
|
20 |
|
|
21 |
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
|
|
22 |
#include <vwsdefpartner.h>
|
|
23 |
#endif
|
|
24 |
#include <avkon.hrh>
|
|
25 |
#include <aknViewAppUi.h>
|
|
26 |
#include <eikapp.h>
|
|
27 |
#include <akntitle.h> // cakntitlepane
|
|
28 |
#include <featmgr.h>
|
|
29 |
#include <barsread.h>
|
|
30 |
#include <aknnavide.h>
|
|
31 |
#include <bldvariant.hrh>
|
|
32 |
#include <gscamerapluginrsc.rsg>
|
|
33 |
#include <StringLoader.h> //for stringloader
|
|
34 |
#include <gsprivatepluginproviderids.h>
|
|
35 |
#include <bautils.h>
|
|
36 |
#include <gsfwviewuids.h> //for kgsmainviewuid
|
|
37 |
#include <aknnotewrappers.h>
|
|
38 |
#include <hlplch.h> // for hlplauncher
|
|
39 |
|
|
40 |
#include <camerasettingsplugin.mbg>
|
|
41 |
#include "GSCamcorderPlugin.h"
|
|
42 |
#include "GSCamcorderPluginContainer.h"
|
|
43 |
#include "GSCamcorderPlugin.hrh"
|
|
44 |
#include "Cam.hrh"
|
|
45 |
#include "GSCamPhotoSettingsView.h"
|
|
46 |
#include "GSCamVideoSettingsView.h"
|
|
47 |
#include "CamLocalViewIds.h"
|
|
48 |
#include "MCamAppController.h"
|
|
49 |
#include "CamUtility.h"
|
|
50 |
#include "CamAppUid.h"
|
|
51 |
|
|
52 |
#include "camconfiguration.h"
|
|
53 |
|
|
54 |
|
|
55 |
// ========================= MEMBER FUNCTIONS ================================
|
|
56 |
|
|
57 |
// ---------------------------------------------------------------------------
|
|
58 |
// CGSCamcorderPlugin::CGSCamcorderPlugin
|
|
59 |
// C++ constructor
|
|
60 |
// ---------------------------------------------------------------------------
|
|
61 |
//
|
|
62 |
CGSCamcorderPlugin::CGSCamcorderPlugin()
|
|
63 |
: iResources( *iCoeEnv ),
|
|
64 |
iSecondaryCameraSettings( EFalse ), iReloadSettings( EFalse )
|
|
65 |
{
|
|
66 |
|
|
67 |
}
|
|
68 |
|
|
69 |
|
|
70 |
// ---------------------------------------------------------------------------
|
|
71 |
// CGSCamcorderPlugin::NewLC
|
|
72 |
// Symbian OS two-phased constructor
|
|
73 |
// ---------------------------------------------------------------------------
|
|
74 |
//
|
|
75 |
CGSCamcorderPlugin* CGSCamcorderPlugin::NewL( TAny* /*aInitParams*/ )
|
|
76 |
{
|
|
77 |
CGSCamcorderPlugin* self = new(ELeave) CGSCamcorderPlugin();
|
|
78 |
CleanupStack::PushL(self);
|
|
79 |
self->ConstructL();
|
|
80 |
CleanupStack::Pop(self);
|
|
81 |
return self;
|
|
82 |
}
|
|
83 |
|
|
84 |
|
|
85 |
// ---------------------------------------------------------------------------
|
|
86 |
// CGSCamcorderPlugin::ConstructL
|
|
87 |
// Symbian OS 2nd phase constructor
|
|
88 |
// ---------------------------------------------------------------------------
|
|
89 |
//
|
|
90 |
void CGSCamcorderPlugin::ConstructL()
|
|
91 |
{
|
|
92 |
RDebug::Print(_L("[CGSCamcorderPlugin] ConstructL()" ));
|
|
93 |
|
|
94 |
iViewArray = new (ELeave) CArrayPtrFlat<MGSTabbedView>( 2 );
|
|
95 |
|
|
96 |
iConfiguration = CCamConfiguration::NewL();
|
|
97 |
iSettingsModel = CCamStaticSettingsModel::NewL( *iConfiguration );
|
|
98 |
|
|
99 |
RDebug::Print( _L( "[CGSCamcorderPlugin] Loading resource from :" ) );
|
|
100 |
if ( CamUtility::IsNhdDevice() )
|
|
101 |
{
|
|
102 |
RDebug::Print( KGSCamcorderPluginResourceFileName );
|
|
103 |
OpenLocalizedResourceFileL( KGSCamcorderPluginResourceFileName,
|
|
104 |
iResources );
|
|
105 |
}
|
|
106 |
else
|
|
107 |
{
|
|
108 |
RDebug::Print( KGSCamcorderPluginResourceFileNamev2 );
|
|
109 |
OpenLocalizedResourceFileL( KGSCamcorderPluginResourceFileNamev2,
|
|
110 |
iResources );
|
|
111 |
}
|
|
112 |
|
|
113 |
FeatureManager::InitializeLibL();
|
|
114 |
// Create needed Local views
|
|
115 |
CreateLocalViewL();
|
|
116 |
BaseConstructL( R_GS_CAM_SETTING_LIST_VIEW );
|
|
117 |
}
|
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
// ---------------------------------------------------------------------------
|
|
122 |
// CGSCamcorderPlugin::~CGSCamcorderPlugin
|
|
123 |
// Destructor
|
|
124 |
// ---------------------------------------------------------------------------
|
|
125 |
//
|
|
126 |
CGSCamcorderPlugin::~CGSCamcorderPlugin()
|
|
127 |
{
|
|
128 |
RDebug::Print( _L( " ==> [CGSCamcorderPlugin] ~CGSCamcorderPlugin()" ) );
|
|
129 |
FeatureManager::UnInitializeLib();
|
|
130 |
|
|
131 |
if ( iViewArray )
|
|
132 |
{
|
|
133 |
iViewArray->Reset();
|
|
134 |
delete iViewArray;
|
|
135 |
}
|
|
136 |
|
|
137 |
if ( iSettingsModel )
|
|
138 |
{
|
|
139 |
delete iSettingsModel;
|
|
140 |
iSettingsModel = NULL;
|
|
141 |
}
|
|
142 |
|
|
143 |
delete iConfiguration;
|
|
144 |
iConfiguration = NULL;
|
|
145 |
|
|
146 |
iResources.Close();
|
|
147 |
|
|
148 |
RDebug::Print( _L( " <==[CGSCamcorderPlugin] ~CGSCamcorderPlugin()" ) );
|
|
149 |
}
|
|
150 |
|
|
151 |
|
|
152 |
// ---------------------------------------------------------------------------
|
|
153 |
// CGSCamcorderPlugin::Id
|
|
154 |
// Return UID of view
|
|
155 |
// ---------------------------------------------------------------------------
|
|
156 |
//
|
|
157 |
TUid CGSCamcorderPlugin::Id() const
|
|
158 |
{
|
|
159 |
return KGSCamcorderGSPluginUid;
|
|
160 |
}
|
|
161 |
|
|
162 |
|
|
163 |
// ---------------------------------------------------------------------------
|
|
164 |
// CGSCamcorderPlugin::HandleCommandL
|
|
165 |
// Handle commands
|
|
166 |
// ---------------------------------------------------------------------------
|
|
167 |
//
|
|
168 |
void CGSCamcorderPlugin::HandleCommandL( TInt aCommand )
|
|
169 |
{
|
|
170 |
|
|
171 |
switch ( aCommand )
|
|
172 |
{
|
|
173 |
case ECamMSKCmdAppChange:
|
|
174 |
case EAknCmdOpen:
|
|
175 |
HandleListBoxSelectionL();
|
|
176 |
break;
|
|
177 |
|
|
178 |
case EAknSoftkeyBack:
|
|
179 |
iAppUi->ActivateLocalViewL( iParentView.iViewUid );
|
|
180 |
iParentView = KNullViewId;
|
|
181 |
break;
|
|
182 |
case EAknCmdHelp:
|
|
183 |
#ifdef __SERIES60_HELP
|
|
184 |
if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
|
|
185 |
{
|
|
186 |
HlpLauncher::LaunchHelpApplicationL(
|
|
187 |
iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
|
|
188 |
}
|
|
189 |
#endif
|
|
190 |
break;
|
|
191 |
case ECamCmdInternalExit:
|
|
192 |
if ( LaunchedFromGS() )
|
|
193 |
{
|
|
194 |
aCommand = EAknCmdExit;
|
|
195 |
}
|
|
196 |
default:
|
|
197 |
iAppUi->HandleCommandL( aCommand );
|
|
198 |
break;
|
|
199 |
}
|
|
200 |
}
|
|
201 |
|
|
202 |
|
|
203 |
// ---------------------------------------------------------------------------
|
|
204 |
// CGSCamcorderPlugin::DoActivate
|
|
205 |
// Activate this view
|
|
206 |
// ---------------------------------------------------------------------------
|
|
207 |
//
|
|
208 |
|
|
209 |
void CGSCamcorderPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
|
|
210 |
TUid aCustomMessageId,
|
|
211 |
const TDesC8& aCustomMessage )
|
|
212 |
{
|
|
213 |
RDebug::Print(_L("[CGSCamcorderPlugin] DoActivateL()" ));
|
|
214 |
|
|
215 |
|
|
216 |
if ( !iReloadSettings )
|
|
217 |
{
|
|
218 |
if ( aCustomMessageId == TUid::Uid( KGSActivatePhotoSettingsView ) ||
|
|
219 |
aCustomMessageId == TUid::Uid( KGSSecondaryCameraPhotoSettingsView ) )
|
|
220 |
{
|
|
221 |
RDebug::Print(_L("[CGSCamcorderPlugin] DoActivateL()1" ));
|
|
222 |
iParentView = aPrevViewId;
|
|
223 |
iAppUi->ActivateLocalViewL( KGSCamImageSettingsViewId );
|
|
224 |
return;
|
|
225 |
}
|
|
226 |
else if ( aCustomMessageId == TUid::Uid( KGSActivateVideoSettingsView ) ||
|
|
227 |
aCustomMessageId == TUid::Uid( KGSSecondaryCameraVideoSettingsView ) )
|
|
228 |
{
|
|
229 |
RDebug::Print(_L("[CGSCamcorderPlugin] DoActivateL()2" ));
|
|
230 |
iParentView = aPrevViewId;
|
|
231 |
iAppUi->ActivateLocalViewL( KGSCamVideoSettingsViewId );
|
|
232 |
return;
|
|
233 |
}
|
|
234 |
}
|
|
235 |
|
|
236 |
// activate baseview only if not transfered straight to localview
|
|
237 |
CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
|
|
238 |
|
|
239 |
TInt highlight = KGSCamSettingsListImageIndex;
|
|
240 |
if ( iPrevViewId.iViewUid == KGSCamVideoSettingsViewId )
|
|
241 |
{
|
|
242 |
highlight = KGSCamSettingsListVideoIndex;
|
|
243 |
}
|
|
244 |
if( iParentView == KNullViewId )
|
|
245 |
{
|
|
246 |
// Parent view could be Camcorder internal view or KGSAppsPluginUid
|
|
247 |
iParentView = aPrevViewId;
|
|
248 |
if ( aCustomMessageId.iUid )
|
|
249 |
{
|
|
250 |
highlight = KGSCamSettingsListVideoIndex;
|
|
251 |
}
|
|
252 |
}
|
|
253 |
|
|
254 |
iContainer->SetSelectedItem( highlight );
|
|
255 |
if ( iReloadSettings )
|
|
256 |
{
|
|
257 |
iReloadSettings = EFalse;
|
|
258 |
HandleListBoxSelectionL();
|
|
259 |
}
|
|
260 |
|
|
261 |
|
|
262 |
|
|
263 |
}
|
|
264 |
|
|
265 |
|
|
266 |
|
|
267 |
// ---------------------------------------------------------------------------
|
|
268 |
// CGSCamcorderPlugin::DoDeactivate
|
|
269 |
// Deactivate this view
|
|
270 |
// ---------------------------------------------------------------------------
|
|
271 |
//
|
|
272 |
void CGSCamcorderPlugin::DoDeactivate()
|
|
273 |
{
|
|
274 |
RDebug::Print(_L("[CGSCamcorderPlugin] DoDeactivate()" ));
|
|
275 |
|
|
276 |
CGSBaseView::DoDeactivate();
|
|
277 |
if( iContainer )
|
|
278 |
{
|
|
279 |
iAppUi->RemoveFromViewStack( *this, iContainer );
|
|
280 |
delete iContainer;
|
|
281 |
iContainer=NULL;
|
|
282 |
}
|
|
283 |
}
|
|
284 |
|
|
285 |
|
|
286 |
// -----------------------------------------------------------------------------
|
|
287 |
// CGSCamcorderPlugin::HandleClientRectChange
|
|
288 |
// Handle screen size change.
|
|
289 |
// -----------------------------------------------------------------------------
|
|
290 |
//
|
|
291 |
void CGSCamcorderPlugin::HandleClientRectChange()
|
|
292 |
{
|
|
293 |
if ( iContainer )
|
|
294 |
{
|
|
295 |
iContainer->SetRect( ClientRect() );
|
|
296 |
}
|
|
297 |
}
|
|
298 |
|
|
299 |
|
|
300 |
// ---------------------------------------------------------------------------
|
|
301 |
// CGSCamcorderPlugin::Container
|
|
302 |
// Return handle to container class.
|
|
303 |
// ---------------------------------------------------------------------------
|
|
304 |
//
|
|
305 |
CGSCamcorderPluginContainer* CGSCamcorderPlugin::Container()
|
|
306 |
{
|
|
307 |
return static_cast<CGSCamcorderPluginContainer*>( iContainer );
|
|
308 |
}
|
|
309 |
|
|
310 |
|
|
311 |
// ---------------------------------------------------------------------------
|
|
312 |
// CGSCamcorderPlugin::HandleListBoxSelectionL
|
|
313 |
// Handle any user actions while in the list view.
|
|
314 |
// ---------------------------------------------------------------------------
|
|
315 |
//
|
|
316 |
void CGSCamcorderPlugin::HandleListBoxSelectionL()
|
|
317 |
{
|
|
318 |
const TInt currentFeatureId = Container()->CurrentFeatureId();
|
|
319 |
|
|
320 |
switch ( currentFeatureId )
|
|
321 |
{
|
|
322 |
case EImageSettingsFolder:
|
|
323 |
case EVideoSettingsFolder:
|
|
324 |
ActivateInternalViewL( currentFeatureId );
|
|
325 |
break;
|
|
326 |
default:
|
|
327 |
break;
|
|
328 |
}
|
|
329 |
}
|
|
330 |
|
|
331 |
|
|
332 |
// ---------------------------------------------------------------------------
|
|
333 |
// CGSCamcorderPlugin::GetCaptionL
|
|
334 |
// Caption text for view to be displayed in NaviPane.
|
|
335 |
// ---------------------------------------------------------------------------
|
|
336 |
//
|
|
337 |
void CGSCamcorderPlugin::GetCaptionL( TDes& aCaption ) const
|
|
338 |
{
|
|
339 |
RDebug::Print(_L("[CGSCamcorderPlugin] GetCaption() - BEGIN" ));
|
|
340 |
|
|
341 |
// the resource file is already opened.
|
|
342 |
HBufC* result = StringLoader::LoadL( R_CAM_GS_SETTINGS_TITLE_NAME );
|
|
343 |
|
|
344 |
aCaption.Copy( *result );
|
|
345 |
delete result;
|
|
346 |
|
|
347 |
RDebug::Print(_L("[CGSCamcorderPlugin] GetCaption() - END" ));
|
|
348 |
}
|
|
349 |
|
|
350 |
|
|
351 |
// ---------------------------------------------------------------------------
|
|
352 |
// CGSCamcorderPlugin::NewContainerL
|
|
353 |
// Creates new iContainer.
|
|
354 |
// ---------------------------------------------------------------------------
|
|
355 |
//
|
|
356 |
void CGSCamcorderPlugin::NewContainerL()
|
|
357 |
{
|
|
358 |
iContainer = new( ELeave ) CGSCamcorderPluginContainer;
|
|
359 |
}
|
|
360 |
|
|
361 |
|
|
362 |
// ---------------------------------------------------------------------------
|
|
363 |
// CGSCamcorderPlugin::ActivateInternalViewL
|
|
364 |
// Activate local views within this plug-in.
|
|
365 |
// ---------------------------------------------------------------------------
|
|
366 |
//
|
|
367 |
void CGSCamcorderPlugin::ActivateInternalViewL( TInt aFeatureId )
|
|
368 |
{
|
|
369 |
switch ( aFeatureId )
|
|
370 |
{
|
|
371 |
case EVideoSettingsFolder:
|
|
372 |
iAppUi->ActivateLocalViewL( KGSCamVideoSettingsViewId );
|
|
373 |
break;
|
|
374 |
case EImageSettingsFolder:
|
|
375 |
iAppUi->ActivateLocalViewL( KGSCamImageSettingsViewId );
|
|
376 |
break;
|
|
377 |
default:
|
|
378 |
break;
|
|
379 |
}
|
|
380 |
}
|
|
381 |
|
|
382 |
|
|
383 |
// ---------------------------------------------------------------------------
|
|
384 |
// CGSCamcorderPlugin::CreateLocalViewL
|
|
385 |
// Initializes local views within this plug-in based on the view ID.
|
|
386 |
// ---------------------------------------------------------------------------
|
|
387 |
//
|
|
388 |
void CGSCamcorderPlugin::CreateLocalViewL()
|
|
389 |
{
|
|
390 |
CAknView* view;
|
|
391 |
|
|
392 |
view = CGSCamPhotoSettingsView::NewLC( *iSettingsModel, iViewArray );
|
|
393 |
iAppUi->AddViewL( view );
|
|
394 |
CleanupStack::Pop( view);
|
|
395 |
|
|
396 |
view = CGSCamVideoSettingsView::NewLC( *iSettingsModel, iViewArray );
|
|
397 |
iAppUi->AddViewL( view );
|
|
398 |
CleanupStack::Pop(view);
|
|
399 |
}
|
|
400 |
|
|
401 |
|
|
402 |
// ---------------------------------------------------------------------------
|
|
403 |
// CGSCamcorderPlugin::CreateIconL
|
|
404 |
// Return the icon, if has one.
|
|
405 |
// ---------------------------------------------------------------------------
|
|
406 |
//
|
|
407 |
CGulIcon* CGSCamcorderPlugin::CreateIconL( const TUid /*aIconType*/ )
|
|
408 |
{
|
|
409 |
TParse* fp = new(ELeave) TParse();
|
|
410 |
CleanupStack::PushL( fp );
|
|
411 |
TInt err = fp->Set(KDirAndFile, &KDC_APP_BITMAP_DIR, NULL);
|
|
412 |
|
|
413 |
if (err != KErrNone)
|
|
414 |
{
|
|
415 |
User::Leave(err);
|
|
416 |
}
|
|
417 |
|
|
418 |
TBuf<KMaxFileName> fileName = fp->FullName();
|
|
419 |
CleanupStack::PopAndDestroy( fp ); //fp
|
|
420 |
|
|
421 |
CGulIcon* icon;
|
|
422 |
|
|
423 |
icon = AknsUtils::CreateGulIconL(
|
|
424 |
AknsUtils::SkinInstance(),
|
|
425 |
KAknsIIDQgnPropSetAppsCams,
|
|
426 |
fileName,
|
|
427 |
EMbmCamerasettingspluginQgn_prop_set_apps_cams,
|
|
428 |
EMbmCamerasettingspluginQgn_prop_set_apps_cams_mask );
|
|
429 |
|
|
430 |
return icon;
|
|
431 |
}
|
|
432 |
|
|
433 |
|
|
434 |
// ---------------------------------------------------------------------------
|
|
435 |
// CGSCamcorderPlugin::PluginProviderCategory
|
|
436 |
// A means to identify the location of this plug-in in the framework.
|
|
437 |
// ---------------------------------------------------------------------------
|
|
438 |
//
|
|
439 |
TInt CGSCamcorderPlugin::PluginProviderCategory() const
|
|
440 |
{
|
|
441 |
//To identify internal plug-ins.
|
|
442 |
return KGSPluginProviderInternal;
|
|
443 |
}
|
|
444 |
|
|
445 |
|
|
446 |
// ---------------------------------------------------------------------------
|
|
447 |
// CGSCamcorderPlugin::TabbedViews()
|
|
448 |
// Returns pointer to tabbed views of application.
|
|
449 |
// ---------------------------------------------------------------------------
|
|
450 |
//
|
|
451 |
CArrayPtrFlat<MGSTabbedView>* CGSCamcorderPlugin::TabbedViews()
|
|
452 |
{
|
|
453 |
return iViewArray;
|
|
454 |
}
|
|
455 |
|
|
456 |
|
|
457 |
// ---------------------------------------------------------------------------
|
|
458 |
// CGSCamcorderPlugin::Visible()
|
|
459 |
// Method for checking, if plugin should be visible and used in GS.
|
|
460 |
// ---------------------------------------------------------------------------
|
|
461 |
//
|
|
462 |
TBool CGSCamcorderPlugin::Visible() const
|
|
463 |
{
|
|
464 |
return ETrue;
|
|
465 |
}
|
|
466 |
|
|
467 |
|
|
468 |
// ---------------------------------------------------------------------------
|
|
469 |
// CGSCamcorderPlugin::CustomOperationL()
|
|
470 |
// Reserved for later use.
|
|
471 |
// ---------------------------------------------------------------------------
|
|
472 |
//
|
|
473 |
TAny* CGSCamcorderPlugin::CustomOperationL( TAny* aParam1, TAny* /*aParam2*/ )
|
|
474 |
{
|
|
475 |
return aParam1;
|
|
476 |
}
|
|
477 |
|
|
478 |
|
|
479 |
// ---------------------------------------------------------------------------
|
|
480 |
// CGSCamcorderPlugin::DynInitMenuPaneL
|
|
481 |
// Dynamically customize menu items
|
|
482 |
// ---------------------------------------------------------------------------
|
|
483 |
//
|
|
484 |
void CGSCamcorderPlugin::DynInitMenuPaneL( TInt aResourceId,
|
|
485 |
CEikMenuPane* aMenuPane )
|
|
486 |
{
|
|
487 |
if ( aResourceId == R_CAM_SETTINGS_LIST_MENU )
|
|
488 |
{
|
|
489 |
#ifdef __SERIES60_HELP
|
|
490 |
if ( !FeatureManager::FeatureSupported( KFeatureIdHelp ) )
|
|
491 |
{
|
|
492 |
aMenuPane->SetItemDimmed( EAknCmdHelp, ETrue );
|
|
493 |
}
|
|
494 |
#endif
|
|
495 |
}
|
|
496 |
}
|
|
497 |
|
|
498 |
|
|
499 |
// ---------------------------------------------------------------------------
|
|
500 |
// CGSCamcorderPlugin::LaunchedFromGS
|
|
501 |
// For variating the construction of the setting items
|
|
502 |
// ---------------------------------------------------------------------------
|
|
503 |
//
|
|
504 |
TBool CGSCamcorderPlugin::LaunchedFromGS() const
|
|
505 |
{
|
|
506 |
return iAppUi->Application()->AppDllUid().iUid != KCameraappUID;
|
|
507 |
}
|
|
508 |
|
|
509 |
|
|
510 |
// ---------------------------------------------------------------------------
|
|
511 |
// CGSCamcorderPlugin::IsSecondaryCameraSettings()
|
|
512 |
// Returns if we have to lauch secondary camera settings or main camera settings
|
|
513 |
// ---------------------------------------------------------------------------
|
|
514 |
//
|
|
515 |
TBool CGSCamcorderPlugin::IsSecondaryCameraSettings()
|
|
516 |
{
|
|
517 |
return iSecondaryCameraSettings;
|
|
518 |
}
|
|
519 |
|
|
520 |
// ---------------------------------------------------------------------------
|
|
521 |
// CGSCamcorderPlugin::SetSecondaryCameraSettings()
|
|
522 |
// Sets if camera has lauched secondary camera settings or main camera settings
|
|
523 |
// ---------------------------------------------------------------------------
|
|
524 |
//
|
|
525 |
void CGSCamcorderPlugin::SetSecondaryCameraSettings( TBool aSecondarySettings )
|
|
526 |
{
|
|
527 |
iSecondaryCameraSettings = aSecondarySettings;
|
|
528 |
}
|
|
529 |
|
|
530 |
|
|
531 |
//
|
|
532 |
// CGSCamcorderPlugin::IntegerSettingValue
|
|
533 |
//
|
|
534 |
TInt CGSCamcorderPlugin::IntegerSettingValue( const TInt aSettingItem )
|
|
535 |
{
|
|
536 |
if ( LaunchedFromGS() )
|
|
537 |
{
|
|
538 |
TInt settingValue = iSettingsModel->IntegerSettingValue( aSettingItem );
|
|
539 |
|
|
540 |
if ( ( ECamSettingItemPhotoMediaStorage == aSettingItem ||
|
|
541 |
ECamSettingItemVideoMediaStorage == aSettingItem ) &&
|
|
542 |
( settingValue == ECamMediaStorageCard ) &&
|
|
543 |
( CamUtility::MemoryCardStatus() != ECamMemoryCardInserted ) )
|
|
544 |
{
|
|
545 |
if ( CamUtility::MassMemoryDrive() > 0 )
|
|
546 |
{
|
|
547 |
settingValue = ECamMediaStorageMassStorage;
|
|
548 |
}
|
|
549 |
else
|
|
550 |
{
|
|
551 |
settingValue = iSettingsModel->IntegerSettingValue(ECamSettingItemRemovePhoneMemoryUsage)?
|
|
552 |
ECamMediaStorageNone:
|
|
553 |
ECamMediaStoragePhone;
|
|
554 |
}
|
|
555 |
}
|
|
556 |
return settingValue;
|
|
557 |
}
|
|
558 |
else
|
|
559 |
{
|
|
560 |
CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( CCoeEnv::Static()->AppUi() );
|
|
561 |
MCamAppController& controller = appUi->AppController();
|
|
562 |
return controller.IntegerSettingValue( aSettingItem );
|
|
563 |
}
|
|
564 |
}
|
|
565 |
|
|
566 |
//
|
|
567 |
// CGSCamcorderPlugin::TextValueFromSettingsModel
|
|
568 |
//
|
|
569 |
TPtrC CGSCamcorderPlugin::TextSettingValue( const TInt aSettingItem )
|
|
570 |
{
|
|
571 |
if ( LaunchedFromGS() )
|
|
572 |
{
|
|
573 |
return iSettingsModel->TextSettingValue( aSettingItem );
|
|
574 |
}
|
|
575 |
else
|
|
576 |
{
|
|
577 |
CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( CCoeEnv::Static()->AppUi() );
|
|
578 |
MCamAppController& controller = appUi->AppController();
|
|
579 |
return controller.TextSettingValue( aSettingItem );
|
|
580 |
}
|
|
581 |
}
|
|
582 |
|
|
583 |
|
|
584 |
//
|
|
585 |
// CGSCamcorderPlugin::SetTextSettingValueL
|
|
586 |
//
|
|
587 |
void CGSCamcorderPlugin::SetTextSettingValueL( TInt aSettingItem,
|
|
588 |
const TDesC& aSettingValue )
|
|
589 |
{
|
|
590 |
if ( !LaunchedFromGS() )
|
|
591 |
{
|
|
592 |
CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( CCoeEnv::Static()->AppUi() );
|
|
593 |
MCamAppController& controller = appUi->AppController();
|
|
594 |
controller.SetTextSettingValueL( aSettingItem, aSettingValue );
|
|
595 |
}
|
|
596 |
else
|
|
597 |
{
|
|
598 |
iSettingsModel->SetTextSettingValueL( aSettingItem, aSettingValue );
|
|
599 |
}
|
|
600 |
}
|
|
601 |
|
|
602 |
//
|
|
603 |
// CGSCamcorderPlugin::SetIntegerSettingValueL
|
|
604 |
//
|
|
605 |
void CGSCamcorderPlugin::SetIntegerSettingValueL( TInt aSettingItem,
|
|
606 |
TInt aSettingValue )
|
|
607 |
{
|
|
608 |
if ( !LaunchedFromGS() )
|
|
609 |
{
|
|
610 |
CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( CCoeEnv::Static()->AppUi() );
|
|
611 |
MCamAppController& controller = appUi->AppController();
|
|
612 |
controller.SetIntegerSettingValueL( aSettingItem, aSettingValue );
|
|
613 |
}
|
|
614 |
else
|
|
615 |
{
|
|
616 |
iSettingsModel->SetIntegerSettingValueL( aSettingItem, aSettingValue );
|
|
617 |
}
|
|
618 |
}
|
|
619 |
|
|
620 |
|
|
621 |
//
|
|
622 |
// CGSCamcorderPlugin::LoadVideoStaticSettingsL
|
|
623 |
//
|
|
624 |
void CGSCamcorderPlugin::LoadVideoStaticSettingsL( TBool aResetFromGS )
|
|
625 |
{
|
|
626 |
if ( LaunchedFromGS() )
|
|
627 |
{
|
|
628 |
iSettingsModel->LoadVideoStaticSettingsL( aResetFromGS );
|
|
629 |
}
|
|
630 |
else
|
|
631 |
{
|
|
632 |
CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( CCoeEnv::Static()->AppUi() );
|
|
633 |
MCamStaticSettings& model = appUi->StaticSettingsModel();
|
|
634 |
model.LoadVideoStaticSettingsL( aResetFromGS );
|
|
635 |
}
|
|
636 |
}
|
|
637 |
|
|
638 |
|
|
639 |
|
|
640 |
//
|
|
641 |
// CGSCamcorderPlugin::LoadPhotoStaticSettingsL
|
|
642 |
//
|
|
643 |
void CGSCamcorderPlugin::LoadPhotoStaticSettingsL( TBool aResetFromGS )
|
|
644 |
{
|
|
645 |
if ( LaunchedFromGS() )
|
|
646 |
{
|
|
647 |
iSettingsModel->LoadPhotoStaticSettingsL( aResetFromGS );
|
|
648 |
}
|
|
649 |
else
|
|
650 |
{
|
|
651 |
CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( CCoeEnv::Static()->AppUi() );
|
|
652 |
MCamStaticSettings& model = appUi->StaticSettingsModel();
|
|
653 |
model.LoadPhotoStaticSettingsL( aResetFromGS );
|
|
654 |
}
|
|
655 |
}
|
|
656 |
|
|
657 |
|
|
658 |
// ---------------------------------------------------------------------------
|
|
659 |
// CGSCamcorderPlugin::DisplayRestoreSettingsDlgL
|
|
660 |
// Display restore Camera setting confirmation dialog
|
|
661 |
// ---------------------------------------------------------------------------
|
|
662 |
//
|
|
663 |
TInt CGSCamcorderPlugin::DisplayRestoreSettingsDlgL()
|
|
664 |
{
|
|
665 |
HBufC* confirmationText;
|
|
666 |
confirmationText = StringLoader::LoadLC( R_CAM_RESTORE_SETTINGS_NOTE_TEXT );
|
|
667 |
CAknQueryDialog* confirmationDialog = new( ELeave )CAknQueryDialog( *confirmationText );
|
|
668 |
CleanupStack::PopAndDestroy( confirmationText );
|
|
669 |
TInt response = confirmationDialog->ExecuteLD( R_CAM_RESTORE_SETTINGS_NOTE );
|
|
670 |
if ( response )
|
|
671 |
{
|
|
672 |
// since restore camera setting item is visible only when
|
|
673 |
// launched from camera, we inform the specific view to handle
|
|
674 |
// this from the camera side, instead doing it here in the plugin
|
|
675 |
if ( !LaunchedFromGS() )
|
|
676 |
{
|
|
677 |
MCamAppController& controller =
|
|
678 |
static_cast<CCamAppUiBase*>(
|
|
679 |
CCoeEnv::Static()->AppUi() )->AppController();
|
|
680 |
controller.RestoreFactorySettingsL( EFalse );
|
|
681 |
}
|
|
682 |
else
|
|
683 |
{
|
|
684 |
iSettingsModel->ResetRepository();
|
|
685 |
iReloadSettings = ETrue;
|
|
686 |
}
|
|
687 |
}
|
|
688 |
return response;
|
|
689 |
}
|
|
690 |
|
|
691 |
// End of file
|