brandingserver/inc/mbsupdater.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:
       
    13 *
       
    14 * Description: MBSUpdater
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20  #ifndef __MBSUPDATER_H
       
    21  #define __MBSUPDATER_H
       
    22 
       
    23  #include <e32std.h>
       
    24  #include <mbselement.h>
       
    25 
       
    26 class MBSBackupRestoreStateObserver ;
       
    27 
       
    28 const TInt KBSAutomaticVersionUpdate = -1;
       
    29 
       
    30  /**
       
    31   * An interface for updating branding information
       
    32   *
       
    33   * @since
       
    34   */
       
    35  class MBSUpdater
       
    36      {
       
    37      public:
       
    38 
       
    39 		enum TUpdateTransactionType
       
    40 			{
       
    41 			EUpdateInstall = 1,
       
    42 			EUpdateAppend,
       
    43 			EUpdateReplace,
       
    44 			EUpdateUninstall
       
    45 			};
       
    46 
       
    47 		//*** TRANSACTION HANDLING ***//
       
    48 
       
    49      	/*
       
    50      	* Start transaction for installing a brand.
       
    51      	* @param aApplicationId id of the application
       
    52      	* @param aBrandId id of the brand
       
    53      	* @param aLanguageId languageid of the brand
       
    54      	* @param aReserved for further use
       
    55      	*/
       
    56         virtual void StartTransactionL( const TDesC8& aBrandId,
       
    57          								TLanguage aLanguageId,
       
    58          								TUpdateTransactionType aType = EUpdateInstall,
       
    59          								TInt aReserved = 0 ) = 0;
       
    60 
       
    61      	/*
       
    62      	* Stop brand installation transaction.
       
    63      	* Calling this will indicate that the brand has
       
    64      	* been updated completely and it will be taken
       
    65      	* into use.
       
    66      	* @return new version of the installed/updated brand
       
    67      	*/
       
    68 		virtual TInt StopTransactionL() = 0;
       
    69 
       
    70      	/*
       
    71      	* Cancels brand installation transaction.
       
    72      	* All the elements updated in this transaction
       
    73      	* will be discarded.
       
    74      	*/
       
    75 		virtual void CancelTransactionL() = 0;
       
    76 
       
    77 
       
    78 		//*** BRAND REMOVING ***//
       
    79 		
       
    80      	/*
       
    81      	* Removes all brand data from the specified brand.
       
    82      	*/
       
    83 		virtual void RemoveBrandL( const TDesC8& aApplicationId,
       
    84 								   const TDesC8& aBrandId ) = 0;
       
    85 
       
    86      	/*
       
    87      	* Removes all brand data from the specified application.
       
    88      	*/
       
    89 		virtual void RemoveBrandsL( const TDesC8& aApplicationId ) = 0;
       
    90 
       
    91 
       
    92 		//*** BRAND INSTALLING ***//
       
    93 
       
    94 
       
    95     	/*
       
    96     	* Insert text type item into the new brand
       
    97     	* @param aId ID of the item
       
    98     	* @param aText the text item
       
    99     	*/
       
   100         virtual void InsertTextL( const TDesC8& aId, const TDesC& aText ) = 0;
       
   101 
       
   102     	/*
       
   103     	* Insert 8-bit data type item into the new brand
       
   104     	* @param aId ID of the item
       
   105     	* @param aBuffer the data item
       
   106     	*/
       
   107         virtual void InsertBufferL( const TDesC8& aId, const TDesC8& aBuffer ) = 0;
       
   108 
       
   109     	/*
       
   110     	* Insert integer type item into the new brand
       
   111     	* @param aId ID of the item
       
   112     	* @param aInt the integer item
       
   113     	*/
       
   114         virtual void InsertIntL( const TDesC8& aId, TInt aInt ) = 0;
       
   115 
       
   116     	/*
       
   117     	* Insert a file type item into the new brand.
       
   118     	* Note that the this is only the id and file name pair,
       
   119     	* the file itself has to be imported separately.
       
   120     	* @param aId ID of the item
       
   121     	* @param aFile the integer item
       
   122     	*/
       
   123         virtual void InsertFileL( const TDesC8& aId,
       
   124         					   	  const TDesC& aFileName ) = 0;
       
   125 
       
   126      	/*
       
   127      	* Inserts an element into the brand that is being installed.
       
   128      	* @param aElement the element
       
   129      	*/
       
   130         virtual void InsertElementL( MBSElement* aElement ) = 0;
       
   131 
       
   132 
       
   133 
       
   134 
       
   135 
       
   136 		//*** BRAND UPDATING - replacing ***//
       
   137 
       
   138 
       
   139     	/*
       
   140     	* Insert text type item into the new brand
       
   141     	* @param aId ID of the item
       
   142     	* @param aText the text item
       
   143     	*/
       
   144         virtual void ReplaceTextL( const TDesC8& aId, const TDesC& aText ) = 0;
       
   145 
       
   146     	/*
       
   147     	* Insert 8-bit data type item into the new brand
       
   148     	* @param aId ID of the item
       
   149     	* @param aBuffer the data item
       
   150     	*/
       
   151         virtual void ReplaceBufferL( const TDesC8& aId, const TDesC8& aBuffer ) = 0;
       
   152 
       
   153     	/*
       
   154     	* Insert integer type item into the new brand
       
   155     	* @param aId ID of the item
       
   156     	* @param aInt the integer item
       
   157     	*/
       
   158         virtual void ReplaceIntL( const TDesC8& aId, TInt aInt ) = 0;
       
   159 
       
   160     	/*
       
   161     	* Insert a file type item into the new brand.
       
   162     	* Note that the this is only the id and file name pair,
       
   163     	* the file itself has to be imported separately.
       
   164     	* @param aId ID of the item
       
   165     	* @param aFile the integer item
       
   166     	*/
       
   167         virtual void ReplaceFileL( const TDesC8& aId,
       
   168         					   	  const TDesC& aFileName ) = 0;
       
   169 
       
   170      	/*
       
   171      	* Inserts an element into the brand that is being installed.
       
   172      	* @param aElement the element
       
   173      	*/
       
   174         virtual void ReplaceElementL( MBSElement* aElement ) = 0;
       
   175 
       
   176 
       
   177 
       
   178 		//*** BRAND UPDATING - appending ***//
       
   179 
       
   180 
       
   181     	/*
       
   182     	* Insert text type item into the new brand
       
   183     	* @param aId ID of the item
       
   184     	* @param aText the text item
       
   185     	*/
       
   186         virtual void AppendTextL( const TDesC8& aId, const TDesC& aText ) = 0;
       
   187 
       
   188     	/*
       
   189     	* Insert 8-bit data type item into the new brand
       
   190     	* @param aId ID of the item
       
   191     	* @param aBuffer the data item
       
   192     	*/
       
   193         virtual void AppendBufferL( const TDesC8& aId, const TDesC8& aBuffer ) = 0;
       
   194 
       
   195     	/*
       
   196     	* Insert integer type item into the new brand
       
   197     	* @param aId ID of the item
       
   198     	* @param aInt the integer item
       
   199     	*/
       
   200         virtual void AppendIntL( const TDesC8& aId, TInt aInt ) = 0;
       
   201 
       
   202     	/*
       
   203     	* Insert a file type item into the new brand.
       
   204     	* Note that the this is only the id and file name pair,
       
   205     	* the file itself has to be imported separately.
       
   206     	* @param aId ID of the item
       
   207     	* @param aFile the integer item
       
   208     	*/
       
   209         virtual void AppendFileL( const TDesC8& aId,
       
   210         					   	  const TDesC& aFileName ) = 0;
       
   211 
       
   212      	/*
       
   213      	* Inserts an element into the brand that is being installed.
       
   214      	* @param aElement the element
       
   215      	*/
       
   216         virtual void AppendElementL( MBSElement* aElement ) = 0;
       
   217 
       
   218 
       
   219         /*
       
   220         * Closes the handle to server and deletes the object.
       
   221         */
       
   222 		virtual void Close() = 0;
       
   223 		
       
   224     	/*
       
   225     	* Register to observer backup restore state change
       
   226     	* @param aObserver the observer interface
       
   227     	*/
       
   228         virtual void RegisterObserverL( MBSBackupRestoreStateObserver* aBackupObserver ) = 0;
       
   229 		
       
   230     	/*
       
   231     	* Unregister a backup restore state change observer
       
   232     	* @param aObserver the observer interface
       
   233     	*/
       
   234         virtual void UnRegisterObserverL( MBSBackupRestoreStateObserver* aObserver ) = 0;
       
   235 		
       
   236 
       
   237 	protected:
       
   238      	/*
       
   239      	* Destructor
       
   240      	*/
       
   241      	virtual ~MBSUpdater() {};
       
   242      };
       
   243 
       
   244  #endif //__MBSUPDATER_H