appfw/apparchitecture/tef/refnativeplugin/sisregistrywritablesession.h
branchRCL_3
changeset 63 c2c61fdca848
parent 62 924385140d98
child 64 75184094ace1
child 66 9af619316cbf
equal deleted inserted replaced
62:924385140d98 63:c2c61fdca848
     1 /*
       
     2 * Copyright (c) 2004-2010 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: 
       
    15 * RSisRegistryWritableSession - restricted client registry session interface
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @internalTechnology
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef __SISREGISTRYWRITABLESESSION_H__
       
    27 #define __SISREGISTRYWRITABLESESSION_H__
       
    28 
       
    29 #include <e32std.h>
       
    30 #include <swi/sisregistrysession.h>
       
    31 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    32 #include <usif/usifcommon.h>
       
    33 #endif
       
    34 namespace Swi
       
    35 {
       
    36 class CApplication;
       
    37 class CSisRegistryPackage;
       
    38 
       
    39 namespace Sis
       
    40 	{
       
    41 	class CController;
       
    42 	}
       
    43 
       
    44 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    45 using Usif::TComponentId;
       
    46 using Usif::TScomoState;
       
    47 
       
    48 class CSoftwareTypeRegInfo;
       
    49 #endif
       
    50 
       
    51 class RSisRegistryWritableSession : public RSisRegistrySession
       
    52 	{
       
    53 public:
       
    54 
       
    55 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    56 	/**
       
    57 	 * Starts a transaction with SCR for the mutable operations of this session.
       
    58 	 * The APIs that this transaction covers are AddEntryL, UpdateEntryL and DeleteEntryL.
       
    59 	 * Note that this transaction has no relation with the transaction ID (aTransactionID)
       
    60 	 * parameter being supplied to the mutable APIs.
       
    61 	 */
       
    62 	IMPORT_C void CreateTransactionL();
       
    63 
       
    64 	/**
       
    65 	 * Commits the changes performed in the SCR after the call to BeginTransactionL.
       
    66 	 */
       
    67 	IMPORT_C void CommitTransactionL();
       
    68 
       
    69 	/**
       
    70 	 * Discards the changes performed in the SCR after the call to BeginTransactionL.
       
    71 	 */
       
    72 	IMPORT_C void RollbackTransactionL();
       
    73 #endif
       
    74 
       
    75 	/**
       
    76 	 * Adds a registry entry representing this package
       
    77 	 *
       
    78 	 * @param aApplication The application description provided by Swi
       
    79 	 * @param aController The controller in a buffer 
       
    80 	 * @param aTransactionID The TransactionID for IntegrityServices provided
       
    81 	 *		  				 by Swis of TInt64 type
       
    82 	 *
       
    83 	 */
       
    84 	IMPORT_C void AddEntryL(const CApplication& aApplication, const TDesC8& aController, TInt64 aTransactionID);
       
    85 
       
    86 	/**
       
    87 	 * Updates the registry entry representing this package
       
    88 	 *
       
    89 	 * @param aApplication The application description provided by Swi
       
    90 	 * @param aController The controller in a buffer 
       
    91 	 * @param aTransactionID The TransactionID for IntegrityServices provided
       
    92 	 *		  				 by Swis of TInt64 type
       
    93 	 *
       
    94 	 */
       
    95 	IMPORT_C void UpdateEntryL(const CApplication& aApplication, const TDesC8& aController, TInt64 aTransactionID);
       
    96 	
       
    97 	/**
       
    98 	 * Deletes the entry from the registry represented by the given package
       
    99 	 *
       
   100 	 * @param aPackage The package to search for
       
   101 	 * @param aTransactionID The TransactionID for IntegrityServices provided
       
   102 	 *		  				 by Swis of TInt64 type
       
   103 	 *
       
   104 	 */
       
   105 	IMPORT_C void DeleteEntryL(const CSisRegistryPackage& aPackage, TInt64 aTransactionID);
       
   106 
       
   107 	/**
       
   108 	 * Notification to registry that a drive has been mounted
       
   109 	 *
       
   110 	 * @param aDrive Drive number; 	 
       
   111 	 * 
       
   112 	 * @note valid value are between 0 and KMaxDrives - 1 inclusive
       
   113 	 * 0 stands for A drive and  KMaxDrives - 1 for Z
       
   114 	 *
       
   115 	 */
       
   116 	IMPORT_C void AddDriveL(const TInt aDrive);
       
   117 	
       
   118 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
   119 	/**
       
   120 	 * Notification to registry that a drive has been dismounted
       
   121 	 *
       
   122 	 * @param aDrive Drive as a number; 
       
   123 	 *
       
   124 	 * @note  valid value are between 0 and KMaxDrives - 1 inclusive
       
   125 	 * 0 stands for A drive and  KMaxDrives - 1 for Z
       
   126 	 *
       
   127 	 */
       
   128 	IMPORT_C void RemoveDriveL(const TInt aDrive);
       
   129 
       
   130 	/**
       
   131 	 * Notification to the registry that Software Installation has been rolled
       
   132 	 * back and the cache needs to be regenerated from the contents on disk.
       
   133 	 */
       
   134 	IMPORT_C void RegenerateCacheL();
       
   135 #endif
       
   136 	
       
   137 	/**
       
   138  	* Returns ETrue if any ROM stub in the filesystem has the package uid specified
       
   139  	* in aPackageId 
       
   140  	* With the addition of SA upgrades to ROM, a package may be both in ROM, upgraded 
       
   141  	* on another drive and this method can be used to check for the presence 
       
   142  	* of an upgraded ROM package.
       
   143  	*
       
   144  	*
       
   145  	* @param aPackageId		Package Id to be searched in the ROM stub files.
       
   146  	*
       
   147  	* @return ETrue if it can find the aPackageId in any of the ROM stub SIS.
       
   148  	*         EFalse otherwise
       
   149  	*/
       
   150 	IMPORT_C TBool PackageExistsInRomL(const TUid& aPackageId);
       
   151 	
       
   152 
       
   153 	
       
   154 	/**
       
   155 	* Gets all the eclipsable file's entries from the ROM stub file of a ROM based package.
       
   156 	*
       
   157 	* @param aUid		Package UId to identify the right stub file.
       
   158 	*
       
   159 	* @param aFiles		A pointer array of file names to be populated.
       
   160 	*
       
   161 	*/
       
   162 	IMPORT_C void GetFilesForRomApplicationL(const TUid& aPackageId, RPointerArray<HBufC>& aFiles);
       
   163 
       
   164 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
   165 	/**
       
   166 	* Activates the component identified by the supplied parameter.
       
   167 	*
       
   168 	* @param aComponentId		Identifies the installed component, which is to be activated.
       
   169 	*
       
   170 	*/
       
   171 	IMPORT_C void ActivateComponentL(TComponentId aComponentId);
       
   172 
       
   173 	/**
       
   174 	* Deactivates the component identified by the supplied parameter.
       
   175 	*
       
   176 	* @param aComponentId		Identifies the installed component, which is to be deactivated.
       
   177 	*
       
   178 	*/
       
   179 	IMPORT_C void DeactivateComponentL(TComponentId aComponentId);
       
   180 
       
   181 	/**
       
   182 	 * Adds a registry entry representing a package containing a Layered Execution Environment
       
   183 	 *
       
   184 	 * @param aApplication The application description provided by Swi
       
   185 	 * @param aController The controller in a buffer
       
   186 	 * @param aSwTypeRegInfoArray The array of the software types to be registered
       
   187 	 * @param aTransactionID The TransactionID for IntegrityServices provided by Swis of TInt64 type
       
   188 	 *
       
   189 	 */
       
   190 	IMPORT_C void AddEntryL(const CApplication& aApplication, const TDesC8& aController, const RPointerArray<CSoftwareTypeRegInfo>& aSwTypeRegInfoArray, TInt64 aTransactionID);
       
   191 
       
   192 	/**
       
   193 	 * Updates the registry entry representing a package containing a Layered Execution Environment.
       
   194 	 * The SISRegistryServer checks if the registration info passed in aSwTypeRegInfoArray matches
       
   195 	 * the data passed during the installation of the base package. If they differ the installation terinates.
       
   196 	 * Hence, this upgrade package may upgarde the LEE but cannot change its registration data.
       
   197 	 *
       
   198 	 * @param aApplication The application description provided by Swi
       
   199 	 * @param aController The controller in a buffer
       
   200 	 * @param aSwTypeRegInfoArray The array of the software types to be verified against the already registered base package
       
   201 	 * @param aTransactionID The TransactionID for IntegrityServices provided by Swis of TInt64 type
       
   202 	 *
       
   203 	 */
       
   204 	IMPORT_C void UpdateEntryL(const CApplication& aApplication, const TDesC8& aController, const RPointerArray<CSoftwareTypeRegInfo>& aSwTypeRegInfoArray, TInt64 aTransactionID);
       
   205 
       
   206 private:
       
   207 	void SetComponentStateL(TComponentId aComponentId, TScomoState aState);
       
   208 #endif
       
   209 	void AddEntryImplL(TInt aMessage, const CApplication& aApplication, const TDesC8& aController, TInt64 aTransactionID, TIpcArgs& aIpcArgs);
       
   210 	void UpdateEntryImplL(TInt aMessage, const CApplication& aApplication, const TDesC8& aController, TInt64 aTransactionID, TIpcArgs& aIpcArgs);
       
   211 	};
       
   212 
       
   213 } // namespace
       
   214 #endif