brandingserver/BSClient/cbsupdater.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:  CBSUpdater.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CBSUPDATER_H__
       
    21 #define __CBSUPDATER_H__
       
    22 #include <e32std.h>
       
    23 #include "mbsupdater.h"
       
    24 #include "cbsclient.h"
       
    25 
       
    26 /**
       
    27  * Simple ClientServer for
       
    28  * testing and example purposes.
       
    29  */
       
    30 NONSHARABLE_CLASS( CBSUpdater ): public CBase,
       
    31 								 public MBSUpdater
       
    32     {
       
    33 	public:
       
    34 		/**
       
    35 		* Two-phased constructor.
       
    36 		*/
       
    37 		static CBSUpdater* NewL( const TDesC8& aApplicationId );
       
    38 
       
    39     	virtual ~CBSUpdater();
       
    40 
       
    41 		/*
       
    42 		* @see MBSUpdater
       
    43 		*/ 
       
    44 		void Close();
       
    45 
       
    46 	private:
       
    47     	void ConstructL( const TDesC8& aApplicationId );
       
    48 		CBSUpdater();
       
    49 
       
    50 
       
    51 	private: // from MBSUpdater
       
    52 
       
    53      	/*
       
    54      	* @see MBSUpdater
       
    55      	*/
       
    56         void StartTransactionL( const TDesC8& aBrandId,
       
    57          						TLanguage aLanguageId,
       
    58          						TUpdateTransactionType aType = EUpdateInstall,
       
    59 								TInt aReserved = 0 );
       
    60      	/*
       
    61      	* @see MBSUpdater
       
    62      	*/
       
    63 		TInt StopTransactionL();
       
    64 
       
    65      	/*
       
    66      	* @see MBSUpdater
       
    67      	*/
       
    68 		void CancelTransactionL();
       
    69 
       
    70 
       
    71      	/*
       
    72      	* @see MBSUpdater
       
    73      	*/
       
    74 		void RemoveBrandL( const TDesC8& aApplicationId,
       
    75 								   const TDesC8& aBrandId );
       
    76 
       
    77      	/*
       
    78      	* @see MBSUpdater
       
    79      	*/
       
    80 		void RemoveBrandsL( const TDesC8& aApplicationId );
       
    81 
       
    82 
       
    83 		//*** BRAND INSTALLING ***//
       
    84      	/*
       
    85      	* @see MBSUpdater
       
    86      	*/
       
    87         void InsertTextL( const TDesC8& aId,
       
    88         				  const TDesC& aText );
       
    89 
       
    90      	/*
       
    91      	* @see MBSUpdater
       
    92      	*/
       
    93         void InsertBufferL( const TDesC8& aId,
       
    94         					const TDesC8& aBuffer );
       
    95 
       
    96      	/*
       
    97      	* @see MBSUpdater
       
    98      	*/
       
    99         void InsertIntL( const TDesC8& aId,
       
   100         				 TInt aInt );
       
   101 
       
   102      	/*
       
   103      	* @see MBSUpdater
       
   104      	*/
       
   105         void InsertFileL( const TDesC8& aId,
       
   106         				  const TDesC& aFileName );
       
   107 
       
   108      	/*
       
   109      	* @see MBSUpdater
       
   110      	*/
       
   111         void InsertElementL( MBSElement* aElement );
       
   112 
       
   113 
       
   114 
       
   115 		//*** BRAND UPDATING - replacing ***//
       
   116      	/*
       
   117      	* @see MBSUpdater
       
   118      	*/
       
   119         void ReplaceTextL( const TDesC8& aId,
       
   120         				   const TDesC& aText );
       
   121 
       
   122      	/*
       
   123      	* @see MBSUpdater
       
   124      	*/
       
   125         void ReplaceBufferL( const TDesC8& aId,
       
   126         					 const TDesC8& aBuffer );
       
   127 
       
   128      	/*
       
   129      	* @see MBSUpdater
       
   130      	*/
       
   131         void ReplaceIntL( const TDesC8& aId,
       
   132         				  TInt aInt );
       
   133 
       
   134      	/*
       
   135      	* @see MBSUpdater
       
   136      	*/
       
   137         void ReplaceFileL( const TDesC8& aId,
       
   138         				   const TDesC& aFileName );
       
   139 
       
   140      	/*
       
   141      	* @see MBSUpdater
       
   142      	*/
       
   143         void ReplaceElementL( MBSElement* aElement );
       
   144 
       
   145 
       
   146 
       
   147 		//*** BRAND UPDATING - appending ***//
       
   148      	/*
       
   149      	* @see MBSUpdater
       
   150      	*/
       
   151         void AppendTextL( const TDesC8& aId,
       
   152         				  const TDesC& aText );
       
   153 
       
   154      	/*
       
   155      	* @see MBSUpdater
       
   156      	*/
       
   157         void AppendBufferL( const TDesC8& aId,
       
   158         					const TDesC8& aBuffer );
       
   159 
       
   160      	/*
       
   161      	* @see MBSUpdater
       
   162      	*/
       
   163         void AppendIntL( const TDesC8& aId,
       
   164         				 TInt aInt );
       
   165 
       
   166      	/*
       
   167      	* @see MBSUpdater
       
   168      	*/
       
   169         void AppendFileL( const TDesC8& aId,
       
   170         				  const TDesC& aFileName );
       
   171 
       
   172      	/*
       
   173      	* @see MBSUpdater
       
   174      	*/
       
   175         void AppendElementL( MBSElement* aElement );
       
   176 
       
   177      	/*
       
   178      	* @see MBSUpdater
       
   179      	*/
       
   180         void RegisterObserverL( MBSBackupRestoreStateObserver* aBackupObserver ) ;
       
   181 		
       
   182      	/*
       
   183      	* @see MBSUpdater
       
   184      	*/
       
   185         void UnRegisterObserverL( MBSBackupRestoreStateObserver* aObserver ) ;
       
   186 
       
   187 		
       
   188 	private: // data
       
   189 
       
   190 		// tells if a transaction is ongoing or not
       
   191 		TBool iActive;
       
   192 
       
   193 		HBufC8* iApplicationId;
       
   194 		HBufC8* iBrandId;
       
   195 		TLanguage iLanguageId;
       
   196 		TBool iUseCache;
       
   197 		RBSClient iClient;
       
   198 		TUpdateTransactionType iTxType;
       
   199 		TInt iReserved;
       
   200     };
       
   201 
       
   202 #endif      //  __CBSUPDATER_H__
       
   203 
       
   204 
       
   205 //  END OF FILE
       
   206