brandingserver/Inc/mbsaccess.h
changeset 31 9dbc70490d9a
child 33 bb46c9d56bcb
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:  MBSAccess
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __MBSACCESS_H
       
    22 #define __MBSACCESS_H
       
    23 
       
    24 #include <E32Std.h>
       
    25 #include <mbselement.h>
       
    26 #include <bamdesca.h>
       
    27 #include <f32file.h>
       
    28 
       
    29 
       
    30 // forward declarations
       
    31 class MBSBrandChangeObserver;
       
    32 class MBSBackupRestoreStateObserver;
       
    33 class CFbsBitmap;
       
    34 
       
    35 /**
       
    36  * An interface for getting branding information
       
    37  *
       
    38  * @since
       
    39  */
       
    40 class MBSAccess
       
    41     {
       
    42     public:
       
    43 
       
    44     	/*
       
    45     	* Get text type item
       
    46     	* @param aId ID of the item
       
    47     	* @return the text item
       
    48     	*/
       
    49         virtual HBufC* GetTextL( const TDesC8& aId ) = 0;
       
    50 
       
    51     	/*
       
    52     	* Get text type item
       
    53     	* @param aId ID of the item
       
    54     	* @return the text item
       
    55     	*/
       
    56         virtual HBufC* GetTextLC( const TDesC8& aId ) = 0;
       
    57 
       
    58     	/*
       
    59     	* Get 8-bit data type item
       
    60     	* @param aId ID of the item
       
    61     	* @return the data buffer item
       
    62     	*/
       
    63         virtual HBufC8* GetBufferL( const TDesC8& aId ) = 0;
       
    64 
       
    65     	/*
       
    66     	* Get 8-bit data type item
       
    67     	* @param aId ID of the item
       
    68     	* @return the data buffer item
       
    69     	*/
       
    70         virtual HBufC8* GetBufferLC( const TDesC8& aId ) = 0;
       
    71 
       
    72     	/*
       
    73     	* Get integer type item
       
    74     	* @param aId ID of the item
       
    75     	* @return the integer item
       
    76     	*/
       
    77         virtual TInt GetIntL( const TDesC8& aId ) = 0;
       
    78 
       
    79 
       
    80     	/*
       
    81     	* Get an array of items
       
    82     	* @param aIds ID's of the items
       
    83     	* @return the items
       
    84     	*/
       
    85         virtual MBSElement* GetSeveralL( MDesC8Array& aIds ) = 0;
       
    86 
       
    87 
       
    88     	/*
       
    89     	* Get a file item
       
    90     	* @param aId ID of the item
       
    91     	* @param aFile on return will contain an open file handle
       
    92     	*        to the file
       
    93     	*/
       
    94         virtual void GetFileL( const TDesC8& aId,
       
    95         					   RFile& aFile ) = 0;
       
    96 
       
    97     	/*
       
    98     	* Get a structure type item
       
    99     	* @param aIds ID of the item
       
   100     	* @return structure branding element
       
   101     	*/
       
   102         virtual MBSElement* GetStructureL( const TDesC8& aId ) = 0;
       
   103 
       
   104     	/*
       
   105     	* Register to observer brand data updates
       
   106     	* @param aObserver the observer interface
       
   107     	*/
       
   108         virtual void RegisterObserverL( MBSBrandChangeObserver* aObserver, MBSBackupRestoreStateObserver* aBackupObserver ) = 0;
       
   109 
       
   110     	/*
       
   111     	* Unregister a brand data update observer
       
   112     	* @param aObserver the observer interface
       
   113     	*/
       
   114         virtual void UnRegisterObserverL( MBSBrandChangeObserver* aObserver, MBSBackupRestoreStateObserver *aBackupObserver ) = 0;
       
   115 
       
   116     	/*
       
   117     	* Get a bitmap type item.
       
   118     	* Note that this method supports skins, but as skin support
       
   119     	* requires CONE, it will only try to load skin bitmaps if
       
   120     	* CONE is available. Else it will only load normal bitmaps.
       
   121     	* @param aBitmapId the ID of the bitmap item itself
       
   122     	* @param aBitmap on return will contain the bitmap
       
   123     	* @param aMask on return will contain the mask
       
   124     	*/
       
   125 		virtual void GetBitmapL( const TDesC8& aBitmapId,
       
   126 								 CFbsBitmap*& aBitmap,
       
   127 								 CFbsBitmap*& aMask ) = 0;
       
   128 
       
   129 
       
   130 	virtual TInt isBrandUpdateRequiredL () = 0;
       
   131         /*
       
   132         * Closes the handle to server and deletes the object.
       
   133         */
       
   134 		virtual void Close() = 0;
       
   135 
       
   136 	protected:
       
   137 
       
   138     	/*
       
   139     	* Destructor
       
   140     	*/
       
   141     	virtual ~MBSAccess() {};
       
   142     };
       
   143 
       
   144 #endif //__MBSACCESS_H