mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteapp/inc/SettingsManager.h
changeset 0 b8ed18f6c07b
equal deleted inserted replaced
-1:000000000000 0:b8ed18f6c07b
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Part of the MVS Application for TechView
       
    15 //
       
    16 
       
    17 #ifndef SETTINGS_MANAGER_H
       
    18 #define SETTINGS_MANAGER_H
       
    19 
       
    20 #include <e32cons.h>
       
    21 #include <f32file.h>
       
    22 #include <s32file.h>
       
    23 
       
    24 class CMVSAppUi;
       
    25 class CMVSConfigAudioFormatDialog; 
       
    26 class CMVSConfigVideoFormatDialog;
       
    27 
       
    28 class CSettingsManager :public CBase
       
    29 	{
       
    30 public:
       
    31 	CSettingsManager();
       
    32 	~CSettingsManager();
       
    33 	static CSettingsManager* NewL();
       
    34 	TBool FileExists();
       
    35 	void MakeSeedIndexL();
       
    36 	//gets general settings from the file store
       
    37 	void ReadGeneralSettingsL(CMVSAppUi* aAppUI);
       
    38 	void WriteGeneralSettingsL(CMVSAppUi* aAppUI);
       
    39 	void WriteAudioDataL(CMVSConfigAudioFormatDialog* apAudioFormat,
       
    40 					  const TUid& aUid);
       
    41 	void  WriteVideoDataL(CMVSConfigVideoFormatDialog* aVideoFormatDlg,
       
    42 						 const TUid& aUid);
       
    43 	TInt ReadAudioDataL(CMVSConfigAudioFormatDialog* apAudioFormat,
       
    44 							   const TUid& aUid);
       
    45 	TBool ReadVideoDataL(CMVSConfigVideoFormatDialog* aVideoFormatDlg,
       
    46 						const TUid& aUid);
       
    47 
       
    48 private:
       
    49 	TBool OpenStore2ReadLC();
       
    50 	void OpenStore2WriteLC();
       
    51 	TBool HasSettings();
       
    52 	void ReadControllerTableL(RReadStream& aStream);
       
    53 	TBool IsControllerAvailableL(const TUid& aUid,
       
    54 										TStreamId&  aSteamId);										
       
    55 	void WriteIndexL(RWriteStream& aStream,
       
    56 					const TUid& aUid,
       
    57 					TStreamId& aStreamId);
       
    58 	void ConstructL();
       
    59 
       
    60 private:
       
    61 	RFs			iFsSession;
       
    62 	CFileStore*	iStore;
       
    63 	TBool iHasSettings;
       
    64 	TStreamId iGenSettingsId;
       
    65 	TStreamId iRootId; //for index writing
       
    66 	//no. of controllers currently available in storage		 
       
    67 	TInt8 iControllerCnt; 
       
    68 	RArray<TUid> iArrUid;
       
    69 	RArray<TStreamId> iArrStreamId;
       
    70 	}; 
       
    71 
       
    72 #endif  SETTINGS_MANAGER_H