brandingserver/BSServer/cbsbrandhandler.h
changeset 31 9dbc70490d9a
equal deleted inserted replaced
30:1fa9b890f29c 31:9dbc70490d9a
       
     1 /*
       
     2 * Copyright (c) 2006 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:  CBSBrandHandler.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CBSBRANDHANDLER_H__
       
    21 #define __CBSBRANDHANDLER_H__
       
    22 
       
    23 #include "rbsobjowningptrarray.h"
       
    24 
       
    25 #include <e32std.h>
       
    26 #include <e32base.h>
       
    27 #include <barsc.h>
       
    28 #include <bamdesca.h>
       
    29 #include <f32file.h>
       
    30 #include <s32file.h>
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class MBSElement;
       
    34 class CBSStorageManager;
       
    35 class CBSSession;
       
    36 
       
    37 /**
       
    38  *
       
    39  *
       
    40  */
       
    41 NONSHARABLE_CLASS( CBSBrandHandler ): public CBase
       
    42 	{
       
    43 	public:
       
    44 		/**
       
    45 		* Two-phased constructor.
       
    46 		*/
       
    47 		static CBSBrandHandler* NewL( const TDesC& aApplicationId,
       
    48 									  const TDesC& aBrandId, 
       
    49 									  const TDesC& aDefaultBrandId, 
       
    50 									  TLanguage aLanguage,
       
    51 									  CBSSession* aSession,
       
    52 									  TInt aReserved = 0);
       
    53 
       
    54 
       
    55 
       
    56     	virtual ~CBSBrandHandler();
       
    57 
       
    58 	private: // constructors
       
    59 	
       
    60 		void ConstructL( const TDesC& aApplicationId,
       
    61 						 const TDesC& aBrandId,
       
    62 						 const TDesC& aDefaultBrandId,
       
    63 						 CBSSession* aSession );
       
    64 						 
       
    65 		CBSBrandHandler( TLanguage aLanguage,
       
    66 						 TInt aReserved );
       
    67 
       
    68 	public:
       
    69 		HBufC* GetTextL( const TDesC8& aId );
       
    70 		HBufC8* GetBufferL( const TDesC8& aId );
       
    71 		TInt GetIntL( const TDesC8& aId );
       
    72 		MBSElement* GetSeveralL( RBSObjOwningPtrArray<HBufC8>& aIds );
       
    73 		void GetFileL( const TDesC8& aId, RFile& aFile );
       
    74 		MBSElement* GetStructureL( TDesC8& aId );
       
    75     	void SetDefaultBrandIdL( const TDesC8& aBrandId );
       
    76 
       
    77 
       
    78 		TInt isBrandUpdateRequiredL ();
       
    79 
       
    80     private:     // New methods
       
    81 
       
    82 		MBSElement* ReadElementLC( const TDesC8& aId, TBool aForceDefault = EFalse );
       
    83 		
       
    84 		MBSElement* ReadStreamL( const TDesC8& aId, 
       
    85 								 RFileReadStream& aStream, 
       
    86 								 TBool aAllowEmptyId = EFalse );
       
    87 
       
    88 		void VerifyVersionL();
       
    89 		void VerifyVersionL( RFileReadStream& aStream );
       
    90 
       
    91 	private: // data
       
    92 		HBufC* iDefaultBrand;
       
    93         ///<File server session, owned
       
    94         RFs                     iFs;
       
    95 
       
    96 		HBufC* iApplicationId;
       
    97 		HBufC* iBrandId;
       
    98 		HBufC* iDefaultBrandId;
       
    99 	    TLanguage iLanguage;
       
   100 	    
       
   101 	    TBool isDefaultBrandUsed;
       
   102 		
       
   103 	    RFile* iHandle;
       
   104 	    
       
   105 	    CBSStorageManager* iStorageManager;
       
   106 	    
       
   107 	    // doesn't own: session
       
   108 	    CBSSession* iSession;
       
   109 	    TInt iReserved ;
       
   110 
       
   111     };
       
   112 
       
   113 #endif      //  __CBSBRANDHANDLER_H__
       
   114 
       
   115 
       
   116 //  END OF FILE
       
   117