brandingserver/bsclient/cbsaccess.h
changeset 0 e6b17d312c8b
child 21 cfd5c2994f10
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     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 "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: cbsaccess.h
       
    13 *
       
    14 * Description: cbsaccess.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CBSACCESS_H__
       
    20 #define __CBSACCESS_H__
       
    21 #include <e32std.h>
       
    22 #include "mbsaccess.h"
       
    23 #include "cbsclient.h"
       
    24 
       
    25 
       
    26 // Forward declarations
       
    27 class CFbsBitmap;
       
    28 
       
    29 /**
       
    30  * 
       
    31  */
       
    32 NONSHARABLE_CLASS( CBSAccess ): public CBase,
       
    33 								public MBSAccess
       
    34     {
       
    35 	public:
       
    36 		/**
       
    37 		* Two-phased constructor.
       
    38 		*/
       
    39 		static CBSAccess* NewL( const TDesC8& aBrandId,
       
    40 								const TDesC8& aAppId,
       
    41 								const TDesC8& aDefaultBrandId,
       
    42 								TLanguage aLanguageId,
       
    43         					  	TBool aCacheData,
       
    44 								TInt aReserved = 0 );
       
    45 
       
    46 		// destructor
       
    47     	virtual ~CBSAccess();
       
    48 
       
    49 		/*
       
    50 		* Close
       
    51 		*/
       
    52 		void Close();
       
    53 
       
    54 	private:
       
    55 
       
    56     	void ConstructL( const TDesC8& aBrandId, 
       
    57     					 const TDesC8& aAppId, 
       
    58     					 const TDesC8& aDefaultBrandId );
       
    59 		CBSAccess( TLanguage aLanguageId, TBool aCacheData, TInt aReserved = 0);
       
    60 
       
    61 
       
    62 	private: // from MBranding
       
    63 
       
    64     	/*
       
    65     	* Get text type item
       
    66     	* @param aId ID of the item
       
    67     	* @return the text item
       
    68     	*/
       
    69         HBufC* GetTextL( const TDesC8& aId );
       
    70 
       
    71     	/*
       
    72     	* Get text type item
       
    73     	* @param aId ID of the item
       
    74     	* @return the text item
       
    75     	*/
       
    76         HBufC* GetTextLC( const TDesC8& aId );
       
    77 
       
    78     	/*
       
    79     	* Get 8-bit data type item
       
    80     	* @param aId ID of the item
       
    81     	* @return the data buffer item
       
    82     	*/
       
    83         HBufC8* GetBufferL( const TDesC8& aId );
       
    84 
       
    85     	/*
       
    86     	* Get 8-bit data type item
       
    87     	* @param aId ID of the item
       
    88     	* @return the data buffer item
       
    89     	*/
       
    90         HBufC8* GetBufferLC( const TDesC8& aId );
       
    91 
       
    92     	/*
       
    93     	* Get integer type item
       
    94     	* @param aId ID of the item
       
    95     	* @return the integer item
       
    96     	*/
       
    97         TInt GetIntL( const TDesC8& aId );
       
    98 
       
    99 
       
   100     	/*
       
   101     	* Get an array of items
       
   102     	* @param aIds ID's of the items
       
   103     	* @return the items
       
   104     	*/
       
   105         MBSElement* GetSeveralL( MDesC8Array& aIds );
       
   106 
       
   107     	/*
       
   108     	* Get a file item
       
   109     	* @param aId ID of the item
       
   110     	* @param aFile on return will contain an open file handle
       
   111     	*        to the file
       
   112     	*/
       
   113         void GetFileL( const TDesC8& aId, RFile& aFile );
       
   114 
       
   115     	/*
       
   116     	* Get a structure type item
       
   117     	* @param aIds ID of the item
       
   118     	* @param aFile on return will contain the strucure type item
       
   119     	* @return structure branding element
       
   120     	*/
       
   121         MBSElement* GetStructureL( const TDesC8& aId );
       
   122 
       
   123     	/*
       
   124     	* Register to observer brand data updates
       
   125     	* @param aObserver the observer interface
       
   126     	*/
       
   127         void RegisterObserverL( MBSBrandChangeObserver* aObserver, MBSBackupRestoreStateObserver *aBackupObserver );
       
   128 
       
   129     	/*
       
   130     	* Unregister a brand data update observer
       
   131     	* @param aObserver the observer interface
       
   132     	*/
       
   133         void UnRegisterObserverL( MBSBrandChangeObserver* aObserver, MBSBackupRestoreStateObserver *aBackupObserver);
       
   134 
       
   135     	/*
       
   136     	* Get a bitmap type item
       
   137     	* @param aBitmapId the ID of the bitmap item itself
       
   138     	* @param aBitmap on return will contain the bitmap
       
   139     	* @param aMask on return will contain the mask
       
   140     	*/
       
   141 		void GetBitmapL( const TDesC8& aBitmapId,
       
   142 						 CFbsBitmap*& aBitmap,
       
   143 						 CFbsBitmap*& aMask );
       
   144 
       
   145 
       
   146 
       
   147 	TInt isBrandUpdateRequiredL ();
       
   148 
       
   149 		
       
   150     public:     // New methods
       
   151 
       
   152 
       
   153 
       
   154 	private: // data
       
   155 		HBufC8* iBrand;
       
   156 		HBufC8* iDefaultBrand;
       
   157 		HBufC8* iAppId;
       
   158 		TLanguage iLanguageId;
       
   159 		TBool iUseCache;
       
   160 		RBSClient iClient;
       
   161 		TInt iReserved;
       
   162     };
       
   163 
       
   164 #endif      //  __CBSACCESS_H__
       
   165 
       
   166 
       
   167 //  END OF FILE
       
   168