brandingserver/BSClient/cbsaccess.h
author hgs
Sat, 01 May 2010 17:56:09 +0530
changeset 33 bb46c9d56bcb
parent 31 9dbc70490d9a
permissions -rw-r--r--
201017
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors: cbsaccess.h
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  cbsaccess.h
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
hgs
parents:
diff changeset
    20
#ifndef __CBSACCESS_H__
hgs
parents:
diff changeset
    21
#define __CBSACCESS_H__
hgs
parents:
diff changeset
    22
#include <e32std.h>
hgs
parents:
diff changeset
    23
#include "mbsaccess.h"
hgs
parents:
diff changeset
    24
#include "cbsclient.h"
hgs
parents:
diff changeset
    25
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
// Forward declarations
hgs
parents:
diff changeset
    28
class CFbsBitmap;
hgs
parents:
diff changeset
    29
hgs
parents:
diff changeset
    30
/**
hgs
parents:
diff changeset
    31
 * 
hgs
parents:
diff changeset
    32
 */
hgs
parents:
diff changeset
    33
NONSHARABLE_CLASS( CBSAccess ): public CBase,
hgs
parents:
diff changeset
    34
								public MBSAccess
hgs
parents:
diff changeset
    35
    {
hgs
parents:
diff changeset
    36
	public:
hgs
parents:
diff changeset
    37
		/**
hgs
parents:
diff changeset
    38
		* Two-phased constructor.
hgs
parents:
diff changeset
    39
		*/
hgs
parents:
diff changeset
    40
		static CBSAccess* NewL( const TDesC8& aBrandId,
hgs
parents:
diff changeset
    41
								const TDesC8& aAppId,
hgs
parents:
diff changeset
    42
								const TDesC8& aDefaultBrandId,
hgs
parents:
diff changeset
    43
								TLanguage aLanguageId,
hgs
parents:
diff changeset
    44
        					  	TBool aCacheData,
hgs
parents:
diff changeset
    45
								TInt aReserved = 0 );
hgs
parents:
diff changeset
    46
hgs
parents:
diff changeset
    47
		// destructor
hgs
parents:
diff changeset
    48
    	virtual ~CBSAccess();
hgs
parents:
diff changeset
    49
hgs
parents:
diff changeset
    50
		/*
hgs
parents:
diff changeset
    51
		* Close
hgs
parents:
diff changeset
    52
		*/
hgs
parents:
diff changeset
    53
		void Close();
hgs
parents:
diff changeset
    54
hgs
parents:
diff changeset
    55
	private:
hgs
parents:
diff changeset
    56
hgs
parents:
diff changeset
    57
    	void ConstructL( const TDesC8& aBrandId, 
hgs
parents:
diff changeset
    58
    					 const TDesC8& aAppId, 
hgs
parents:
diff changeset
    59
    					 const TDesC8& aDefaultBrandId );
hgs
parents:
diff changeset
    60
		CBSAccess( TLanguage aLanguageId, TBool aCacheData, TInt aReserved = 0);
hgs
parents:
diff changeset
    61
hgs
parents:
diff changeset
    62
hgs
parents:
diff changeset
    63
	private: // from MBranding
hgs
parents:
diff changeset
    64
hgs
parents:
diff changeset
    65
    	/*
hgs
parents:
diff changeset
    66
    	* Get text type item
hgs
parents:
diff changeset
    67
    	* @param aId ID of the item
hgs
parents:
diff changeset
    68
    	* @return the text item
hgs
parents:
diff changeset
    69
    	*/
hgs
parents:
diff changeset
    70
        HBufC* GetTextL( const TDesC8& aId );
hgs
parents:
diff changeset
    71
hgs
parents:
diff changeset
    72
    	/*
hgs
parents:
diff changeset
    73
    	* Get text type item
hgs
parents:
diff changeset
    74
    	* @param aId ID of the item
hgs
parents:
diff changeset
    75
    	* @return the text item
hgs
parents:
diff changeset
    76
    	*/
hgs
parents:
diff changeset
    77
        HBufC* GetTextLC( const TDesC8& aId );
hgs
parents:
diff changeset
    78
hgs
parents:
diff changeset
    79
    	/*
hgs
parents:
diff changeset
    80
    	* Get 8-bit data type item
hgs
parents:
diff changeset
    81
    	* @param aId ID of the item
hgs
parents:
diff changeset
    82
    	* @return the data buffer item
hgs
parents:
diff changeset
    83
    	*/
hgs
parents:
diff changeset
    84
        HBufC8* GetBufferL( const TDesC8& aId );
hgs
parents:
diff changeset
    85
hgs
parents:
diff changeset
    86
    	/*
hgs
parents:
diff changeset
    87
    	* Get 8-bit data type item
hgs
parents:
diff changeset
    88
    	* @param aId ID of the item
hgs
parents:
diff changeset
    89
    	* @return the data buffer item
hgs
parents:
diff changeset
    90
    	*/
hgs
parents:
diff changeset
    91
        HBufC8* GetBufferLC( const TDesC8& aId );
hgs
parents:
diff changeset
    92
hgs
parents:
diff changeset
    93
    	/*
hgs
parents:
diff changeset
    94
    	* Get integer type item
hgs
parents:
diff changeset
    95
    	* @param aId ID of the item
hgs
parents:
diff changeset
    96
    	* @return the integer item
hgs
parents:
diff changeset
    97
    	*/
hgs
parents:
diff changeset
    98
        TInt GetIntL( const TDesC8& aId );
hgs
parents:
diff changeset
    99
hgs
parents:
diff changeset
   100
hgs
parents:
diff changeset
   101
    	/*
hgs
parents:
diff changeset
   102
    	* Get an array of items
hgs
parents:
diff changeset
   103
    	* @param aIds ID's of the items
hgs
parents:
diff changeset
   104
    	* @return the items
hgs
parents:
diff changeset
   105
    	*/
hgs
parents:
diff changeset
   106
        MBSElement* GetSeveralL( MDesC8Array& aIds );
hgs
parents:
diff changeset
   107
hgs
parents:
diff changeset
   108
    	/*
hgs
parents:
diff changeset
   109
    	* Get a file item
hgs
parents:
diff changeset
   110
    	* @param aId ID of the item
hgs
parents:
diff changeset
   111
    	* @param aFile on return will contain an open file handle
hgs
parents:
diff changeset
   112
    	*        to the file
hgs
parents:
diff changeset
   113
    	*/
hgs
parents:
diff changeset
   114
        void GetFileL( const TDesC8& aId, RFile& aFile );
hgs
parents:
diff changeset
   115
hgs
parents:
diff changeset
   116
    	/*
hgs
parents:
diff changeset
   117
    	* Get a structure type item
hgs
parents:
diff changeset
   118
    	* @param aIds ID of the item
hgs
parents:
diff changeset
   119
    	* @param aFile on return will contain the strucure type item
hgs
parents:
diff changeset
   120
    	* @return structure branding element
hgs
parents:
diff changeset
   121
    	*/
hgs
parents:
diff changeset
   122
        MBSElement* GetStructureL( const TDesC8& aId );
hgs
parents:
diff changeset
   123
hgs
parents:
diff changeset
   124
    	/*
hgs
parents:
diff changeset
   125
    	* Register to observer brand data updates
hgs
parents:
diff changeset
   126
    	* @param aObserver the observer interface
hgs
parents:
diff changeset
   127
    	*/
hgs
parents:
diff changeset
   128
        void RegisterObserverL( MBSBrandChangeObserver* aObserver, MBSBackupRestoreStateObserver *aBackupObserver );
hgs
parents:
diff changeset
   129
hgs
parents:
diff changeset
   130
    	/*
hgs
parents:
diff changeset
   131
    	* Unregister a brand data update observer
hgs
parents:
diff changeset
   132
    	* @param aObserver the observer interface
hgs
parents:
diff changeset
   133
    	*/
hgs
parents:
diff changeset
   134
        void UnRegisterObserverL( MBSBrandChangeObserver* aObserver, MBSBackupRestoreStateObserver *aBackupObserver);
hgs
parents:
diff changeset
   135
hgs
parents:
diff changeset
   136
    	/*
hgs
parents:
diff changeset
   137
    	* Get a bitmap type item
hgs
parents:
diff changeset
   138
    	* @param aBitmapId the ID of the bitmap item itself
hgs
parents:
diff changeset
   139
    	* @param aBitmap on return will contain the bitmap
hgs
parents:
diff changeset
   140
    	* @param aMask on return will contain the mask
hgs
parents:
diff changeset
   141
    	*/
hgs
parents:
diff changeset
   142
		void GetBitmapL( const TDesC8& aBitmapId,
hgs
parents:
diff changeset
   143
						 CFbsBitmap*& aBitmap,
hgs
parents:
diff changeset
   144
						 CFbsBitmap*& aMask );
hgs
parents:
diff changeset
   145
hgs
parents:
diff changeset
   146
hgs
parents:
diff changeset
   147
hgs
parents:
diff changeset
   148
	TInt isBrandUpdateRequiredL ();
hgs
parents:
diff changeset
   149
hgs
parents:
diff changeset
   150
		
hgs
parents:
diff changeset
   151
    public:     // New methods
hgs
parents:
diff changeset
   152
hgs
parents:
diff changeset
   153
hgs
parents:
diff changeset
   154
hgs
parents:
diff changeset
   155
	private: // data
hgs
parents:
diff changeset
   156
		HBufC8* iBrand;
hgs
parents:
diff changeset
   157
		HBufC8* iDefaultBrand;
hgs
parents:
diff changeset
   158
		HBufC8* iAppId;
hgs
parents:
diff changeset
   159
		TLanguage iLanguageId;
hgs
parents:
diff changeset
   160
		TBool iUseCache;
hgs
parents:
diff changeset
   161
		RBSClient iClient;
hgs
parents:
diff changeset
   162
		TInt iReserved;
hgs
parents:
diff changeset
   163
    };
hgs
parents:
diff changeset
   164
hgs
parents:
diff changeset
   165
#endif      //  __CBSACCESS_H__
hgs
parents:
diff changeset
   166
hgs
parents:
diff changeset
   167
hgs
parents:
diff changeset
   168
//  END OF FILE
hgs
parents:
diff changeset
   169