installationservices/swi/inc/installclientserver.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 1997-2009 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 * Common header for the server and the client.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @internalTechnology
       
    23 */
       
    24 
       
    25 #ifndef __INSTALLCLIENTSERVER_H__
       
    26 #define __INSTALLCLIENTSERVER_H__
       
    27 
       
    28 #include <e32std.h>
       
    29 
       
    30 namespace Swi
       
    31 {
       
    32 class CSisRegistryPackage;
       
    33 
       
    34 _LIT(KInstallServerName, "!InstallServer");
       
    35 _LIT(KInstallServerImage, "InstallServer");
       
    36 
       
    37 const TUid KInstallServerUid3 = { 0x101F7295 };
       
    38 
       
    39 /// The current version of the Install Server
       
    40 const TInt KInstallServerVersionMajor=0;
       
    41 const TInt KInstallServerVersionMinor=0;
       
    42 const TInt KInstallServerVersionBuild=0;
       
    43 
       
    44 /**
       
    45  * Messages Launcher sends to SWIS
       
    46  * @released
       
    47  * @internalTechnology
       
    48  */
       
    49 enum TInstallServerMessage
       
    50 	{
       
    51 	EInstall,
       
    52 	EUninstall,
       
    53 	ECancel,
       
    54 	ERestore,
       
    55 	ERestoreFile,
       
    56 	ERestoreCommit,
       
    57 	EListUnInstalledPkgs,
       
    58 	ERemoveUnInstalledPkg
       
    59 	#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    60 	,EGetComponentInfo
       
    61 	#endif	
       
    62 	};
       
    63 	
       
    64 /**
       
    65  * Restore messages pass parameters in these message slots
       
    66  * @released
       
    67  * @internalTechnology
       
    68  */	
       
    69 
       
    70 enum TRestoreMessage 
       
    71 	{
       
    72 	EMessageSlotRestoreUid,
       
    73 	EMessageSlotRestoreController
       
    74 	};
       
    75 	
       
    76 /**
       
    77  * Restore file messages pass parameters in these message slots
       
    78  * @released
       
    79  * @internalTechnology
       
    80  */	
       
    81 
       
    82 enum TRestoreFileMessage 
       
    83 	{
       
    84 	EMessageSlotRestoreFs,
       
    85 	EMessageSlotRestoreFile,
       
    86 	EMessageSlotRestorePath
       
    87 	};
       
    88 
       
    89 
       
    90 /**
       
    91  * A bad client is panicked by SWIS with these codes
       
    92  * @released
       
    93  * @internalTechnology
       
    94  */
       
    95 enum TInstallServerPanic
       
    96 	{
       
    97 	EPanicInstallServerBadDescriptor,
       
    98 	EPanicInstallServerIllegalFunction
       
    99 	};
       
   100 
       
   101 /**
       
   102  * Session to communicate with SWIS in order to initiate installation or
       
   103  * uninstallation.
       
   104  *
       
   105  * @released
       
   106  * @internalTechnology
       
   107  */
       
   108 class RInstallServerSession : public RSessionBase
       
   109 	{
       
   110 public:
       
   111 	/**
       
   112 	 * Connect to the server, attempt to start it if it is not yet running
       
   113 	 *
       
   114 	 * @return KErrNone if successful, or an error code
       
   115 	 */
       
   116 	IMPORT_C TInt Connect();
       
   117 	
       
   118 	/**
       
   119 	 * Start installation. SWIS will ask SISHelper for package data so it is 
       
   120 	 * not necessary to pass any additional arguments.
       
   121 	 *
       
   122 	 * @param aStatus	A request status which indicates the completion status of the asynchronous request.
       
   123 	 */
       
   124 	void InstallL(const TIpcArgs& aArgs,TRequestStatus& aStatus);
       
   125 	
       
   126 	#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
   127 	/**
       
   128 	 * Get component information for a SIS file. This operation does not install the file, only parses information inside it.
       
   129 	 *
       
   130 	 * @param aStatus	A request status which indicates the completion status of the asynchronous request.
       
   131 	 */
       
   132 	void GetComponentInfoL(const TIpcArgs& aArgs,TRequestStatus& aStatus);
       
   133 	#endif
       
   134 	
       
   135 	/**
       
   136 	 * Start uninstallation
       
   137 	 *
       
   138 	 * @param aUid UID of the package to uninstall
       
   139 	 * @param aStatus	A request status which indicates the completion status of the asynchronous request.
       
   140 	 */
       
   141 	void Uninstall(TIpcArgs& args, TRequestStatus& aStatus);
       
   142 	
       
   143 	/**
       
   144 	 * Cancel current activity of SWIS. This is meaningful during file 
       
   145 	 * installation phase only because to cancel installation planning it is
       
   146 	 * only necessary to cancel a dialog box.
       
   147 	 *
       
   148 	 * @return KErrNone if successful, or an error code
       
   149 	 */
       
   150 	IMPORT_C TInt Cancel();
       
   151 	
       
   152 	/**
       
   153 	 * Start restoration of a package
       
   154 	 *
       
   155 	 * @param aArgs		Contains the UID of the package being restored and the associated metadata
       
   156 	 * @return			KErrNone if successful, or an error code
       
   157 	 */
       
   158 	IMPORT_C TInt Restore(const TIpcArgs& aArgs);
       
   159 	
       
   160 	/**
       
   161 	 * Restores a single system file
       
   162 	 *
       
   163 	 * @param aArgs		Contains the destination filename of the file to be restored and a file handle to its data
       
   164 	 * @return			KErrNone if successful, or an error code
       
   165 	 */
       
   166 	IMPORT_C TInt RestoreFile(const TIpcArgs& aArgs);
       
   167 		
       
   168 	/**
       
   169 	 * Commits the files submitted in this package
       
   170 	 *
       
   171 	 * @return			KErrNone if successful, or an error code
       
   172 	 */
       
   173 	IMPORT_C TInt RestoreCommit();
       
   174 
       
   175 	};
       
   176 
       
   177 
       
   178 /**
       
   179  * Session to communicate with SWIS in order to request and remove
       
   180  * Uninstalled packages from a removable drive
       
   181  *
       
   182  * @released
       
   183  * @internalTechnology
       
   184  */
       
   185 class RUninstalledPkgsSession : public RSessionBase
       
   186 	{
       
   187 public:
       
   188 	/**
       
   189 	 * Connect to the server, attempt to start it if it is not yet running
       
   190 	 *
       
   191 	 * @return KErrNone if successful, or an error code
       
   192 	 */
       
   193 	TInt Connect();
       
   194 	
       
   195 	/**
       
   196 	 * Close the connection to the server
       
   197 	 *
       
   198 	 * @return KErrNone if successful, or an error code
       
   199 	 */
       
   200 	void Close();
       
   201 	
       
   202 	/**
       
   203 	 * Request Uninstalled apps list from SWIS.
       
   204 	 *
       
   205 	 * @param aStatus	A request status which indicates the completion status of the asynchronous request.
       
   206 	 */
       
   207 	TInt RequestUnInstalledPkgsList(const TIpcArgs& aArgs);
       
   208 
       
   209 	/**
       
   210 	 * Request Uninstalled apps list from SWIS.
       
   211 	 *
       
   212 	 * @param aStatus	A request status which indicates the completion status of the asynchronous request.
       
   213 	 */
       
   214 	TInt RemoveUnInstalledPkg(const TIpcArgs& aArgs);
       
   215 
       
   216 	};
       
   217 	
       
   218 } // namespace Swi
       
   219 
       
   220 #endif __INSTALLCLIENTSERVER_H__