backupandrestore/backupengine/inc/sbeconfig.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 /**
       
     2 * Copyright (c) 2004-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 * SBE Config.
       
    16 * 
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file
       
    24 */
       
    25 
       
    26 #ifndef __SBECONFIG_H__
       
    27 #define __SBECONFIG_H__
       
    28 
       
    29 #include <e32base.h>
       
    30 #include <f32file.h>
       
    31 #include <xml/contenthandler.h> // MContentHandler mix in class
       
    32 #include <charconv.h>
       
    33 using namespace Xml;
       
    34 
       
    35 /**
       
    36 @namespace conn
       
    37 
       
    38 This namespace is the global Symbian Connect namespace which encapsulates 
       
    39 all of the connectivity components within Symbian OS.
       
    40 */
       
    41 
       
    42 namespace conn
       
    43 	{
       
    44 	/**
       
    45 	SBEConfig class is designed to read data from the ini file in order to make configurable the following data:
       
    46 	Global Shared Heap 
       
    47 	Drives not to Backup Up
       
    48 	Secure Id of Central Repository - in order to support deprecated flag (cent_rep) in registration file
       
    49 
       
    50 	@internalTechnology
       
    51 	*/
       
    52 	class CSBEConfig : public CBase, public MContentHandler
       
    53 		{
       
    54 	public:
       
    55 		static CSBEConfig* NewL(RFs& aRFs);
       
    56 		void ParseL();
       
    57 		void SetDefault();
       
    58 		~CSBEConfig();
       
    59 		
       
    60 	public:
       
    61 	// From MContentHandler
       
    62 		void OnStartDocumentL(const RDocumentParameters& aDocParam, TInt aErrorCode);
       
    63 		void OnEndDocumentL(TInt aErrorCode);
       
    64 		void OnStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes, TInt aErrCode);
       
    65 		void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode);
       
    66 		void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
       
    67 		void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, TInt aErrorCode);
       
    68 		void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
       
    69 		void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode);
       
    70 		void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
       
    71 		void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, TInt aErrorCode);
       
    72 		void OnError(TInt aErrorCode);
       
    73 		TAny* GetExtendedInterface(const TInt32 aUid);
       
    74 // End MContentHandler
       
    75 
       
    76 	public:
       
    77 		//getters
       
    78 		void HeapValues(TInt& aMaxSize, TInt& aReductionFactor, TInt& aMaxRetries) const;
       
    79 		TSecureId CentRepId() const ;
       
    80 		const TDriveList& ExcludeDriveList() const ;
       
    81 		TUint AppCloseDelay() const ;
       
    82 		
       
    83 	private:
       
    84 		CSBEConfig(RFs& aRFs);
       
    85 		TInt StringToDrives(const TDesC8& aDes);
       
    86 		
       
    87 		TInt HandleAttributesElement(const RAttributeArray& aAttributes);
       
    88 		
       
    89 	private:
       
    90 		/** reference to RFs */
       
    91 		RFs& iRFs;
       
    92 		
       
    93 		/** Config File Name */
       
    94 		TFileName iFileName;
       
    95 		
       
    96 		/** Config Tag visited */
       
    97 		TBool iConfigTagVisited;
       
    98 		
       
    99 		/** Character converter to convert between UTF-8 and UTF-16 */
       
   100 		CCnvCharacterSetConverter* iConverter;
       
   101 		
       
   102 		/** SBE Global Share Heap Size */
       
   103 		TInt iSBEGSHMaxSize;
       
   104 		
       
   105 		/** Drives Not to Backup */
       
   106 		TDriveList iDrives;
       
   107 		
       
   108 		/** Cent Rep Secure Id */
       
   109 		TSecureId iCentRepId;
       
   110 		
       
   111 		/** Reduction factor if allocation fails */
       
   112 		TInt iReductionFactor;
       
   113 		
       
   114 		/** Number of retries if allocation fails */
       
   115 		TInt iMaxRetries;
       
   116 		
       
   117 		/** Extra time delay to close all non-system apps */
       
   118 		TUint iAppCloseDelay;
       
   119 		};
       
   120 	
       
   121 	}// end of namespace
       
   122 		
       
   123 	
       
   124 #endif //__SBECONFIG_H__